[eog/wip/gaction-migration] Don't reuse the GtkMenu but the menu model for the thumb view



commit 85339ccdbdb17af357dc837f12791b9d2fb151e2
Author: Felix Riemann <friemann gnome org>
Date:   Thu Dec 18 20:53:55 2014 +0100

    Don't reuse the GtkMenu but the menu model for the thumb view

 data/popup-menus.ui |   50 --------------------------------------------------
 src/eog-window.c    |   16 ++++++++--------
 2 files changed, 8 insertions(+), 58 deletions(-)
---
diff --git a/data/popup-menus.ui b/data/popup-menus.ui
index 813b6ec..5670a0f 100644
--- a/data/popup-menus.ui
+++ b/data/popup-menus.ui
@@ -50,54 +50,4 @@
       </item>
     </section>
   </menu>
-  <menu id="thumbnail-popup">
-    <section>
-      <submenu>
-        <attribute name="label" translatable="yes">Open _with</attribute>
-        <section id="open-with-placeholder"/>
-      </submenu>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Save</attribute>
-        <attribute name="action">win.ImageSave</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">Save _As…</attribute>
-        <attribute name="action">win.ImageSaveAs</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Print…</attribute>
-        <attribute name="action">win.ImagePrint</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Copy</attribute>
-        <attribute name="action">win.EditCopyImage</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">Move to _Trash</attribute>
-        <attribute name="action">win.EditMoveToTrash</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">Prope_rties</attribute>
-        <attribute name="action">win.ImageProperties</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">Set as Wa_llpaper</attribute>
-        <attribute name="action">win.ImageSetAsWallpaper</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">Show Containing _Folder</attribute>
-        <attribute name="action">win.ImageOpenContainingFolder</attribute>
-      </item>
-    </section>
-  </menu>
 </interface>
diff --git a/src/eog-window.c b/src/eog-window.c
index 67f8b89..74ed5e0 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -4396,7 +4396,7 @@ static void
 eog_window_construct_ui (EogWindow *window)
 {
        EogWindowPrivate *priv;
-       GtkWidget *popup;
+       GtkWidget *popup_menu;
        GtkWidget *hpaned;
        GAction *action = NULL;
        GtkBuilder *builder;
@@ -4517,12 +4517,12 @@ eog_window_construct_ui (EogWindow *window)
 
        builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/popup-menus.ui");
        builder_object = gtk_builder_get_object (builder, "view-popup-menu");
-       popup = gtk_menu_new_from_model (G_MENU_MODEL(builder_object));
+       popup_menu = gtk_menu_new_from_model (G_MENU_MODEL(builder_object));
 
        eog_scroll_view_set_popup (EOG_SCROLL_VIEW (priv->view),
-                                  GTK_MENU (popup));
+                                  GTK_MENU (popup_menu));
 
-       g_object_unref (popup);
+       g_object_unref (popup_menu);
 
        gtk_paned_pack1 (GTK_PANED (hpaned),
                         priv->sidebar,
@@ -4556,12 +4556,12 @@ eog_window_construct_ui (EogWindow *window)
        g_settings_bind (priv->ui_settings, EOG_CONF_UI_SCROLL_BUTTONS,
                         priv->nav, "show-buttons", G_SETTINGS_BIND_GET);
 
-       builder_object = gtk_builder_get_object (builder, "thumbnail-popup");
-       popup = gtk_menu_new_from_model (G_MENU_MODEL(builder_object));
+       // Re-use the scroll view's popup menu model for the thumb view
+       popup_menu = gtk_menu_new_from_model (G_MENU_MODEL(builder_object));
        eog_thumb_view_set_thumbnail_popup (EOG_THUMB_VIEW (priv->thumbview),
-                                           GTK_MENU (popup));
+                                           GTK_MENU (popup_menu));
 
-       g_object_unref (popup);
+       g_object_unref (popup_menu);
        g_clear_object (&builder);
 
        gtk_box_pack_start (GTK_BOX (priv->layout), priv->nav, FALSE, FALSE, 0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]