[eog] Add UI elements for deleting images
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Add UI elements for deleting images
- Date: Wed, 1 May 2013 17:48:43 +0000 (UTC)
commit 6ffb1424cb5e11f1403a7cd62d81cd52d4bf550b
Author: Felix Riemann <friemann gnome org>
Date: Wed May 1 19:43:43 2013 +0200
Add UI elements for deleting images
https://bugzilla.gnome.org/show_bug.cgi?id=563538
data/eog-toolbar.xml | 1 +
data/eog-ui.xml | 1 +
src/eog-window.c | 33 ++++++++++++++++++---------------
3 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/data/eog-toolbar.xml b/data/eog-toolbar.xml
index 0ff0c24..cb51eaa 100644
--- a/data/eog-toolbar.xml
+++ b/data/eog-toolbar.xml
@@ -20,6 +20,7 @@
<toolitem name="GoPrevious"/>
<toolitem name="GoNext"/>
<toolitem name="EditMoveToTrash"/>
+ <toolitem name="EditDelete"/>
</available>
<toolbar name="Toolbar">
<toolitem name="GoPrevious"/>
diff --git a/data/eog-ui.xml b/data/eog-ui.xml
index 9cb695d..dce6992 100644
--- a/data/eog-ui.xml
+++ b/data/eog-ui.xml
@@ -32,6 +32,7 @@
<menuitem action="EditRotate270"/>
<separator/>
<menuitem action="EditMoveToTrash"/>
+ <menuitem action="EditDelete"/>
<separator/>
<menuitem action="EditToolbar"/>
<menuitem action="EditPreferences"/>
diff --git a/src/eog-window.c b/src/eog-window.c
index 87db60d..ccf9564 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -3543,6 +3543,21 @@ eog_window_force_image_delete (EogWindow *window,
}
}
+static void
+eog_window_cmd_delete (GtkAction *action, gpointer user_data)
+{
+ EogWindow *window;
+ GList *images;
+ gint result;
+
+ window = EOG_WINDOW (user_data);
+ images = eog_thumb_view_get_selected_images (EOG_THUMB_VIEW (window->priv->thumbview));
+ result = show_force_image_delete_confirm_dialog (window, images);
+
+ if (result == GTK_RESPONSE_OK)
+ eog_window_force_image_delete (window, images);
+}
+
static int
show_move_to_trash_confirm_dialog (EogWindow *window, GList *images, gboolean can_trash)
{
@@ -4093,6 +4108,9 @@ static const GtkActionEntry action_entries_image[] = {
{ "EditMoveToTrash", "user-trash", N_("Move to _Trash"), NULL,
N_("Move the selected image to the trash folder"),
G_CALLBACK (eog_window_cmd_move_to_trash) },
+ { "EditDelete", "edit-delete", N_("Delete Image"), "<shift>Delete",
+ N_("Delete the selected image"),
+ G_CALLBACK (eog_window_cmd_delete) },
{ "EditCopyImage", "edit-copy", N_("_Copy"), "<control>C",
N_("Copy the selected image to the clipboard"),
G_CALLBACK (eog_window_cmd_copy_image) },
@@ -5189,21 +5207,6 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
modifiers = gtk_accelerator_get_default_mod_mask ();
switch (event->keyval) {
- case GDK_KEY_Delete:
- if ((event->state & modifiers) == GDK_SHIFT_MASK) {
- EogWindow *window;
- GList *images;
- gint result;
-
- window = EOG_WINDOW (widget);
- images = eog_thumb_view_get_selected_images (EOG_THUMB_VIEW
(window->priv->thumbview));
- result = show_force_image_delete_confirm_dialog (window, images);
-
- if (result == GTK_RESPONSE_OK)
- eog_window_force_image_delete (window, images);
- }
-
- break;
case GDK_KEY_space:
if ((event->state & modifiers) == GDK_CONTROL_MASK) {
handle_selection = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]