[meld/ui-next] filediff: Re-add file comparison context menu



commit 4d854f289cbb1023de7ea7fc5676d18acfc3d172
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Mar 17 06:24:19 2019 +1000

    filediff: Re-add file comparison context menu

 meld/filediff.py                    |  6 +++++-
 meld/resources/ui/filediff-menus.ui | 39 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 7d119ceb..b277624c 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -329,7 +329,11 @@ class FileDiff(Gtk.VBox, MeldDoc):
             action.connect('activate', callback)
             self.view_action_group.add_action(action)
 
-        self.popup_menu = Gtk.Menu()
+        builder = Gtk.Builder.new_from_resource(
+            '/org/gnome/meld/ui/filediff-menus.ui')
+        context_menu = builder.get_object('filediff-context-menu')
+        self.popup_menu = Gtk.Menu.new_from_model(context_menu)
+        self.popup_menu.attach_to_widget(self)
 
         builder = Gtk.Builder.new_from_resource(
             '/org/gnome/meld/ui/filediff-actions.ui')
diff --git a/meld/resources/ui/filediff-menus.ui b/meld/resources/ui/filediff-menus.ui
index 768149cf..61c44518 100644
--- a/meld/resources/ui/filediff-menus.ui
+++ b/meld/resources/ui/filediff-menus.ui
@@ -21,4 +21,43 @@
       </item>
     </section>
   </menu>
+  <menu id="filediff-context-menu">
+    <section>
+      <attribute name="id">undo-section</attribute>
+      <item>
+        <attribute name="label">_Undo</attribute>
+        <attribute name="action">view.undo</attribute>
+      </item>
+      <item>
+        <attribute name="label">_Redo</attribute>
+        <attribute name="action">view.redo</attribute>
+      </item>
+    </section>
+    <section>
+      <attribute name="id">text-section</attribute>
+      <item>
+        <attribute name="label">Cu_t</attribute>
+        <attribute name="action">view.cut</attribute>
+      </item>
+      <item>
+        <attribute name="label">_Copy</attribute>
+        <attribute name="action">view.copy</attribute>
+      </item>
+      <item>
+        <attribute name="label">_Paste</attribute>
+        <attribute name="action">view.paste</attribute>
+      </item>
+    </section>
+    <section>
+      <attribute name="id">syncpoint-section</attribute>
+      <item>
+        <attribute name="label">Add Synchronization Point</attribute>
+        <attribute name="action">view.add-sync-point</attribute>
+      </item>
+      <item>
+        <attribute name="label">Clear Synchronization Points</attribute>
+        <attribute name="action">view.clear-sync-point</attribute>
+      </item>
+    </section>
+  </menu>
 </interface>


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