diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-05 17:13:21 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-09 15:19:59 +0100 |
commit | d50bfaa9a122040b0df9f1e237b294716ec66be7 (patch) | |
tree | e6d8e4642a90e75853180ec0f3b7438487094c61 /bitbake | |
parent | 138178f5d2e39065629f51abd577bd607ca570d0 (diff) | |
download | poky-d50bfaa9a122040b0df9f1e237b294716ec66be7.tar.gz |
bb/ui/hob: move some code around to avert a race
The data-generated and model-updated signals are different, the model
should only be accessed *after* the model-updated signal. Move code
setting the image combo's backing model to the model-updated callback to
ensure the combo is accurately set when changing the machine with an
image selected.
(Bitbake rev: 46953d3b4595667935d43fe7b20264ae0efd1bdf)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/hob.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py index 5906251f41..e0427658d9 100644 --- a/bitbake/lib/bb/ui/hob.py +++ b/bitbake/lib/bb/ui/hob.py | |||
@@ -183,13 +183,6 @@ class MainWindow (gtk.Window): | |||
183 | 183 | ||
184 | def data_generated(self, handler): | 184 | def data_generated(self, handler): |
185 | self.generating = False | 185 | self.generating = False |
186 | self.image_combo.set_model(self.model.images_model()) | ||
187 | # Without this the image combo is incorrectly sized on first load of the GUI | ||
188 | self.image_combo.set_active(0) | ||
189 | self.image_combo.set_active(-1) | ||
190 | |||
191 | if not self.image_combo_id: | ||
192 | self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb) | ||
193 | self.enable_widgets() | 186 | self.enable_widgets() |
194 | 187 | ||
195 | def machine_combo_changed_cb(self, combo, handler): | 188 | def machine_combo_changed_cb(self, combo, handler): |
@@ -286,6 +279,14 @@ class MainWindow (gtk.Window): | |||
286 | pkgsaz_model.set_default_sort_func(None) | 279 | pkgsaz_model.set_default_sort_func(None) |
287 | self.pkgsaz_tree.set_model(pkgsaz_model) | 280 | self.pkgsaz_tree.set_model(pkgsaz_model) |
288 | 281 | ||
282 | self.image_combo.set_model(self.model.images_model()) | ||
283 | # Without this the image combo is incorrectly sized on first load of the GUI | ||
284 | self.image_combo.set_active(0) | ||
285 | self.image_combo.set_active(-1) | ||
286 | |||
287 | if not self.image_combo_id: | ||
288 | self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb) | ||
289 | |||
289 | # We want the contents to be alphabetised so create a TreeModelSort to | 290 | # We want the contents to be alphabetised so create a TreeModelSort to |
290 | # use in the view | 291 | # use in the view |
291 | contents_model = gtk.TreeModelSort(self.model.contents_model()) | 292 | contents_model = gtk.TreeModelSort(self.model.contents_model()) |