[meld] Respond to context menu signal for VcView treeview



commit 3f61db989d503ab5f429262f3166442013e81494
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 15 12:15:29 2011 +1000

    Respond to context menu signal for VcView treeview

 data/ui/vcview.ui |    1 +
 meld/vcview.py    |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/vcview.ui b/data/ui/vcview.ui
index 30a5dd3..c5940f3 100644
--- a/data/ui/vcview.ui
+++ b/data/ui/vcview.ui
@@ -73,6 +73,7 @@
                     <property name="hover_expand">False</property>
                     <signal handler="on_row_activated" last_modification_time="Sat, 03 Aug 2002 23:32:49 GMT" name="row_activated"/>
                     <signal handler="on_button_press_event" last_modification_time="Sat, 30 Aug 2003 12:42:19 GMT" name="button_press_event"/>
+                    <signal handler="on_treeview_popup_menu" name="popup-menu"/>
                   </object>
                 </child>
               </object>
diff --git a/meld/vcview.py b/meld/vcview.py
index cafb5a4..d307323 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -406,9 +406,14 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
         for path in path_list:
             self.scheduler.add_task(self.run_diff_iter([path]).next, atfront=1)
 
+    def on_treeview_popup_menu(self, treeview):
+        time = gtk.get_current_event_time()
+        self.popup_menu.popup(None, None, None, 0, time)
+        return True
+
     def on_button_press_event(self, text, event):
-        if event.button==3:
-            self.popup_menu.popup(None, None, None, 3, event.time)
+        if event.button == 3:
+            self.popup_menu.popup(None, None, None, event.button, event.time)
             return len(self._get_selected_paths()) != 1
         return 0
 



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