Commit f434da8d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/actions/templates-actions.c when creating an image from a template,

2008-04-07  Sven Neumann  <sven@gimp.org>

	* app/actions/templates-actions.c 
	* app/actions/templates-commands.c: when creating an image from a
        template, skip the New Image dialog as suggested in bug #480802.

svn path=/trunk/; revision=25391
parent f28a2c2c
2008-04-07 Sven Neumann <sven@gimp.org>
* app/actions/templates-actions.c
* app/actions/templates-commands.c: when creating an image from a
template, skip the New Image dialog as suggested in bug #480802.
2008-04-07 Sven Neumann <sven@gimp.org> 2008-04-07 Sven Neumann <sven@gimp.org>
* plug-ins/map-object/map-object-main.c (query): fixed description * plug-ins/map-object/map-object-main.c (query): fixed description
......
...@@ -43,7 +43,7 @@ static const GimpActionEntry templates_actions[] = ...@@ -43,7 +43,7 @@ static const GimpActionEntry templates_actions[] =
GIMP_HELP_TEMPLATE_DIALOG }, GIMP_HELP_TEMPLATE_DIALOG },
{ "templates-create-image", GIMP_STOCK_IMAGE, { "templates-create-image", GIMP_STOCK_IMAGE,
N_("_Create Image from Template..."), "", N_("_Create Image from Template"), "",
N_("Create a new image from the selected template"), N_("Create a new image from the selected template"),
G_CALLBACK (templates_create_image_cmd_callback), G_CALLBACK (templates_create_image_cmd_callback),
GIMP_HELP_TEMPLATE_IMAGE_NEW }, GIMP_HELP_TEMPLATE_IMAGE_NEW },
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "core/gimp-utils.h" #include "core/gimp-utils.h"
#include "core/gimpcontainer.h" #include "core/gimpcontainer.h"
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpimage-new.h"
#include "core/gimptemplate.h" #include "core/gimptemplate.h"
#include "widgets/gimpcontainerview.h" #include "widgets/gimpcontainerview.h"
...@@ -42,9 +43,9 @@ ...@@ -42,9 +43,9 @@
#include "widgets/gimptemplateview.h" #include "widgets/gimptemplateview.h"
#include "dialogs/dialogs.h" #include "dialogs/dialogs.h"
#include "dialogs/image-new-dialog.h"
#include "dialogs/template-options-dialog.h" #include "dialogs/template-options-dialog.h"
#include "actions.h"
#include "templates-commands.h" #include "templates-commands.h"
#include "gimp-intl.h" #include "gimp-intl.h"
...@@ -78,10 +79,12 @@ void ...@@ -78,10 +79,12 @@ void
templates_create_image_cmd_callback (GtkAction *action, templates_create_image_cmd_callback (GtkAction *action,
gpointer data) gpointer data)
{ {
Gimp *gimp;
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data); GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container; GimpContainer *container;
GimpContext *context; GimpContext *context;
GimpTemplate *template; GimpTemplate *template;
return_if_no_gimp(gimp,data);
container = gimp_container_view_get_container (editor->view); container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view); context = gimp_container_view_get_context (editor->view);
...@@ -90,19 +93,8 @@ templates_create_image_cmd_callback (GtkAction *action, ...@@ -90,19 +93,8 @@ templates_create_image_cmd_callback (GtkAction *action,
if (template && gimp_container_have (container, GIMP_OBJECT (template))) if (template && gimp_container_have (container, GIMP_OBJECT (template)))
{ {
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (editor)); gimp_template_create_image (gimp, template, context);
GtkWidget *dialog; gimp_image_new_set_last_template (gimp, template);
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory, screen,
"gimp-image-new-dialog",
-1, FALSE);
if (dialog)
{
image_new_dialog_set (dialog, NULL, template);
gtk_window_present (GTK_WINDOW (dialog));
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment