Commit 8611bb4c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/actions/documents-actions.c app/actions/documents-commands.[ch]

2005-07-07  Michael Natterer  <mitch@gimp.org>

	* app/actions/documents-actions.c
	* app/actions/documents-commands.[ch]
	* app/widgets/gimphelp-ids.h
	* menus/documents-menu.xml: added "Copy Image Location" to the
	document history popup menu which copies the image's URI to
	clipbpard and primary.
parent 1fbd2d51
2005-07-07 Michael Natterer <mitch@gimp.org>
* app/actions/documents-actions.c
* app/actions/documents-commands.[ch]
* app/widgets/gimphelp-ids.h
* menus/documents-menu.xml: added "Copy Image Location" to the
document history popup menu which copies the image's URI to
clipbpard and primary.
2005-07-07 Sven Neumann <sven@gimp.org>
* app/actions/gradient-editor-commands.c
......
......@@ -60,6 +60,12 @@ static GimpActionEntry documents_actions[] =
G_CALLBACK (documents_file_open_dialog_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-copy-location", GTK_STOCK_COPY,
N_("Copy Image _Location"), "",
N_("Copy image location to clipboard"),
G_CALLBACK (documents_copy_location_cmd_callback),
GIMP_HELP_DOCUMENT_COPY_LOCATION },
{ "documents-remove", GTK_STOCK_REMOVE,
N_("Remove _Entry"), "",
N_("Remove the selected entry"),
......@@ -118,6 +124,7 @@ documents_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("documents-open", imagefile);
SET_SENSITIVE ("documents-raise-or-open", imagefile);
SET_SENSITIVE ("documents-file-open-dialog", TRUE);
SET_SENSITIVE ("documents-copy-location", imagefile);
SET_SENSITIVE ("documents-remove", imagefile);
SET_SENSITIVE ("documents-clear", TRUE);
SET_SENSITIVE ("documents-recreate-preview", imagefile);
......
......@@ -147,6 +147,34 @@ documents_file_open_dialog_cmd_callback (GtkAction *action,
}
}
void
documents_copy_location_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpImagefile *imagefile;
context = gimp_container_view_get_context (editor->view);
imagefile = gimp_context_get_imagefile (context);
if (imagefile)
{
GtkClipboard *clipboard;
const gchar *uri;
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
clipboard = gtk_clipboard_get_for_display (gdk_display_get_default (),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, uri, -1);
clipboard = gtk_clipboard_get_for_display (gdk_display_get_default (),
GDK_SELECTION_PRIMARY);
gtk_clipboard_set_text (clipboard, uri, -1);
}
}
void
documents_remove_cmd_callback (GtkAction *action,
gpointer data)
......
......@@ -26,6 +26,8 @@ void documents_raise_or_open_cmd_callback (GtkAction *action,
gpointer data);
void documents_file_open_dialog_cmd_callback (GtkAction *action,
gpointer data);
void documents_copy_location_cmd_callback (GtkAction *action,
gpointer data);
void documents_remove_cmd_callback (GtkAction *action,
gpointer data);
void documents_clear_cmd_callback (GtkAction *action,
......
......@@ -351,6 +351,7 @@
#define GIMP_HELP_BUFFER_DELETE "gimp-buffer-delete"
#define GIMP_HELP_DOCUMENT_CLEAR "gimp-document-clear"
#define GIMP_HELP_DOCUMENT_COPY_LOCATION "gimp-document-copy-location"
#define GIMP_HELP_DOCUMENT_DIALOG "gimp-document-dialog"
#define GIMP_HELP_DOCUMENT_OPEN "gimp-document-open"
#define GIMP_HELP_DOCUMENT_REMOVE "gimp-document-remove"
......
......@@ -6,6 +6,7 @@
<menuitem action="documents-open" />
<menuitem action="documents-raise-or-open" />
<menuitem action="documents-file-open-dialog" />
<menuitem action="documents-copy-location" />
<menuitem action="documents-remove" />
<menuitem action="documents-clear" />
<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