← Back to team overview

clicompanion-devs team mailing list archive

[Merge] lp:~dcaro/clicompanion/fix-909894 into lp:clicompanion

 

David Caro has proposed merging lp:~dcaro/clicompanion/fix-909894 into lp:clicompanion.

Requested reviews:
  CLI Companion Development Team (clicompanion-devs)
Related bugs:
  Bug #909894 in CLI Companion: "Double click execution with user input drags command"
  https://bugs.launchpad.net/clicompanion/+bug/909894

For more details, see:
https://code.launchpad.net/~dcaro/clicompanion/fix-909894/+merge/87169

We were using the wrong callback when managing the double-click in the treeview. Now using "row-activated".

See: http://www.pygtk.org/docs/pygtk/class-gtktreeview.html#signal-gtktreeview--row-activated
-- 
https://code.launchpad.net/~dcaro/clicompanion/fix-909894/+merge/87169
Your team CLI Companion Development Team is requested to review the proposed merge of lp:~dcaro/clicompanion/fix-909894 into lp:clicompanion.
=== modified file 'clicompanionlib/view.py'
--- clicompanionlib/view.py	2011-11-20 16:51:59 +0000
+++ clicompanionlib/view.py	2011-12-30 22:58:26 +0000
@@ -337,9 +337,8 @@
             
             
         ## double click to run a command    
-        def treeview_clicked(widget, event):
-            if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
-                actions.run_command(self, self.notebook, self.liststore)
+        def treeview_clicked(treeview, path, column):
+            actions.run_command(self, self.notebook, self.liststore)
 
         ## press enter to run a command                   
         def treeview_button(widget, event):
@@ -357,7 +356,7 @@
         selection.select_path(0) 
         selection.connect("changed", mark_selected, selection)
         ## double-click
-        self.treeview.connect("button-press-event", treeview_clicked)
+        self.treeview.connect("row-activated", treeview_clicked)
         #press enter to run command
         self.treeview.connect("key-press-event", treeview_button)