[shotwell/wip/dedeprecate: 12/26] wip: Remove UIManager



commit 7976e69b34976a7db701416fa17d19dbc16bb0c4
Author: Jens Georg <mail jensge org>
Date:   Wed Oct 19 23:11:31 2016 +0200

    wip: Remove UIManager
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/searches/Branch.vala     |   11 -----------
 src/sidebar/Tree.vala        |    2 ++
 src/tags/Branch.vala         |   12 ------------
 ui/search_sidebar_context.ui |    2 +-
 ui/tag_sidebar_context.ui    |    4 ++--
 5 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/src/searches/Branch.vala b/src/searches/Branch.vala
index f9824da..f557baa 100644
--- a/src/searches/Branch.vala
+++ b/src/searches/Branch.vala
@@ -69,8 +69,6 @@ public class Searches.Header : Sidebar.Header, Sidebar.Contextable {
         setup_context_menu();
     }
 
-    private const GLib.ActionEntry[] entries = { { "new", on_new_search } };
-
     private void setup_context_menu() {
         this.builder = new Gtk.Builder ();
         try {
@@ -78,9 +76,6 @@ public class Searches.Header : Sidebar.Header, Sidebar.Contextable {
                             ("/org/gnome/Shotwell/search_sidebar_context.ui");
             var model = builder.get_object ("popup-menu") as GLib.MenuModel;
             this.context_menu = new Gtk.Menu.from_model (model);
-            var group = new GLib.SimpleActionGroup ();
-            group.add_action_entries (entries, this);
-            this.context_menu.insert_action_group ("search", group);
         } catch (Error error) {
             AppWindow.error_message("Error loading UI resource: %s".printf(
                 error.message));
@@ -91,12 +86,6 @@ public class Searches.Header : Sidebar.Header, Sidebar.Contextable {
     public Gtk.Menu? get_sidebar_context_menu(Gdk.EventButton? event) {
         return context_menu;
     }
-
-    private void on_new_search(GLib.SimpleAction action,
-                               GLib.Variant? parameter) {
-        var dialog = new SavedSearchDialog ();
-        dialog.show ();
-    }
 }
 
 public class Searches.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.RenameableEntry,
diff --git a/src/sidebar/Tree.vala b/src/sidebar/Tree.vala
index f02eac0..267c8de 100644
--- a/src/sidebar/Tree.vala
+++ b/src/sidebar/Tree.vala
@@ -846,6 +846,8 @@ public class Sidebar.Tree : Gtk.TreeView {
         if (context_menu == null)
             return false;
 
+        context_menu.attach_to_widget (this, null);
+
         if (event != null)
             context_menu.popup(null, null, null, event.button, event.time);
         else
diff --git a/src/tags/Branch.vala b/src/tags/Branch.vala
index c8cfe95..41c6feb 100644
--- a/src/tags/Branch.vala
+++ b/src/tags/Branch.vala
@@ -132,8 +132,6 @@ public class Tags.Header : Sidebar.Header, Sidebar.InternalDropTargetEntry,
         setup_context_menu();
     }
 
-    private const GLib.ActionEntry[] entries = { { "new", on_new_tag } };
-
     private void setup_context_menu() {
         this.builder = new Gtk.Builder ();
         try {
@@ -141,9 +139,6 @@ public class Tags.Header : Sidebar.Header, Sidebar.InternalDropTargetEntry,
                             ("/org/gnome/Shotwell/tag_sidebar_context.ui");
             var model = builder.get_object ("popup-menu") as GLib.MenuModel;
             this.context_menu = new Gtk.Menu.from_model (model);
-            var group = new GLib.SimpleActionGroup ();
-            group.add_action_entries (entries, this);
-            this.context_menu.insert_action_group ("tag", group);
         } catch (Error error) {
             AppWindow.error_message("Error loading UI resource: %s".printf(
                 error.message));
@@ -187,13 +182,6 @@ public class Tags.Header : Sidebar.Header, Sidebar.InternalDropTargetEntry,
     public Gtk.Menu? get_sidebar_context_menu(Gdk.EventButton? event) {
         return context_menu;
     }
-    
-    private void on_new_tag (GLib.SimpleAction action,
-                             GLib.Variant? parameter) {
-        NewRootTagCommand creation_command = new NewRootTagCommand();
-        AppWindow.get_command_manager().execute(creation_command);
-        LibraryWindow.get_app().rename_tag_in_sidebar(creation_command.get_created_tag());
-    }
 }
 
 public class Tags.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.RenameableEntry,
diff --git a/ui/search_sidebar_context.ui b/ui/search_sidebar_context.ui
index 3b6e493..76963e1 100644
--- a/ui/search_sidebar_context.ui
+++ b/ui/search_sidebar_context.ui
@@ -4,7 +4,7 @@
     <section>
       <item>
         <attribute name="label" translatable="yes">Ne_w Saved Search…</attribute>
-        <attribute name="action">search.new</attribute>
+        <attribute name="action">sidebar.search.new</attribute>
         <attribute name="accel">&lt;Primary&gt;s</attribute>
       </item>
     </section>
diff --git a/ui/tag_sidebar_context.ui b/ui/tag_sidebar_context.ui
index a473f6a..b810c28 100644
--- a/ui/tag_sidebar_context.ui
+++ b/ui/tag_sidebar_context.ui
@@ -3,8 +3,8 @@
   <menu id='popup-menu'>
     <section>
       <item>
-        <attribute name="label" translatable="yes">_New</attribute>
-        <attribute name="action">tag.new</attribute>
+        <attribute name="label" translatable="yes">New _Tag…</attribute>
+        <attribute name="action">sidebar.tag.new</attribute>
       </item>
     </section>
   </menu>


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