mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
138178f5d2
commit
d50bfaa9a1
@@ -183,13 +183,6 @@ class MainWindow (gtk.Window):
|
|||||||
|
|
||||||
def data_generated(self, handler):
|
def data_generated(self, handler):
|
||||||
self.generating = False
|
self.generating = False
|
||||||
self.image_combo.set_model(self.model.images_model())
|
|
||||||
# Without this the image combo is incorrectly sized on first load of the GUI
|
|
||||||
self.image_combo.set_active(0)
|
|
||||||
self.image_combo.set_active(-1)
|
|
||||||
|
|
||||||
if not self.image_combo_id:
|
|
||||||
self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
|
|
||||||
self.enable_widgets()
|
self.enable_widgets()
|
||||||
|
|
||||||
def machine_combo_changed_cb(self, combo, handler):
|
def machine_combo_changed_cb(self, combo, handler):
|
||||||
@@ -286,6 +279,14 @@ class MainWindow (gtk.Window):
|
|||||||
pkgsaz_model.set_default_sort_func(None)
|
pkgsaz_model.set_default_sort_func(None)
|
||||||
self.pkgsaz_tree.set_model(pkgsaz_model)
|
self.pkgsaz_tree.set_model(pkgsaz_model)
|
||||||
|
|
||||||
|
self.image_combo.set_model(self.model.images_model())
|
||||||
|
# Without this the image combo is incorrectly sized on first load of the GUI
|
||||||
|
self.image_combo.set_active(0)
|
||||||
|
self.image_combo.set_active(-1)
|
||||||
|
|
||||||
|
if not self.image_combo_id:
|
||||||
|
self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
|
||||||
|
|
||||||
# We want the contents to be alphabetised so create a TreeModelSort to
|
# We want the contents to be alphabetised so create a TreeModelSort to
|
||||||
# use in the view
|
# use in the view
|
||||||
contents_model = gtk.TreeModelSort(self.model.contents_model())
|
contents_model = gtk.TreeModelSort(self.model.contents_model())
|
||||||
|
|||||||
Reference in New Issue
Block a user