Patchwork [bitbake-devel,4/4] selectionpage: show persistent tooltips on click

login
register
mail settings
Submitter Joshua Lock
Date April 6, 2012, 11:18 p.m.
Message ID <c53abebb1b91b43268abf7cf82122ffa34e8a9b9.1333754145.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/25289/
State Accepted
Commit 80af7e72a9404044910fca7f9265e66354f747a6
Headers show

Comments

Joshua Lock - April 6, 2012, 11:18 p.m.
Requiring a double click to show the tooltips isn't very intuitive, add
a callback to show the persistent tooltips on button release.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/packageselectionpage.py |   13 ++++++++-----
 lib/bb/ui/crumbs/recipeselectionpage.py  |   13 ++++++++-----
 2 files changed, 16 insertions(+), 10 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/packageselectionpage.py b/lib/bb/ui/crumbs/packageselectionpage.py
index b1a199c..81ff76d 100755
--- a/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/lib/bb/ui/crumbs/packageselectionpage.py
@@ -117,7 +117,7 @@  class PackageSelectionPage (HobPage):
             tab.set_model(self.package_model.tree_model(filter))
             tab.connect("toggled", self.table_toggled_cb)
             if page['name'] == "Included":
-                tab.connect("row-activated", self.tree_row_activated_cb)
+                tab.connect("button-release-event", self.button_click_cb)
 
             label = gtk.Label(page['name'])
             self.ins.append_page(tab, label)
@@ -146,10 +146,13 @@  class PackageSelectionPage (HobPage):
         self.back_button.connect("clicked", self.back_button_clicked_cb)
         button_box.pack_start(self.back_button, expand=False, fill=False)
 
-    def tree_row_activated_cb(self, table, tree_model, path):
-        binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
-        if binb:
-            self.builder.show_binb_dialog(binb)
+    def button_click_cb(self, widget, event):
+        path, col = widget.table_tree.get_cursor()
+        tree_model = widget.table_tree.get_model()
+        if path: # else activation is likely a removal
+            binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
+            if binb:
+                self.builder.show_binb_dialog(binb)
 
     def build_image_clicked_cb(self, button):
         self.builder.build_image()
diff --git a/lib/bb/ui/crumbs/recipeselectionpage.py b/lib/bb/ui/crumbs/recipeselectionpage.py
index d70fe52..019f9f3 100755
--- a/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -148,7 +148,7 @@  class RecipeSelectionPage (HobPage):
             tab.set_model(self.recipe_model.tree_model(filter))
             tab.connect("toggled", self.table_toggled_cb)
             if page['name'] == "Included":
-                tab.connect("row-activated", self.tree_row_activated_cb)
+                tab.connect("button-release-event", self.button_click_cb)
 
             label = gtk.Label(page['name'])
             self.ins.append_page(tab, label)
@@ -177,10 +177,13 @@  class RecipeSelectionPage (HobPage):
         self.back_button.connect("clicked", self.back_button_clicked_cb)
         button_box.pack_start(self.back_button, expand=False, fill=False)
 
-    def tree_row_activated_cb(self, table, tree_model, path):
-        binb = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
-        if binb:
-            self.builder.show_binb_dialog(binb)
+    def button_click_cb(self, widget, event):
+        path, col = widget.table_tree.get_cursor()
+        tree_model = widget.table_tree.get_model()
+        if path: # else activation is likely a removal
+            binb = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
+            if binb:
+                self.builder.show_binb_dialog(binb)
 
     def build_packages_clicked_cb(self, button):
         self.builder.build_packages()