[meld/ui-next] vcview: Restore context menu
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/ui-next] vcview: Restore context menu
- Date: Sat, 23 Mar 2019 02:04:49 +0000 (UTC)
commit c9129704e062cd277cbd4d40a891aba81c8d0469
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Mar 17 11:43:45 2019 +1000
vcview: Restore context menu
meld/resources/ui/vcview-menus.ui | 46 +++++++++++++++++++++++++++++++++++++++
meld/vcview.py | 6 ++++-
2 files changed, 51 insertions(+), 1 deletion(-)
---
diff --git a/meld/resources/ui/vcview-menus.ui b/meld/resources/ui/vcview-menus.ui
new file mode 100644
index 00000000..ed20afcc
--- /dev/null
+++ b/meld/resources/ui/vcview-menus.ui
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <menu id="vcview-context-menu">
+ <section>
+ <attribute name="id">version-focused-section</attribute>
+ <item>
+ <attribute name="label" translatable="yes">_Compare</attribute>
+ <attribute name="action">view.compare</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Co_mmit...</attribute>
+ <attribute name="action">view.vc-commit</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Update</attribute>
+ <attribute name="action">view.vc-update</attribute>
+ </item>
+ </section>
+ <section>
+ <attribute name="id">local-changes-section</attribute>
+ <item>
+ <attribute name="label" translatable="yes">_Add</attribute>
+ <attribute name="action">view.vc-add</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Remove</attribute>
+ <attribute name="action">view.vc-remove</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Re_vert</attribute>
+ <attribute name="action">view.vc-revert</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Delete</attribute>
+ <attribute name="action">view.vc-delete-locally</attribute>
+ </item>
+ </section>
+ <section>
+ <attribute name="id">resolve-section</attribute>
+ <item>
+ <attribute name="label" translatable="yes">Mar_k as Resolved</attribute>
+ <attribute name="action">view.vc-resolve</attribute>
+ </item>
+ </section>
+ </menu>
+</interface>
diff --git a/meld/vcview.py b/meld/vcview.py
index 0363791a..0c1a7432 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -238,7 +238,11 @@ class VcView(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
action.connect('change-state', callback)
self.view_action_group.add_action(action)
- self.popup_menu = Gtk.Menu()
+ builder = Gtk.Builder.new_from_resource(
+ '/org/gnome/meld/ui/vcview-menus.ui')
+ context_menu = builder.get_object('vcview-context-menu')
+ self.popup_menu = Gtk.Menu.new_from_model(context_menu)
+ self.popup_menu.attach_to_widget(self)
self.model = VcTreeStore()
self.connect("style-updated", self.model.on_style_updated)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]