[bitbake-devel] [PATCH 5/6] bb/ui/hob: only connect to the changed signal of image_combo once

Joshua Lock josh at linux.intel.com
Thu Aug 4 01:23:21 UTC 2011


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

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index b8842a9..5a4ac78 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -158,7 +158,8 @@ class MainWindow (gtk.Window):
             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)
+        if not self.image_combo_id:
+            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()
@@ -321,11 +322,13 @@ class MainWindow (gtk.Window):
         return
 
     def reset_build(self):
-        self.image_combo.disconnect(self.image_combo_id)
-        self.image_combo_id = None
+        if self.image_combo_id:
+            self.image_combo.disconnect(self.image_combo_id)
+            self.image_combo_id = None
         self.image_combo.set_active(-1)
-        self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
         self.model.reset()
+        if not self.image_combo_id:
+            self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
 
     def layers_cb(self, action):
         resp = self.layers.run()
-- 
1.7.6





More information about the bitbake-devel mailing list