1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

Hob: Remove the recipe/package populated signal

Handle the recipe and package list update in
handler_command_succeeded_cb(), which could avoid potential race
condition when doing recipe/package list updating and page switching.

(Bitbake rev: 0c766a8c69782b2dd35a363dc9573b78f9d41995)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Dongxiao Xu
2012-03-14 09:06:47 +08:00
committed by Richard Purdie
parent 552672abba
commit 0fa748e348
2 changed files with 8 additions and 24 deletions
+8 -10
View File
@@ -200,8 +200,6 @@ class Builder(gtk.Window):
self.connect("delete-event", self.destroy_window_cb) self.connect("delete-event", self.destroy_window_cb)
self.recipe_model.connect ("recipe-selection-changed", self.recipelist_changed_cb) self.recipe_model.connect ("recipe-selection-changed", self.recipelist_changed_cb)
self.package_model.connect("package-selection-changed", self.packagelist_changed_cb) self.package_model.connect("package-selection-changed", self.packagelist_changed_cb)
self.recipe_model.connect ("recipelist-populated", self.recipelist_populated_cb)
self.package_model.connect("packagelist-populated", self.packagelist_populated_cb)
self.handler.connect("config-updated", self.handler_config_updated_cb) self.handler.connect("config-updated", self.handler_config_updated_cb)
self.handler.connect("package-formats-updated", self.handler_package_formats_updated_cb) self.handler.connect("package-formats-updated", self.handler_package_formats_updated_cb)
self.handler.connect("layers-updated", self.handler_layers_updated_cb) self.handler.connect("layers-updated", self.handler_layers_updated_cb)
@@ -413,10 +411,14 @@ class Builder(gtk.Window):
self.handler.GENERATE_IMAGE]: self.handler.GENERATE_IMAGE]:
self.handler.request_package_info_async() self.handler.request_package_info_async()
elif initcmd == self.handler.POPULATE_PACKAGEINFO: elif initcmd == self.handler.POPULATE_PACKAGEINFO:
if self.current_step == self.RCPPKGINFO_POPULATING:
self.switch_page(self.RCPPKGINFO_POPULATED)
self.rcppkglist_populated()
return
self.rcppkglist_populated()
if self.current_step == self.FAST_IMAGE_GENERATING: if self.current_step == self.FAST_IMAGE_GENERATING:
self.switch_page(self.IMAGE_GENERATING) self.switch_page(self.IMAGE_GENERATING)
elif self.current_step == self.RCPPKGINFO_POPULATING:
self.switch_page(self.RCPPKGINFO_POPULATED)
elif self.current_step == self.PACKAGE_GENERATING: elif self.current_step == self.PACKAGE_GENERATING:
self.switch_page(self.PACKAGE_GENERATED) self.switch_page(self.PACKAGE_GENERATED)
elif self.current_step == self.IMAGE_GENERATING: elif self.current_step == self.IMAGE_GENERATING:
@@ -448,7 +450,7 @@ class Builder(gtk.Window):
def handler_data_generated_cb(self, handler): def handler_data_generated_cb(self, handler):
self.window_sensitive(True) self.window_sensitive(True)
def recipelist_populated_cb(self, recipe_model): def rcppkglist_populated(self):
selected_image = self.configuration.selected_image selected_image = self.configuration.selected_image
selected_recipes = self.configuration.selected_recipes[:] selected_recipes = self.configuration.selected_recipes[:]
selected_packages = self.configuration.selected_packages[:] selected_packages = self.configuration.selected_packages[:]
@@ -458,11 +460,7 @@ class Builder(gtk.Window):
" ".join(selected_packages)) " ".join(selected_packages))
self.image_configuration_page.update_image_combo(self.recipe_model, selected_image) self.image_configuration_page.update_image_combo(self.recipe_model, selected_image)
self.update_recipe_model(selected_image, selected_recipes) self.update_recipe_model(selected_image, selected_recipes)
def packagelist_populated_cb(self, package_model):
selected_packages = self.configuration.selected_packages[:]
self.update_package_model(selected_packages) self.update_package_model(selected_packages)
def recipelist_changed_cb(self, recipe_model): def recipelist_changed_cb(self, recipe_model):
@@ -825,7 +823,7 @@ class Builder(gtk.Window):
self.switch_page(self.RECIPE_SELECTION) self.switch_page(self.RECIPE_SELECTION)
def initiate_new_build(self): def initiate_new_build(self):
self.configuration.curr_mach = "" self.configuration.curr_mach = ""
self.image_configuration_page.switch_machine_combo() self.image_configuration_page.switch_machine_combo()
self.switch_page(self.MACHINE_SELECTION) self.switch_page(self.MACHINE_SELECTION)
-14
View File
@@ -36,9 +36,6 @@ class PackageListModel(gtk.TreeStore):
(COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_BINB, COL_INC) = range(11) (COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_BINB, COL_INC) = range(11)
__gsignals__ = { __gsignals__ = {
"packagelist-populated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
"package-selection-changed" : (gobject.SIGNAL_RUN_LAST, "package-selection-changed" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, gobject.TYPE_NONE,
()), ()),
@@ -135,8 +132,6 @@ class PackageListModel(gtk.TreeStore):
""" """
The populate() function takes as input the data from a The populate() function takes as input the data from a
bb.event.PackageInfo event and populates the package list. bb.event.PackageInfo event and populates the package list.
Once the population is done it emits gsignal packagelist-populated
to notify any listeners that the model is ready
""" """
def populate(self, pkginfolist): def populate(self, pkginfolist):
self.clear() self.clear()
@@ -194,8 +189,6 @@ class PackageListModel(gtk.TreeStore):
self.COL_RPROV, rprov, self.COL_SIZE, size, self.COL_RPROV, rprov, self.COL_SIZE, size,
self.COL_BINB, "", self.COL_INC, False) self.COL_BINB, "", self.COL_INC, False)
self.emit("packagelist-populated")
""" """
Check whether the item at item_path is included or not Check whether the item at item_path is included or not
""" """
@@ -425,9 +418,6 @@ class RecipeListModel(gtk.ListStore):
__dummy_image__ = "Start from scratch" __dummy_image__ = "Start from scratch"
__gsignals__ = { __gsignals__ = {
"recipelist-populated" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
"recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST, "recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, gobject.TYPE_NONE,
()), ()),
@@ -524,8 +514,6 @@ class RecipeListModel(gtk.ListStore):
""" """
The populate() function takes as input the data from a The populate() function takes as input the data from a
bb.event.TargetsTreeGenerated event and populates the RecipeList. bb.event.TargetsTreeGenerated event and populates the RecipeList.
Once the population is done it emits gsignal recipelist-populated
to notify any listeners that the model is ready
""" """
def populate(self, event_model): def populate(self, event_model):
# First clear the model, in case repopulating # First clear the model, in case repopulating
@@ -580,8 +568,6 @@ class RecipeListModel(gtk.ListStore):
self.pn_path[pn] = path self.pn_path[pn] = path
it = self.iter_next(it) it = self.iter_next(it)
self.emit("recipelist-populated")
""" """
Update the model, send out the notification. Update the model, send out the notification.
""" """