Commit a56d72c1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

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.
parent 2ae7b62d
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>
* app/tools/gimprectangleoptions.c: evil => GIMP_MAX_IMAGE_SIZE.
......
......@@ -119,6 +119,11 @@ static GimpActionEntry edit_actions[] =
G_CALLBACK (edit_named_copy_cmd_callback),
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,
N_("_Paste Named..."), "<control><shift>V", NULL,
G_CALLBACK (edit_named_paste_cmd_callback),
......@@ -243,9 +248,10 @@ edit_actions_update (GimpActionGroup *group,
/* "edit-paste" is always enabled */
SET_SENSITIVE ("edit-paste-into", gimage);
SET_SENSITIVE ("edit-named-cut", drawable);
SET_SENSITIVE ("edit-named-copy", drawable);
SET_SENSITIVE ("edit-named-paste", gimage);
SET_SENSITIVE ("edit-named-cut", drawable);
SET_SENSITIVE ("edit-named-copy", drawable);
SET_SENSITIVE ("edit-named-copy-visible", drawable);
SET_SENSITIVE ("edit-named-paste", gimage);
SET_SENSITIVE ("edit-clear", drawable);
SET_SENSITIVE ("edit-fill-fg", drawable);
......
......@@ -57,14 +57,17 @@
/* local function prototypes */
static void edit_paste (GimpDisplay *gdisp,
gboolean paste_into);
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void edit_paste (GimpDisplay *gdisp,
gboolean paste_into);
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
static void copy_named_visible_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data);
/* public functions */
......@@ -280,6 +283,26 @@ edit_named_copy_cmd_callback (GtkAction *action,
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
edit_named_paste_cmd_callback (GtkAction *action,
gpointer data)
......@@ -421,3 +444,20 @@ copy_named_buffer_callback (GtkWidget *widget,
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__
void edit_undo_cmd_callback (GtkAction *action,
gpointer data);
void edit_redo_cmd_callback (GtkAction *action,
gpointer data);
void edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_visible_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_into_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_as_new_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_fill_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void edit_undo_cmd_callback (GtkAction *action,
gpointer data);
void edit_redo_cmd_callback (GtkAction *action,
gpointer data);
void edit_undo_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_copy_visible_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_into_cmd_callback (GtkAction *action,
gpointer data);
void edit_paste_as_new_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_cut_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_copy_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_copy_visible_cmd_callback (GtkAction *action,
gpointer data);
void edit_named_paste_cmd_callback (GtkAction *action,
gpointer data);
void edit_clear_cmd_callback (GtkAction *action,
gpointer data);
void edit_fill_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __EDIT_COMMANDS_H__ */
......@@ -166,6 +166,7 @@
<menu action="edit-buffer-menu" name="Buffer">
<menuitem action="edit-named-cut" />
<menuitem action="edit-named-copy" />
<menuitem action="edit-named-copy-visible" />
<menuitem action="edit-named-paste" />
</menu>
<separator />
......
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