mirror of https://github.com/GNOME/gimp.git
app/actions/file-actions.c removed action "file-new", added action
2004-05-25 Michael Natterer <mitch@gimp.org> * app/actions/file-actions.c * app/actions/file-commands.[ch]: removed action "file-new", added action "file-open-from-image". * app/actions/image-actions.c * app/actions/image-commands.[ch]: added actions "image-new" and "image-new-from-image". * menus/image-menu.xml.in: use the "-from-image" variants of the "new" and "open" actions so the dialogs are preconfigured from the image they were invoked from (regression fix). * menus/toolbox-menu.xml.in: s/file-new/image-new/.
This commit is contained in:
parent
f70caa9cc5
commit
fe03c38457
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2004-05-25 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/file-actions.c
|
||||
* app/actions/file-commands.[ch]: removed action "file-new", added
|
||||
action "file-open-from-image".
|
||||
|
||||
* app/actions/image-actions.c
|
||||
* app/actions/image-commands.[ch]: added actions "image-new" and
|
||||
"image-new-from-image".
|
||||
|
||||
* menus/image-menu.xml.in: use the "-from-image" variants of
|
||||
the "new" and "open" actions so the dialogs are preconfigured
|
||||
from the image they were invoked from (regression fix).
|
||||
|
||||
* menus/toolbox-menu.xml.in: s/file-new/image-new/.
|
||||
|
||||
2004-05-24 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/rcm/rcm.h
|
||||
|
|
|
@ -66,16 +66,16 @@ static GimpActionEntry file_actions[] =
|
|||
{ "file-acquire-menu", NULL,
|
||||
N_("_Acquire"), NULL, NULL },
|
||||
|
||||
{ "file-new", GTK_STOCK_NEW,
|
||||
N_("_New..."), "<control>N", NULL,
|
||||
G_CALLBACK (file_new_cmd_callback),
|
||||
GIMP_HELP_FILE_NEW },
|
||||
|
||||
{ "file-open", GTK_STOCK_OPEN,
|
||||
N_("_Open..."), "<control>O", NULL,
|
||||
G_CALLBACK (file_open_cmd_callback),
|
||||
GIMP_HELP_FILE_OPEN },
|
||||
|
||||
{ "file-open-from-image", GTK_STOCK_OPEN,
|
||||
N_("_Open..."), "<control>O", NULL,
|
||||
G_CALLBACK (file_open_from_image_cmd_callback),
|
||||
GIMP_HELP_FILE_OPEN },
|
||||
|
||||
{ "file-save", GTK_STOCK_SAVE,
|
||||
N_("_Save"), "<control>S", NULL,
|
||||
G_CALLBACK (file_save_cmd_callback),
|
||||
|
|
|
@ -39,15 +39,12 @@
|
|||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "menus/menus.h"
|
||||
|
||||
#include "gui/dialogs.h"
|
||||
#include "gui/file-new-dialog.h"
|
||||
#include "gui/file-open-dialog.h"
|
||||
#include "gui/file-save-dialog.h"
|
||||
|
||||
|
@ -72,48 +69,29 @@ static void file_revert_confirm_callback (GtkWidget *widget,
|
|||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
file_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GimpImage *gimage;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
/* if called from the image menu */
|
||||
if (GIMP_IS_DISPLAY (data))
|
||||
gimage = gimp_context_get_image (gimp_get_user_context (gimp));
|
||||
else
|
||||
gimage = NULL;
|
||||
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-new-dialog", -1);
|
||||
|
||||
if (dialog)
|
||||
file_new_dialog_set (dialog, gimage, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
file_open_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GimpImage *gimage;
|
||||
GtkWidget *widget;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
/* if called from the image menu */
|
||||
if (GIMP_IS_DISPLAY (data))
|
||||
gimage = gimp_context_get_image (gimp_get_user_context (gimp));
|
||||
else
|
||||
gimage = NULL;
|
||||
file_open_dialog_show (gimp, NULL, NULL, global_menu_factory, widget);
|
||||
}
|
||||
|
||||
file_open_dialog_show (gimp, gimage, NULL, global_menu_factory, widget);
|
||||
void
|
||||
file_open_from_image_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GtkWidget *widget;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
file_open_dialog_show (gimp, action_data_get_image (data),
|
||||
NULL, global_menu_factory, widget);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -20,33 +20,31 @@
|
|||
#define __FILE_COMMANDS_H__
|
||||
|
||||
|
||||
void file_open_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_open_from_image_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_last_opened_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data);
|
||||
|
||||
void file_new_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_as_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_a_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_template_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void file_open_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_last_opened_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data);
|
||||
void file_revert_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_quit_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void file_save_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_as_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_a_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_save_template_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void file_revert_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void file_quit_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void file_file_open_dialog (Gimp *gimp,
|
||||
const gchar *uri,
|
||||
GtkWidget *parent);
|
||||
void file_file_open_dialog (Gimp *gimp,
|
||||
const gchar *uri,
|
||||
GtkWidget *parent);
|
||||
|
||||
|
||||
#endif /* __FILE_COMMANDS_H__ */
|
||||
|
|
|
@ -57,6 +57,16 @@ static GimpActionEntry image_actions[] =
|
|||
{ "image-mode-menu", NULL, N_("_Mode") },
|
||||
{ "image-transform-menu", NULL, N_("_Transform") },
|
||||
|
||||
{ "image-new", GTK_STOCK_NEW,
|
||||
N_("_New..."), "<control>N", NULL,
|
||||
G_CALLBACK (image_new_cmd_callback),
|
||||
GIMP_HELP_FILE_NEW },
|
||||
|
||||
{ "image-new-from-image", GTK_STOCK_NEW,
|
||||
N_("_New..."), "<control>N", NULL,
|
||||
G_CALLBACK (image_new_from_image_cmd_callback),
|
||||
GIMP_HELP_FILE_NEW },
|
||||
|
||||
{ "image-convert-rgb", GIMP_STOCK_CONVERT_RGB,
|
||||
N_("_RGB"), NULL, NULL,
|
||||
G_CALLBACK (image_convert_rgb_cmd_callback),
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "core/gimpimage-scale.h"
|
||||
#include "core/gimpimage-undo.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpdock.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
@ -51,6 +52,8 @@
|
|||
#include "display/gimpprogress.h"
|
||||
|
||||
#include "gui/convert-dialog.h"
|
||||
#include "gui/dialogs.h"
|
||||
#include "gui/file-new-dialog.h"
|
||||
#include "gui/grid-dialog.h"
|
||||
#include "gui/resize-dialog.h"
|
||||
|
||||
|
@ -85,6 +88,40 @@ static void image_scale_implement (ImageResize *image_scale);
|
|||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
image_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-new-dialog", -1);
|
||||
}
|
||||
|
||||
void
|
||||
image_new_from_image_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
"gimp-file-new-dialog", -1);
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
|
||||
if (gimage)
|
||||
file_new_dialog_set (dialog, gimage, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
image_convert_rgb_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
|
|
|
@ -20,6 +20,11 @@
|
|||
#define __IMAGE_COMMANDS_H__
|
||||
|
||||
|
||||
void image_new_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void image_new_from_image_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
void image_convert_rgb_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void image_convert_grayscale_cmd_callback (GtkAction *action,
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
<menu action="file-menu" name="File">
|
||||
<placeholder name="New">
|
||||
<menuitem action="file-new" />
|
||||
<menuitem action="image-new-from-image" />
|
||||
</placeholder>
|
||||
<placeholder name="Open">
|
||||
<menuitem action="file-open" />
|
||||
<menuitem action="file-open-from-image" />
|
||||
</placeholder>
|
||||
<menu action="file-open-recent-menu" name="Open Recent">
|
||||
<placeholder name="Files" />
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<menu action="file-menu" name="File">
|
||||
<placeholder name="New">
|
||||
<menuitem action="file-new" />
|
||||
<menuitem action="image-new" />
|
||||
</placeholder>
|
||||
<placeholder name="Open">
|
||||
<menuitem action="file-open" />
|
||||
|
|
Loading…
Reference in New Issue