Patchwork [bitbake-devel,1/4] lib/bb/ui/crumbs: only display one 'Brought in by' item in Hob trees

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

Comments

Joshua Lock - April 6, 2012, 11:18 p.m.
The design calls for a single 'Brought in by' item to be shown in the
tree views with any extra items to be shown in the tooltip.

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

Patch

diff --git a/lib/bb/ui/crumbs/hobwidget.py b/lib/bb/ui/crumbs/hobwidget.py
index edb85db..3f6dd34 100644
--- a/lib/bb/ui/crumbs/hobwidget.py
+++ b/lib/bb/ui/crumbs/hobwidget.py
@@ -150,6 +150,10 @@  class HobViewTable (gtk.VBox):
                 col.pack_end(cell, True)
                 col.set_attributes(cell, active=column['col_id'])
                 self.toggle_columns.append(column['col_name'])
+            elif column['col_style'] == 'binb':
+                cell = gtk.CellRendererText()
+                col.pack_start(cell, True)
+                col.set_cell_data_func(cell, self.display_binb_cb, column['col_id'])
 
         scroll = gtk.ScrolledWindow()
         scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
@@ -157,6 +161,15 @@  class HobViewTable (gtk.VBox):
         scroll.add(self.table_tree)
         self.pack_start(scroll, True, True, 0)
 
+    def display_binb_cb(self, col, cell, model, it, col_id):
+        binb =  model.get_value(it, col_id)
+        # Just display the first item
+        if binb:
+            bin = binb.split(', ')
+            cell.set_property('text', bin[0])
+
+        return True
+
     def set_model(self, tree_model):
         self.table_tree.set_model(tree_model)
 
diff --git a/lib/bb/ui/crumbs/packageselectionpage.py b/lib/bb/ui/crumbs/packageselectionpage.py
index 7926636..78963f6 100755
--- a/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/lib/bb/ui/crumbs/packageselectionpage.py
@@ -45,7 +45,7 @@  class PackageSelectionPage (HobPage):
                       }, {
                        'col_name' : 'Brought in by',
                        'col_id'   : PackageListModel.COL_BINB,
-                       'col_style': 'text',
+                       'col_style': 'binb',
                        'col_min'  : 100,
                        'col_max'  : 350
                       }, {
diff --git a/lib/bb/ui/crumbs/recipeselectionpage.py b/lib/bb/ui/crumbs/recipeselectionpage.py
index e4616a8..956b02d 100755
--- a/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -45,7 +45,7 @@  class RecipeSelectionPage (HobPage):
                       }, {
                        'col_name' : 'Brought in by',
                        'col_id'   : RecipeListModel.COL_BINB,
-                       'col_style': 'text',
+                       'col_style': 'binb',
                        'col_min'  : 100,
                        'col_max'  : 500
                       }, {