[bitbake-devel] [PATCH 2/4] hob: fix loading customised image recipe

Joshua Lock josh at linux.intel.com
Wed Jul 27 03:57:25 UTC 2011


The signal handler of the 'Base image' combo was still connected during load
such that updating the UI to reflect the loaded base image triggered a change
of the model. Fix this by disconnecting the signal handler when updating the
displayed 'Base image'.

Fixes [YOCTO #1282]

Signed-off-by: Joshua Lock <josh at linux.intel.com>
---
 lib/bb/ui/crumbs/tasklistmodel.py |    2 +-
 lib/bb/ui/hob.py                  |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index d7dff3c..e190f96 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -281,7 +281,7 @@ class TaskListModel(gtk.ListStore):
             path = self.get_path(it)
             name = self[path][self.COL_NAME]
             if name in packages:
-                self.include_item(path)
+                self.include_item(path, binb="User Selected")
                 packages.remove(name)
             it = self.iter_next(it)
 
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index d3442c5..90d5c5a 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -122,6 +122,10 @@ class MainWindow (gtk.Window):
         self.build_succeeded = False
 
     def image_changed_string_cb(self, model, new_image):
+        # disconnect the image combo's signal handler
+        if self.image_combo_id:
+            self.image_combo.disconnect(self.image_combo_id)
+            self.image_combo_id = None
         cnt = 0
         it = self.model.images.get_iter_first()
         while it:
@@ -131,6 +135,8 @@ class MainWindow (gtk.Window):
                 break
             it = self.model.images.iter_next(it)
             cnt = cnt + 1
+        # Reconnect the signal handler
+        self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
 
     def image_changed_cb(self, combo):
         model = self.image_combo.get_model()
-- 
1.7.6





More information about the bitbake-devel mailing list