app/actions/edit-actions.c app/actions/edit-commands.[ch] applied modified
2005-09-05 Michael Natterer <mitch@gimp.org> * app/actions/edit-actions.c * app/actions/edit-commands.[ch] * menus/image-menu.xml.in: applied modified patch from David Gowers which adds an "edit-named-copy-visible" actions and its menu item. Addresses bug #315130.
This commit is contained in:

committed by
Michael Natterer

parent
2ae7b62d70
commit
a56d72c17e
@ -1,3 +1,11 @@
|
|||||||
|
2005-09-05 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/actions/edit-actions.c
|
||||||
|
* app/actions/edit-commands.[ch]
|
||||||
|
* menus/image-menu.xml.in: applied modified patch from David
|
||||||
|
Gowers which adds an "edit-named-copy-visible" actions and its
|
||||||
|
menu item. Addresses bug #315130.
|
||||||
|
|
||||||
2005-09-04 Karine Delvare <kdelvare@nerim.net>
|
2005-09-04 Karine Delvare <kdelvare@nerim.net>
|
||||||
|
|
||||||
* app/tools/gimprectangleoptions.c: evil => GIMP_MAX_IMAGE_SIZE.
|
* app/tools/gimprectangleoptions.c: evil => GIMP_MAX_IMAGE_SIZE.
|
||||||
|
@ -119,6 +119,11 @@ static GimpActionEntry edit_actions[] =
|
|||||||
G_CALLBACK (edit_named_copy_cmd_callback),
|
G_CALLBACK (edit_named_copy_cmd_callback),
|
||||||
GIMP_HELP_BUFFER_COPY },
|
GIMP_HELP_BUFFER_COPY },
|
||||||
|
|
||||||
|
{ "edit-named-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
|
||||||
|
N_("Copy _Visible Named..."), "", NULL,
|
||||||
|
G_CALLBACK (edit_named_copy_visible_cmd_callback),
|
||||||
|
GIMP_HELP_BUFFER_COPY },
|
||||||
|
|
||||||
{ "edit-named-paste", GTK_STOCK_PASTE,
|
{ "edit-named-paste", GTK_STOCK_PASTE,
|
||||||
N_("_Paste Named..."), "<control><shift>V", NULL,
|
N_("_Paste Named..."), "<control><shift>V", NULL,
|
||||||
G_CALLBACK (edit_named_paste_cmd_callback),
|
G_CALLBACK (edit_named_paste_cmd_callback),
|
||||||
@ -243,9 +248,10 @@ edit_actions_update (GimpActionGroup *group,
|
|||||||
/* "edit-paste" is always enabled */
|
/* "edit-paste" is always enabled */
|
||||||
SET_SENSITIVE ("edit-paste-into", gimage);
|
SET_SENSITIVE ("edit-paste-into", gimage);
|
||||||
|
|
||||||
SET_SENSITIVE ("edit-named-cut", drawable);
|
SET_SENSITIVE ("edit-named-cut", drawable);
|
||||||
SET_SENSITIVE ("edit-named-copy", drawable);
|
SET_SENSITIVE ("edit-named-copy", drawable);
|
||||||
SET_SENSITIVE ("edit-named-paste", gimage);
|
SET_SENSITIVE ("edit-named-copy-visible", drawable);
|
||||||
|
SET_SENSITIVE ("edit-named-paste", gimage);
|
||||||
|
|
||||||
SET_SENSITIVE ("edit-clear", drawable);
|
SET_SENSITIVE ("edit-clear", drawable);
|
||||||
SET_SENSITIVE ("edit-fill-fg", drawable);
|
SET_SENSITIVE ("edit-fill-fg", drawable);
|
||||||
|
@ -57,14 +57,17 @@
|
|||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void edit_paste (GimpDisplay *gdisp,
|
static void edit_paste (GimpDisplay *gdisp,
|
||||||
gboolean paste_into);
|
gboolean paste_into);
|
||||||
static void cut_named_buffer_callback (GtkWidget *widget,
|
static void cut_named_buffer_callback (GtkWidget *widget,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static void copy_named_buffer_callback (GtkWidget *widget,
|
static void copy_named_buffer_callback (GtkWidget *widget,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
static void copy_named_visible_buffer_callback (GtkWidget *widget,
|
||||||
|
const gchar *name,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
/* public functions */
|
/* public functions */
|
||||||
@ -280,6 +283,26 @@ edit_named_copy_cmd_callback (GtkAction *action,
|
|||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
edit_named_copy_visible_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage;
|
||||||
|
GtkWidget *widget;
|
||||||
|
GtkWidget *dialog;
|
||||||
|
return_if_no_image (gimage, data);
|
||||||
|
return_if_no_widget (widget, data);
|
||||||
|
|
||||||
|
dialog = gimp_query_string_box (_("Copy Visible Named "), widget,
|
||||||
|
gimp_standard_help_func,
|
||||||
|
GIMP_HELP_BUFFER_COPY,
|
||||||
|
_("Enter a name for this buffer"),
|
||||||
|
NULL,
|
||||||
|
G_OBJECT (gimage), "disconnect",
|
||||||
|
copy_named_visible_buffer_callback, gimage);
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
edit_named_paste_cmd_callback (GtkAction *action,
|
edit_named_paste_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
@ -421,3 +444,20 @@ copy_named_buffer_callback (GtkWidget *widget,
|
|||||||
gimp_image_flush (gimage);
|
gimp_image_flush (gimage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
copy_named_visible_buffer_callback (GtkWidget *widget,
|
||||||
|
const gchar *name,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpImage *gimage = GIMP_IMAGE (data);
|
||||||
|
|
||||||
|
if (! (name && strlen (name)))
|
||||||
|
name = _("(Unnamed Buffer)");
|
||||||
|
|
||||||
|
if (gimp_edit_named_copy_visible (gimage, name,
|
||||||
|
gimp_get_user_context (gimage->gimp)))
|
||||||
|
{
|
||||||
|
gimp_image_flush (gimage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -20,35 +20,37 @@
|
|||||||
#define __EDIT_COMMANDS_H__
|
#define __EDIT_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
void edit_undo_cmd_callback (GtkAction *action,
|
void edit_undo_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_redo_cmd_callback (GtkAction *action,
|
void edit_redo_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_undo_clear_cmd_callback (GtkAction *action,
|
void edit_undo_clear_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_cut_cmd_callback (GtkAction *action,
|
void edit_cut_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_copy_cmd_callback (GtkAction *action,
|
void edit_copy_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_copy_visible_cmd_callback (GtkAction *action,
|
void edit_copy_visible_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_paste_cmd_callback (GtkAction *action,
|
void edit_paste_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_paste_into_cmd_callback (GtkAction *action,
|
void edit_paste_into_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_paste_as_new_cmd_callback (GtkAction *action,
|
void edit_paste_as_new_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_named_cut_cmd_callback (GtkAction *action,
|
void edit_named_cut_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_named_copy_cmd_callback (GtkAction *action,
|
void edit_named_copy_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_named_paste_cmd_callback (GtkAction *action,
|
void edit_named_copy_visible_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_clear_cmd_callback (GtkAction *action,
|
void edit_named_paste_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void edit_fill_cmd_callback (GtkAction *action,
|
void edit_clear_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
gpointer data);
|
||||||
gpointer data);
|
void edit_fill_cmd_callback (GtkAction *action,
|
||||||
|
gint value,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __EDIT_COMMANDS_H__ */
|
#endif /* __EDIT_COMMANDS_H__ */
|
||||||
|
@ -166,6 +166,7 @@
|
|||||||
<menu action="edit-buffer-menu" name="Buffer">
|
<menu action="edit-buffer-menu" name="Buffer">
|
||||||
<menuitem action="edit-named-cut" />
|
<menuitem action="edit-named-cut" />
|
||||||
<menuitem action="edit-named-copy" />
|
<menuitem action="edit-named-copy" />
|
||||||
|
<menuitem action="edit-named-copy-visible" />
|
||||||
<menuitem action="edit-named-paste" />
|
<menuitem action="edit-named-paste" />
|
||||||
</menu>
|
</menu>
|
||||||
<separator />
|
<separator />
|
||||||
|
Reference in New Issue
Block a user