Hob: Change the Hob initialization process

This change allows adding extra inherits before getting all the
parameters.

(Bitbake rev: eb993c0bad03718f9d3e133667cd0fefca23611a)

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-23 15:38:42 +08:00 committed by Richard Purdie
parent 9d3620fac8
commit 5098c964c2
3 changed files with 16 additions and 9 deletions

View File

@ -186,11 +186,6 @@ class Builder(gtk.Window):
self.template = None
# settings
params = self.handler.get_parameters()
self.configuration = Configuration(params)
self.parameters = Parameters(params)
# build step
self.current_step = None
self.previous_step = None
@ -224,6 +219,10 @@ class Builder(gtk.Window):
self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
self.handler.connect("command-failed", self.handler_command_failed_cb)
self.handler.init_cooker()
self.handler.set_extra_inherit("image_types")
self.handler.parse_config()
self.switch_page(self.MACHINE_SELECTION)
def create_visual_elements(self):
@ -409,7 +408,13 @@ class Builder(gtk.Window):
self.parameters.all_layers = layers
def handler_command_succeeded_cb(self, handler, initcmd):
if initcmd == self.handler.GENERATE_CONFIGURATION:
if initcmd == self.handler.PARSE_CONFIG:
# settings
params = self.handler.get_parameters()
self.configuration = Configuration(params)
self.parameters = Parameters(params)
self.handler.generate_configuration()
elif initcmd == self.handler.GENERATE_CONFIGURATION:
self.image_configuration_page.switch_machine_combo()
elif initcmd in [self.handler.GENERATE_RECIPES,
self.handler.GENERATE_PACKAGES,

View File

@ -62,7 +62,7 @@ class HobHandler(gobject.GObject):
(gobject.TYPE_PYOBJECT,)),
}
(GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
(PARSE_CONFIG, GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(6)
(SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10)
def __init__(self, server, recipe_model, package_model):
@ -246,6 +246,10 @@ class HobHandler(gobject.GObject):
def init_cooker(self):
self.server.runCommand(["initCooker"])
def parse_config(self):
self.commands_async.append(self.SUB_PARSE_CONFIG)
self.run_next_command(self.PARSE_CONFIG)
def refresh_layers(self, bblayers):
self.init_cooker()
self.set_bblayers(bblayers)

View File

@ -58,8 +58,6 @@ def main (server = None, eventHandler = None):
hobHandler = HobHandler(server, recipe_model, package_model)
builder = Builder(hobHandler, recipe_model, package_model)
hobHandler.generate_configuration()
# This timeout function regularly probes the event queue to find out if we
# have any messages waiting for us.
gobject.timeout_add(10, event_handle_idle_func, eventHandler, hobHandler)