2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1999-05-19 01:33:39 +08:00
|
|
|
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-05-19 01:33:39 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1999-05-19 01:33:39 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1999-05-19 01:33:39 +08:00
|
|
|
*/
|
2000-10-27 06:02:44 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-10-15 23:30:11 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-05-22 04:30:16 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "dialogs-types.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2002-11-19 04:50:31 +08:00
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimp.h"
|
2006-09-01 19:26:54 +08:00
|
|
|
#include "core/gimpcontext.h"
|
2001-10-29 19:47:11 +08:00
|
|
|
#include "core/gimpimage.h"
|
2001-07-05 23:34:26 +08:00
|
|
|
#include "core/gimpimage-new.h"
|
2003-04-04 01:50:56 +08:00
|
|
|
#include "core/gimptemplate.h"
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2004-05-11 20:13:31 +08:00
|
|
|
#include "widgets/gimpcontainercombobox.h"
|
2003-08-21 23:54:47 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2004-10-14 03:02:37 +08:00
|
|
|
#include "widgets/gimpmessagebox.h"
|
|
|
|
#include "widgets/gimpmessagedialog.h"
|
2003-04-11 21:17:23 +08:00
|
|
|
#include "widgets/gimptemplateeditor.h"
|
2002-05-13 23:35:27 +08:00
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
#include "image-new-dialog.h"
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2003-11-06 23:27:05 +08:00
|
|
|
#define RESPONSE_RESET 1
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2003-04-04 01:50:56 +08:00
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *confirm_dialog;
|
1999-05-19 01:33:39 +08:00
|
|
|
|
2004-05-11 20:13:31 +08:00
|
|
|
GtkWidget *combo;
|
2003-04-11 21:17:23 +08:00
|
|
|
GtkWidget *editor;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
GimpContext *context;
|
2003-10-14 23:20:59 +08:00
|
|
|
GimpTemplate *template;
|
2004-09-13 23:15:23 +08:00
|
|
|
} ImageNewDialog;
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2007-05-24 04:08:27 +08:00
|
|
|
static void image_new_dialog_free (ImageNewDialog *dialog);
|
|
|
|
static void image_new_dialog_response (GtkWidget *widget,
|
2006-09-02 00:55:37 +08:00
|
|
|
gint response_id,
|
|
|
|
ImageNewDialog *dialog);
|
|
|
|
static void image_new_template_changed (GimpContext *context,
|
|
|
|
GimpTemplate *template,
|
|
|
|
ImageNewDialog *dialog);
|
|
|
|
static void image_new_confirm_dialog (ImageNewDialog *dialog);
|
|
|
|
static void image_new_create_image (ImageNewDialog *dialog);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2001-06-26 20:09:43 +08:00
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
/* public functions */
|
1998-06-10 05:21:23 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
GtkWidget *
|
2006-09-01 19:26:54 +08:00
|
|
|
image_new_dialog_new (GimpContext *context)
|
1999-08-26 12:39:21 +08:00
|
|
|
{
|
2004-09-13 23:15:23 +08:00
|
|
|
ImageNewDialog *dialog;
|
|
|
|
GtkWidget *main_vbox;
|
|
|
|
GtkWidget *table;
|
2005-02-10 00:57:18 +08:00
|
|
|
GimpSizeEntry *entry;
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2007-05-24 04:08:27 +08:00
|
|
|
dialog = g_slice_new0 (ImageNewDialog);
|
2001-07-05 23:34:26 +08:00
|
|
|
|
2006-09-02 00:55:37 +08:00
|
|
|
dialog->context = gimp_context_new (context->gimp, "image-new-dialog",
|
|
|
|
context);
|
2003-10-14 23:20:59 +08:00
|
|
|
dialog->template = g_object_new (GIMP_TYPE_TEMPLATE, NULL);
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2004-05-06 05:23:45 +08:00
|
|
|
dialog->dialog = gimp_dialog_new (_("Create a New Image"),
|
|
|
|
"gimp-image-new",
|
|
|
|
NULL, 0,
|
2004-10-05 00:21:52 +08:00
|
|
|
gimp_standard_help_func, GIMP_HELP_FILE_NEW,
|
1999-05-31 22:11:10 +08:00
|
|
|
|
2004-05-06 05:23:45 +08:00
|
|
|
GIMP_STOCK_RESET, RESPONSE_RESET,
|
|
|
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
|
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2004-05-06 05:23:45 +08:00
|
|
|
NULL);
|
2002-02-07 19:50:16 +08:00
|
|
|
|
2004-10-24 03:01:26 +08:00
|
|
|
gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE);
|
2003-11-06 23:27:05 +08:00
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (dialog->dialog),
|
2004-09-13 23:15:23 +08:00
|
|
|
"gimp-image-new-dialog", dialog,
|
2007-05-24 04:08:27 +08:00
|
|
|
(GDestroyNotify) image_new_dialog_free);
|
2003-05-03 02:43:15 +08:00
|
|
|
|
2004-10-24 03:01:26 +08:00
|
|
|
g_signal_connect (dialog->dialog, "response",
|
2007-05-24 04:08:27 +08:00
|
|
|
G_CALLBACK (image_new_dialog_response),
|
2004-10-24 03:01:26 +08:00
|
|
|
dialog);
|
1998-06-09 05:53:45 +08:00
|
|
|
|
2005-02-09 04:40:33 +08:00
|
|
|
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog->dialog),
|
|
|
|
RESPONSE_RESET,
|
|
|
|
GTK_RESPONSE_OK,
|
|
|
|
GTK_RESPONSE_CANCEL,
|
|
|
|
-1);
|
|
|
|
|
2004-05-03 23:37:56 +08:00
|
|
|
main_vbox = gtk_vbox_new (FALSE, 12);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
|
2009-07-15 22:19:32 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog->dialog))),
|
2006-04-12 20:49:29 +08:00
|
|
|
main_vbox, TRUE, TRUE, 0);
|
2002-09-08 00:47:39 +08:00
|
|
|
gtk_widget_show (main_vbox);
|
1999-04-03 03:46:59 +08:00
|
|
|
|
2003-04-11 04:08:56 +08:00
|
|
|
table = gtk_table_new (1, 2, FALSE);
|
2004-05-21 22:17:27 +08:00
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
2003-04-11 04:08:56 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
2003-04-04 01:50:56 +08:00
|
|
|
|
2005-03-18 08:31:29 +08:00
|
|
|
dialog->combo = g_object_new (GIMP_TYPE_CONTAINER_COMBO_BOX,
|
2006-09-01 19:26:54 +08:00
|
|
|
"container", context->gimp->templates,
|
2006-09-02 00:55:37 +08:00
|
|
|
"context", dialog->context,
|
2006-01-18 00:26:18 +08:00
|
|
|
"view-size", 16,
|
|
|
|
"view-border-width", 0,
|
2006-08-09 06:15:46 +08:00
|
|
|
"ellipsize", PANGO_ELLIPSIZE_NONE,
|
2006-01-18 00:26:18 +08:00
|
|
|
"focus-on-click", FALSE,
|
2005-03-18 08:31:29 +08:00
|
|
|
NULL);
|
2003-04-04 01:50:56 +08:00
|
|
|
|
2003-04-11 04:08:56 +08:00
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
2004-05-12 19:37:21 +08:00
|
|
|
_("_Template:"), 0.0, 0.5,
|
2006-08-09 06:15:46 +08:00
|
|
|
dialog->combo, 1, TRUE);
|
2003-04-04 01:50:56 +08:00
|
|
|
|
2006-09-02 00:55:37 +08:00
|
|
|
g_signal_connect (dialog->context, "template-changed",
|
|
|
|
G_CALLBACK (image_new_template_changed),
|
2003-04-12 01:42:59 +08:00
|
|
|
dialog);
|
2003-04-04 01:50:56 +08:00
|
|
|
|
2003-04-11 21:17:23 +08:00
|
|
|
/* Template editor */
|
2006-09-01 19:26:54 +08:00
|
|
|
dialog->editor = gimp_template_editor_new (dialog->template, context->gimp,
|
|
|
|
FALSE);
|
2003-04-12 01:42:59 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), dialog->editor, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (dialog->editor);
|
2003-04-11 21:17:23 +08:00
|
|
|
|
2005-02-10 00:57:18 +08:00
|
|
|
entry = GIMP_SIZE_ENTRY (GIMP_TEMPLATE_EDITOR (dialog->editor)->size_se);
|
|
|
|
gimp_size_entry_set_activates_default (entry, TRUE);
|
|
|
|
gimp_size_entry_grab_focus (entry);
|
|
|
|
|
2006-09-02 00:55:37 +08:00
|
|
|
image_new_template_changed (dialog->context,
|
|
|
|
gimp_context_get_template (dialog->context),
|
|
|
|
dialog);
|
|
|
|
|
2003-05-03 02:43:15 +08:00
|
|
|
return dialog->dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-09-13 23:15:23 +08:00
|
|
|
image_new_dialog_set (GtkWidget *widget,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image,
|
2004-09-13 23:15:23 +08:00
|
|
|
GimpTemplate *template)
|
2003-05-03 02:43:15 +08:00
|
|
|
{
|
2004-09-13 23:15:23 +08:00
|
|
|
ImageNewDialog *dialog;
|
2003-05-03 02:43:15 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image));
|
2003-05-03 02:43:15 +08:00
|
|
|
g_return_if_fail (template == NULL || GIMP_IS_TEMPLATE (template));
|
|
|
|
|
2004-09-13 23:15:23 +08:00
|
|
|
dialog = g_object_get_data (G_OBJECT (widget), "gimp-image-new-dialog");
|
2003-05-03 02:43:15 +08:00
|
|
|
|
|
|
|
g_return_if_fail (dialog != NULL);
|
|
|
|
|
2006-09-02 00:55:37 +08:00
|
|
|
gimp_context_set_template (dialog->context, template);
|
|
|
|
|
|
|
|
if (! template)
|
2003-04-14 00:25:14 +08:00
|
|
|
{
|
2006-09-01 19:26:54 +08:00
|
|
|
template = gimp_image_new_get_last_template (dialog->context->gimp,
|
|
|
|
image);
|
2003-10-14 23:20:59 +08:00
|
|
|
|
2008-11-27 15:26:44 +08:00
|
|
|
/* make sure the resolution values are copied first (see bug #546924) */
|
|
|
|
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
|
|
|
|
GIMP_TEMPLATE_PARAM_COPY_FIRST);
|
|
|
|
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
|
|
|
|
0);
|
2003-10-14 23:20:59 +08:00
|
|
|
|
2003-04-14 00:25:14 +08:00
|
|
|
g_object_unref (template);
|
|
|
|
}
|
1998-06-18 13:04:01 +08:00
|
|
|
}
|
2001-10-29 19:47:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2006-09-02 00:55:37 +08:00
|
|
|
static void
|
2007-05-24 04:08:27 +08:00
|
|
|
image_new_dialog_free (ImageNewDialog *dialog)
|
2006-09-02 00:55:37 +08:00
|
|
|
{
|
|
|
|
g_object_unref (dialog->context);
|
|
|
|
g_object_unref (dialog->template);
|
2007-05-24 04:08:27 +08:00
|
|
|
|
|
|
|
g_slice_free (ImageNewDialog, dialog);
|
2006-09-02 00:55:37 +08:00
|
|
|
}
|
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
static void
|
2007-05-24 04:08:27 +08:00
|
|
|
image_new_dialog_response (GtkWidget *widget,
|
|
|
|
gint response_id,
|
|
|
|
ImageNewDialog *dialog)
|
2001-10-29 19:47:11 +08:00
|
|
|
{
|
2003-11-06 23:27:05 +08:00
|
|
|
switch (response_id)
|
|
|
|
{
|
|
|
|
case RESPONSE_RESET:
|
2006-09-01 19:26:54 +08:00
|
|
|
gimp_config_sync (G_OBJECT (dialog->context->gimp->config->default_image),
|
2005-04-07 18:05:54 +08:00
|
|
|
G_OBJECT (dialog->template), 0);
|
2006-09-02 00:55:37 +08:00
|
|
|
gimp_context_set_template (dialog->context, NULL);
|
2003-11-06 23:27:05 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_RESPONSE_OK:
|
2003-11-14 20:05:13 +08:00
|
|
|
if (dialog->template->initial_size >
|
2006-09-01 19:26:54 +08:00
|
|
|
GIMP_GUI_CONFIG (dialog->context->gimp->config)->max_new_image_size)
|
2004-09-13 23:15:23 +08:00
|
|
|
image_new_confirm_dialog (dialog);
|
2003-11-06 23:27:05 +08:00
|
|
|
else
|
2004-09-13 23:15:23 +08:00
|
|
|
image_new_create_image (dialog);
|
2003-11-06 23:27:05 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gtk_widget_destroy (dialog->dialog);
|
|
|
|
break;
|
|
|
|
}
|
2003-04-11 04:08:56 +08:00
|
|
|
}
|
|
|
|
|
2003-04-04 23:11:30 +08:00
|
|
|
static void
|
2006-09-02 00:55:37 +08:00
|
|
|
image_new_template_changed (GimpContext *context,
|
|
|
|
GimpTemplate *template,
|
|
|
|
ImageNewDialog *dialog)
|
2003-04-04 23:11:30 +08:00
|
|
|
{
|
2003-10-15 23:30:11 +08:00
|
|
|
gchar *comment = NULL;
|
|
|
|
|
|
|
|
if (!template)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!template->comment || !strlen (template->comment))
|
|
|
|
comment = g_strdup (dialog->template->comment);
|
|
|
|
|
2008-10-01 00:06:24 +08:00
|
|
|
/* make sure the resolution values are copied first (see bug #546924) */
|
|
|
|
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template),
|
|
|
|
GIMP_TEMPLATE_PARAM_COPY_FIRST);
|
2005-04-07 18:05:54 +08:00
|
|
|
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0);
|
2003-10-15 23:30:11 +08:00
|
|
|
|
|
|
|
if (comment)
|
|
|
|
{
|
|
|
|
g_object_set (dialog->template,
|
|
|
|
"comment", comment,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_free (comment);
|
|
|
|
}
|
2001-10-29 19:47:11 +08:00
|
|
|
}
|
|
|
|
|
2003-04-04 23:11:30 +08:00
|
|
|
|
|
|
|
/* the confirm dialog */
|
|
|
|
|
2001-10-29 19:47:11 +08:00
|
|
|
static void
|
2004-10-14 03:02:37 +08:00
|
|
|
image_new_confirm_response (GtkWidget *dialog,
|
|
|
|
gint response_id,
|
|
|
|
ImageNewDialog *data)
|
2001-10-29 19:47:11 +08:00
|
|
|
{
|
2004-10-14 03:02:37 +08:00
|
|
|
gtk_widget_destroy (dialog);
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2004-10-14 03:02:37 +08:00
|
|
|
data->confirm_dialog = NULL;
|
2001-10-29 19:47:11 +08:00
|
|
|
|
2004-10-14 03:02:37 +08:00
|
|
|
if (response_id == GTK_RESPONSE_OK)
|
|
|
|
image_new_create_image (data);
|
2001-10-29 19:47:11 +08:00
|
|
|
else
|
2004-10-14 03:02:37 +08:00
|
|
|
gtk_widget_set_sensitive (data->dialog, TRUE);
|
2001-10-29 19:47:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-10-14 03:02:37 +08:00
|
|
|
image_new_confirm_dialog (ImageNewDialog *data)
|
2001-10-29 19:47:11 +08:00
|
|
|
{
|
2004-10-14 03:02:37 +08:00
|
|
|
GimpGuiConfig *config;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
gchar *size;
|
|
|
|
|
|
|
|
if (data->confirm_dialog)
|
|
|
|
{
|
|
|
|
gtk_window_present (GTK_WINDOW (data->confirm_dialog));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
data->confirm_dialog =
|
|
|
|
dialog = gimp_message_dialog_new (_("Confirm Image Size"),
|
|
|
|
GIMP_STOCK_WARNING,
|
|
|
|
data->dialog,
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
gimp_standard_help_func, NULL,
|
|
|
|
|
|
|
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
|
|
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
2005-02-10 19:00:46 +08:00
|
|
|
gtk_dialog_set_alternative_button_order (GTK_DIALOG (data->confirm_dialog),
|
|
|
|
GTK_RESPONSE_OK,
|
|
|
|
GTK_RESPONSE_CANCEL,
|
|
|
|
-1);
|
|
|
|
|
2004-10-14 03:02:37 +08:00
|
|
|
g_signal_connect (dialog, "response",
|
|
|
|
G_CALLBACK (image_new_confirm_response),
|
|
|
|
data);
|
|
|
|
|
2008-03-29 00:33:24 +08:00
|
|
|
size = g_format_size_for_display (data->template->initial_size);
|
2004-10-14 03:02:37 +08:00
|
|
|
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
|
|
|
_("You are trying to create an image "
|
|
|
|
"with a size of %s."), size);
|
|
|
|
g_free (size);
|
|
|
|
|
2006-09-01 19:26:54 +08:00
|
|
|
config = GIMP_GUI_CONFIG (data->context->gimp->config);
|
2008-03-29 00:33:24 +08:00
|
|
|
size = g_format_size_for_display (config->max_new_image_size);
|
2004-10-14 03:02:37 +08:00
|
|
|
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
2005-04-15 00:19:30 +08:00
|
|
|
_("An image of the chosen size will use more "
|
2004-10-14 03:02:37 +08:00
|
|
|
"memory than what is configured as "
|
|
|
|
"\"Maximum Image Size\" in the Preferences "
|
|
|
|
"dialog (currently %s)."), size);
|
|
|
|
g_free (size);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (data->dialog, FALSE);
|
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
2001-10-29 19:47:11 +08:00
|
|
|
}
|
2003-04-11 21:17:23 +08:00
|
|
|
|
|
|
|
static void
|
2004-09-13 23:15:23 +08:00
|
|
|
image_new_create_image (ImageNewDialog *dialog)
|
2003-04-11 21:17:23 +08:00
|
|
|
{
|
2006-09-13 20:13:33 +08:00
|
|
|
GimpTemplate *template = g_object_ref (dialog->template);
|
|
|
|
Gimp *gimp = dialog->context->gimp;
|
2003-05-03 02:43:15 +08:00
|
|
|
|
2003-04-12 01:42:59 +08:00
|
|
|
gtk_widget_destroy (dialog->dialog);
|
2003-04-11 21:17:23 +08:00
|
|
|
|
2008-02-05 18:33:10 +08:00
|
|
|
gimp_template_create_image (gimp, template, gimp_get_user_context (gimp));
|
2003-05-03 02:43:15 +08:00
|
|
|
gimp_image_new_set_last_template (gimp, template);
|
2003-10-14 23:20:59 +08:00
|
|
|
|
2003-04-11 21:17:23 +08:00
|
|
|
g_object_unref (template);
|
|
|
|
}
|