Hob: Functionality and GUI Fixes
PATCH 1/12 Hob: add "Close" button to "BinbDialog"
In reply to Dongxiao XuFor certain distributions, like FC16, it doesn't have close button in sub-windows or dialogs. Therefore we need to add an "Close" button to "BinbDialog" to close the dialog.
Besides, let BinbDialog inherits the CrumbsDialog instead of gtk.Dialog
--- lib/bb/ui/crumbs/hig.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/hig.py +2 -2
@@ -94,13 +94,13 @@ class CrumbsMessageDialog(CrumbsDialog): # # Brought-in-by Dialog # -class BinbDialog(gtk.Dialog): +class BinbDialog(CrumbsDialog): """ A dialog widget to show "brought in by" info when a recipe/package is clicked. """ def __init__(self, title, content, parent=None): - super(BinbDialog, self).__init__(title, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, None) + super(BinbDialog, self).__init__(title, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, ("Close", gtk.RESPONSE_CLOSE)) self.set_position(gtk.WIN_POS_MOUSE) self.set_resizable(False)
Signature · 1 line
1.7.4.1
PATCH 2/12 Hob: Disable the handling of "NoProvider" event
In reply to Dongxiao XuCurrently for non-x86 architecture, there are un-resolved dependency issue when generate universe dependency tree. Therefore disable the handling of "NoProvider" event in Hob to enable the build for non-x86 architectures. After we resolved the dependency for universe, we still need to handle this event in Hob.
--- lib/bb/ui/crumbs/hobeventhandler.py | 37 ++++++++++++++++++---------------- 1 files changed, 20 insertions(+), 17 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +20 -17
@@ -215,23 +215,26 @@ class HobHandler(gobject.GObject): elif isinstance(event, bb.command.CommandCompleted): self.current_phase = None self.run_next_command() - - elif isinstance(event, bb.event.NoProvider): - if event._runtime: - r = "R" - else: - r = "" - if event._dependees: - self.error_msg += " Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r) - else: - self.error_msg += " Nothing %sPROVIDES '%s'" % (r, event._item) - if event._reasons: - for reason in event._reasons: - self.error_msg += " %s" % reason - - self.commands_async = [] - self.emit("command-failed", self.error_msg) - self.error_msg = "" + # TODO: Currently there are NoProvider issues when generate + # universe tree dependency for non-x86 architecture. + # Comment the follow code to enable the build of non-x86 + # architectures in Hob. + #elif isinstance(event, bb.event.NoProvider): + # if event._runtime: + # r = "R" + # else: + # r = "" + # if event._dependees: + # self.error_msg += " Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r) + # else: + # self.error_msg += " Nothing %sPROVIDES '%s'" % (r, event._item) + # if event._reasons: + # for reason in event._reasons: + # self.error_msg += " %s" % reason + + # self.commands_async = [] + # self.emit("command-failed", self.error_msg) + # self.error_msg = "" elif isinstance(event, bb.command.CommandFailed): self.commands_async = []
Signature · 1 line
1.7.4.1
PATCH 3/12 cooker: add package rdepends and rrecommends info
In reply to Dongxiao XuWhen calculating the image installation dependency, we need the rdepends and rrecommends information of certain packages.
--- lib/bb/cooker.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
lib/bb/cooker.py +3 -1
@@ -479,7 +479,6 @@ class BBCooker: depend_tree["pn"][pn]["license"] = lic depend_tree["pn"][pn]["section"] = section depend_tree["pn"][pn]["description"] = description - depend_tree["pn"][pn]["packages"] = rdepends.keys() if fnid not in seen_fnids: seen_fnids.append(fnid)
@@ -510,6 +509,9 @@ class BBCooker: pn_rprovider = item depend_tree["rdepends-pn"][pn].append(pn_rprovider) + depend_tree["rdepends-pkg"].update(rdepends) + depend_tree["rrecs-pkg"].update(rrecs) + return depend_tree def generateDepTreeEvent(self, pkgs_to_build, task):
Signature · 1 line
1.7.4.1
PATCH 5/12 Hob: Remove the reset button in recipe/package selection page
In reply to Dongxiao Xu--- lib/bb/ui/crumbs/builder.py | 6 ------ lib/bb/ui/crumbs/packageselectionpage.py | 11 ----------- lib/bb/ui/crumbs/recipeselectionpage.py | 9 --------- 3 files changed, 0 insertions(+), 26 deletions(-)
lib/bb/ui/crumbs/builder.py +0 -6
@@ -361,12 +361,6 @@ class Builder(gtk.Window): self.handler.set_extra_config(self.configuration.extra_setting) self.handler.set_extra_inherit("packageinfo") - def reset_recipe_model(self): - self.recipe_model.reset() - - def reset_package_model(self): - self.package_model.reset() - def update_recipe_model(self, selected_image, selected_recipes): self.recipe_model.set_selected_image(selected_image) self.recipe_model.set_selected_recipes(selected_recipes)
lib/bb/ui/crumbs/packageselectionpage.py +0 -11
@@ -118,12 +118,6 @@ class PackageSelectionPage (HobPage): if self.pages[i]['name'] == "Included": tab.connect("row-activated", self.tree_row_activated_cb) - reset_button = gtk.Button("Reset") - reset_button.connect("clicked", self.reset_clicked_cb) - hbox = gtk.HBox(False, 5) - hbox.pack_end(reset_button, expand=False, fill=False) - tab.pack_start(hbox, expand=False, fill=False) - label = gtk.Label(self.pages[i]['name']) self.ins.append_page(tab, label) self.tables.append(tab)
@@ -206,11 +200,6 @@ class PackageSelectionPage (HobPage): size_str = str(size) + ' KB' return size_str - # Callback functions - def reset_clicked_cb(self, button): - self.package_model.reset() - self.builder.reset_package_model() - def toggle_item_idle_cb(self, path): if not self.package_model.path_included(path): self.package_model.include_item(item_path=path, binb="User Selected")
lib/bb/ui/crumbs/recipeselectionpage.py +0 -9
@@ -141,11 +141,6 @@ class RecipeSelectionPage (HobPage): tab.connect("toggled", self.table_toggled_cb) if self.pages[i]['name'] == "Included": tab.connect("row-activated", self.tree_row_activated_cb) - reset_button = gtk.Button("Reset") - reset_button.connect("clicked", self.reset_clicked_cb) - hbox = gtk.HBox(False, 5) - hbox.pack_end(reset_button, expand=False, fill=False) - tab.pack_start(hbox, expand=False, fill=False) label = gtk.Label(self.pages[i]['name']) self.ins.append_page(tab, label)
@@ -201,10 +196,6 @@ class RecipeSelectionPage (HobPage): self.label.set_text("Recipes included: %s" % len(self.builder.configuration.selected_recipes)) self.ins.show_indicator_icon("Included", len(self.builder.configuration.selected_recipes)) - # Callback functions - def reset_clicked_cb(self, button): - self.builder.reset_recipe_model() - def toggle_item_idle_cb(self, path): if not self.recipe_model.path_included(path): self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False)
Signature · 1 line
1.7.4.1
PATCH 7/12 Hob: Remove the recipe/package populated signal
In reply to Dongxiao XuHandle 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.
--- lib/bb/ui/crumbs/builder.py | 18 ++++++++---------- lib/bb/ui/crumbs/hoblistmodel.py | 14 -------------- 2 files changed, 8 insertions(+), 24 deletions(-)
lib/bb/ui/crumbs/builder.py +8 -10
@@ -200,8 +200,6 @@ class Builder(gtk.Window): self.connect("delete-event", self.destroy_window_cb) self.recipe_model.connect ("recipe-selection-changed", self.recipelist_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("package-formats-updated", self.handler_package_formats_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.request_package_info_async() 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: 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: self.switch_page(self.PACKAGE_GENERATED) elif self.current_step == self.IMAGE_GENERATING:
@@ -448,7 +450,7 @@ class Builder(gtk.Window): def handler_data_generated_cb(self, handler): self.window_sensitive(True) - def recipelist_populated_cb(self, recipe_model): + def rcppkglist_populated(self): selected_image = self.configuration.selected_image selected_recipes = self.configuration.selected_recipes[:] selected_packages = self.configuration.selected_packages[:]
@@ -458,11 +460,7 @@ class Builder(gtk.Window): " ".join(selected_packages)) self.image_configuration_page.update_image_combo(self.recipe_model, selected_image) - 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) def recipelist_changed_cb(self, recipe_model):
@@ -825,7 +823,7 @@ class Builder(gtk.Window): self.switch_page(self.RECIPE_SELECTION) def initiate_new_build(self): - self.configuration.curr_mach = "" + self.configuration.curr_mach = "" self.image_configuration_page.switch_machine_combo() self.switch_page(self.MACHINE_SELECTION)
lib/bb/ui/crumbs/hoblistmodel.py +0 -14
@@ -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) __gsignals__ = { - "packagelist-populated" : (gobject.SIGNAL_RUN_LAST, - gobject.TYPE_NONE, - ()), "package-selection-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
@@ -135,8 +132,6 @@ class PackageListModel(gtk.TreeStore): """ The populate() function takes as input the data from a 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): self.clear()
@@ -194,8 +189,6 @@ class PackageListModel(gtk.TreeStore): self.COL_RPROV, rprov, self.COL_SIZE, size, self.COL_BINB, "", self.COL_INC, False) - self.emit("packagelist-populated") - """ Check whether the item at item_path is included or not """
@@ -425,9 +418,6 @@ class RecipeListModel(gtk.ListStore): __dummy_image__ = "Start from scratch" __gsignals__ = { - "recipelist-populated" : (gobject.SIGNAL_RUN_LAST, - gobject.TYPE_NONE, - ()), "recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
@@ -524,8 +514,6 @@ class RecipeListModel(gtk.ListStore): """ The populate() function takes as input the data from a 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): # First clear the model, in case repopulating
@@ -580,8 +568,6 @@ class RecipeListModel(gtk.ListStore): self.pn_path[pn] = path it = self.iter_next(it) - self.emit("recipelist-populated") - """ Update the model, send out the notification. """
Signature · 1 line
1.7.4.1
PATCH 8/12 Hob: Show recipe/package editing button after base image is selected
In reply to Dongxiao XuOnly show recipe and package editing button after base image is selected.
--- lib/bb/ui/crumbs/builder.py | 9 +++++++-- lib/bb/ui/crumbs/imageconfigurationpage.py | 14 +++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-)
lib/bb/ui/crumbs/builder.py +7 -2
@@ -136,6 +136,7 @@ class Builder(gtk.Window): LAYER_CHANGED, RCPPKGINFO_POPULATING, RCPPKGINFO_POPULATED, + BASEIMG_SELECTED, RECIPE_SELECTION, PACKAGE_GENERATING, PACKAGE_GENERATED,
@@ -145,7 +146,7 @@ class Builder(gtk.Window): IMAGE_GENERATED, MY_IMAGE_OPENED, BACK, - END_NOOP) = range(14) + END_NOOP) = range(15) (IMAGE_CONFIGURATION, RECIPE_DETAILS,
@@ -159,6 +160,7 @@ class Builder(gtk.Window): LAYER_CHANGED : IMAGE_CONFIGURATION, RCPPKGINFO_POPULATING : IMAGE_CONFIGURATION, RCPPKGINFO_POPULATED : IMAGE_CONFIGURATION, + BASEIMG_SELECTED : IMAGE_CONFIGURATION, RECIPE_SELECTION : RECIPE_DETAILS, PACKAGE_GENERATING : BUILD_DETAILS, PACKAGE_GENERATED : PACKAGE_DETAILS,
@@ -309,6 +311,9 @@ class Builder(gtk.Window): elif next_step == self.RCPPKGINFO_POPULATED: self.image_configuration_page.show_info_populated() + elif next_step == self.BASEIMG_SELECTED: + self.image_configuration_page.show_baseimg_selected() + elif next_step == self.RECIPE_SELECTION: pass
@@ -828,7 +833,7 @@ class Builder(gtk.Window): self.switch_page(self.MACHINE_SELECTION) def show_configuration(self): - self.switch_page(self.RCPPKGINFO_POPULATED) + self.switch_page(self.BASEIMG_SELECTED) def stop_build(self): if self.stopping:
lib/bb/ui/crumbs/imageconfigurationpage.py +13 -1
@@ -109,9 +109,17 @@ class ImageConfigurationPage (HobPage): def show_info_populated(self): self.progress_bar.reset() + self._pack_components(pack_config_build_button = False) + self.set_config_machine_layout(show_progress_bar = False) + self.set_config_baseimg_layout() + self.show_all() + + def show_baseimg_selected(self): + self.progress_bar.reset() self._pack_components(pack_config_build_button = True) self.set_config_machine_layout(show_progress_bar = False) self.set_config_baseimg_layout() + self.set_rcppkg_layout() self.show_all() def create_config_machine(self):
@@ -196,9 +204,11 @@ class ImageConfigurationPage (HobPage): self.gtable.attach(self.image_title_desc, 0, 40, 17, 22) self.gtable.attach(self.image_combo, 0, 12, 22, 25) self.gtable.attach(self.image_desc, 14, 38, 22, 27) + self.gtable.attach(self.image_separator, 0, 40, 35, 36) + + def set_rcppkg_layout(self): self.gtable.attach(self.view_recipes_button, 0, 20, 28, 32) self.gtable.attach(self.view_packages_button, 20, 40, 28, 32) - self.gtable.attach(self.image_separator, 0, 40, 35, 36) def create_config_build_button(self): # Create the "Build packages" and "Just bake" buttons at the bottom
@@ -280,6 +290,8 @@ class ImageConfigurationPage (HobPage): self.builder.recipe_model.reset() self.builder.package_model.reset() + self.show_baseimg_selected() + glib.idle_add(self.image_combo_changed_idle_cb, selected_image, selected_recipes, selected_packages) def _image_combo_connect_signal(self):
Signature · 1 line
1.7.4.1
PATCH 6/12 Hob: Remove the indication in machine/base image combobox
In reply to Dongxiao XuRemove the "--select a machine--" prompt in machine selection. Also change "--select a base image--" to "Start from scratch" for base image selection.
--- lib/bb/ui/crumbs/hoblistmodel.py | 2 +- lib/bb/ui/crumbs/imageconfigurationpage.py | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-)
lib/bb/ui/crumbs/hoblistmodel.py +1 -1
@@ -422,7 +422,7 @@ class RecipeListModel(gtk.ListStore): """ (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN) = range(11) - __dummy_image__ = "--select a base image--" + __dummy_image__ = "Start from scratch" __gsignals__ = { "recipelist-populated" : (gobject.SIGNAL_RUN_LAST,
lib/bb/ui/crumbs/imageconfigurationpage.py +7 -13
@@ -33,8 +33,6 @@ from bb.ui.crumbs.hobpages import HobPage # class ImageConfigurationPage (HobPage): - __dummy_machine__ = "--select a machine--" - def __init__(self, builder): super(ImageConfigurationPage, self).__init__(builder, "Image configuration")
@@ -236,22 +234,18 @@ class ImageConfigurationPage (HobPage): def machine_combo_changed_cb(self, machine_combo): combo_item = machine_combo.get_active_text() - if not combo_item or combo_item == self.__dummy_machine__: - self.builder.configuration.curr_mach = "" - self.builder.switch_page(self.builder.MACHINE_SELECTION) - else: - self.builder.configuration.curr_mach = combo_item - # Do reparse recipes - self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING) + self.builder.configuration.curr_mach = combo_item + # Do reparse recipes + self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING) def update_machine_combo(self): - all_machines = [self.__dummy_machine__] + self.builder.parameters.all_machines + all_machines = self.builder.parameters.all_machines model = self.machine_combo.get_model() model.clear() for machine in all_machines: self.machine_combo.append_text(machine) - self.machine_combo.set_active(0) + self.machine_combo.set_active(-1) def switch_machine_combo(self): model = self.machine_combo.get_model()
@@ -261,7 +255,7 @@ class ImageConfigurationPage (HobPage): self.machine_combo.set_active(active) return active += 1 - self.machine_combo.set_active(0) + self.machine_combo.set_active(-1) def image_combo_changed_idle_cb(self, selected_image, selected_recipes, selected_packages): self.builder.update_recipe_model(selected_image, selected_recipes)
@@ -302,7 +296,7 @@ class ImageConfigurationPage (HobPage): # populate image combo filter = {RecipeListModel.COL_TYPE : ['image']} image_model = recipe_model.tree_model(filter) - active = 0 + active = -1 cnt = 0 it = image_model.get_iter_first()
Signature · 1 line
1.7.4.1
PATCH 9/12 Hob: Emit command-failed signal even if error msg is None
In reply to Dongxiao Xu--- lib/bb/ui/crumbs/builder.py | 13 +++++++------ lib/bb/ui/crumbs/hobeventhandler.py | 5 ++--- 2 files changed, 9 insertions(+), 9 deletions(-)
lib/bb/ui/crumbs/builder.py +7 -6
@@ -430,12 +430,13 @@ class Builder(gtk.Window): self.switch_page(self.IMAGE_GENERATED) def handler_command_failed_cb(self, handler, msg): - lbl = "<b>Error</b>\n" - lbl = lbl + "%s\n\n" % msg - dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) - dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) - response = dialog.run() - dialog.destroy() + if msg: + lbl = "<b>Error</b>\n" + lbl = lbl + "%s\n\n" % msg + dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) + dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) + response = dialog.run() + dialog.destroy() self.handler.clear_busy() self.configuration.curr_mach = None self.image_configuration_page.switch_machine_combo()
lib/bb/ui/crumbs/hobeventhandler.py +2 -3
@@ -238,9 +238,8 @@ class HobHandler(gobject.GObject): elif isinstance(event, bb.command.CommandFailed): self.commands_async = [] - if self.error_msg: - self.emit("command-failed", self.error_msg) - self.error_msg = "" + self.emit("command-failed", self.error_msg) + self.error_msg = "" elif isinstance(event, (bb.event.ParseStarted, bb.event.CacheLoadStarted, bb.event.TreeDataPreparationStarted,
Signature · 1 line
1.7.4.1
PATCH 10/12 Hob: Add stop button for parsing progress
In reply to Dongxiao XuAdd a Stop button to allow user to quit the parsing process.
--- lib/bb/ui/crumbs/builder.py | 22 +++++++++++++++++++++- lib/bb/ui/crumbs/hobeventhandler.py | 3 +++ lib/bb/ui/crumbs/imageconfigurationpage.py | 14 +++++++++++++- 3 files changed, 37 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/builder.py +21 -1
@@ -443,7 +443,20 @@ class Builder(gtk.Window): self.switch_page(self.MACHINE_SELECTION) def window_sensitive(self, sensitive): - self.set_sensitive(sensitive) + self.image_configuration_page.machine_combo.set_sensitive(sensitive) + self.image_configuration_page.image_combo.set_sensitive(sensitive) + self.image_configuration_page.layer_button.set_sensitive(sensitive) + self.image_configuration_page.layer_info_icon.set_sensitive(sensitive) + self.image_configuration_page.toolbar.set_sensitive(sensitive) + self.image_configuration_page.view_recipes_button.set_sensitive(sensitive) + self.image_configuration_page.view_packages_button.set_sensitive(sensitive) + self.image_configuration_page.config_build_button.set_sensitive(sensitive) + + self.recipe_details_page.set_sensitive(sensitive) + self.package_details_page.set_sensitive(sensitive) + self.build_details_page.set_sensitive(sensitive) + self.image_details_page.set_sensitive(sensitive) + if sensitive: self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) else:
@@ -482,6 +495,10 @@ class Builder(gtk.Window): fraction = 0 if message["eventname"] == "TreeDataPreparationStarted": fraction = 0.6 + fraction + self.image_configuration_page.stop_button.set_sensitive(False) + else: + self.image_configuration_page.stop_button.set_sensitive(True) + self.image_configuration_page.update_progress_bar(message["title"], fraction) def handler_parsing_cb(self, handler, message):
@@ -836,6 +853,9 @@ class Builder(gtk.Window): def show_configuration(self): self.switch_page(self.BASEIMG_SELECTED) + def stop_parse(self): + self.handler.cancel_parse() + def stop_build(self): if self.stopping: lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once,"
lib/bb/ui/crumbs/hobeventhandler.py +3 -0
@@ -371,6 +371,9 @@ class HobHandler(gobject.GObject): self.commands_async = [] self.building = False + def cancel_parse(self): + self.server.runCommand(["stateStop"]) + def cancel_build(self, force=False): if force: # Force the cooker to stop as quickly as possible
lib/bb/ui/crumbs/imageconfigurationpage.py +13 -1
@@ -150,7 +150,13 @@ class ImageConfigurationPage (HobPage): markup += "poky-ref-manual.html#usingpoky-changes-layers\">reference manual</a>." self.layer_info_icon = HobInfoButton(markup, self.get_parent()) + self.progress_box = gtk.HBox(False, 6) self.progress_bar = HobProgressBar() + self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) + self.stop_button = gtk.LinkButton("Stop the parsing process", "Stop") + self.stop_button.connect("clicked", self.stop_button_clicked_cb) + self.progress_box.pack_end(self.stop_button, expand=False, fill=False) + self.machine_separator = gtk.HSeparator() def set_config_machine_layout(self, show_progress_bar = False):
@@ -160,7 +166,7 @@ class ImageConfigurationPage (HobPage): self.gtable.attach(self.layer_button, 12, 36, 6, 10) self.gtable.attach(self.layer_info_icon, 36, 40, 6, 9) if show_progress_bar == True: - self.gtable.attach(self.progress_bar, 0, 40, 13, 17) + self.gtable.attach(self.progress_box, 0, 40, 13, 17) self.gtable.attach(self.machine_separator, 0, 40, 12, 13) def create_config_baseimg(self):
@@ -242,8 +248,14 @@ class ImageConfigurationPage (HobPage): return button_box + def stop_button_clicked_cb(self, button): + self.builder.stop_parse() + def machine_combo_changed_cb(self, machine_combo): combo_item = machine_combo.get_active_text() + if not combo_item: + return + self.builder.configuration.curr_mach = combo_item # Do reparse recipes self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING)
Signature · 1 line
1.7.4.1
PATCH 11/12 Hob: improve recipe/package selection performance
In reply to Dongxiao XuOriginally we will send selection chagned notification in each include_item and exclude_item, which is time cost since these are recursive functions and we may select hundreds of recipes/packages.
The improvement is to move the notification from include_item and exclude_item to the place where the two functions are called. This could greatly improve the selection/deselection speed for recipe and package lists.
--- lib/bb/ui/crumbs/hoblistmodel.py | 10 +++------- lib/bb/ui/crumbs/packageselectionpage.py | 1 + lib/bb/ui/crumbs/recipeselectionpage.py | 1 + 3 files changed, 5 insertions(+), 7 deletions(-)
lib/bb/ui/crumbs/hoblistmodel.py +3 -7
@@ -216,8 +216,6 @@ class PackageListModel(gtk.TreeStore): self[item_path][self.COL_INC] = True - self.selection_change_notification() - it = self.get_iter(item_path) # If user explicitly selects a recipe, all its providing packages are selected.
@@ -276,8 +274,6 @@ class PackageListModel(gtk.TreeStore): self[item_path][self.COL_INC] = False - self.selection_change_notification() - item_name = self[item_path][self.COL_NAME] item_rdep = self[item_path][self.COL_RDEP] it = self.get_iter(item_path)
@@ -343,6 +339,7 @@ class PackageListModel(gtk.TreeStore): else: left.append(pn) + self.selection_change_notification() return left def get_selected_packages(self):
@@ -604,7 +601,6 @@ class RecipeListModel(gtk.ListStore): item_deps = self[item_path][self.COL_DEPS] self[item_path][self.COL_INC] = True - self.selection_change_notification() item_bin = self[item_path][self.COL_BINB].split(', ') if binb and not binb in item_bin:
@@ -642,8 +638,6 @@ class RecipeListModel(gtk.ListStore): self[item_path][self.COL_INC] = False - self.selection_change_notification() - item_name = self[item_path][self.COL_NAME] item_deps = self[item_path][self.COL_DEPS] if item_deps:
@@ -703,6 +697,7 @@ class RecipeListModel(gtk.ListStore): path = self.pn_path[pn] self.include_item(item_path=path, binb="User Selected") + self.selection_change_notification() def get_selected_image(self): it = self.get_iter_first()
@@ -724,3 +719,4 @@ class RecipeListModel(gtk.ListStore): self.include_item(item_path=path, binb="User Selected", image_contents=True) + self.selection_change_notification()
lib/bb/ui/crumbs/packageselectionpage.py +1 -0
@@ -206,6 +206,7 @@ class PackageSelectionPage (HobPage): else: self.package_model.exclude_item(item_path=path) + self.refresh_selection() self.builder.window_sensitive(True) def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
lib/bb/ui/crumbs/recipeselectionpage.py +1 -0
@@ -202,6 +202,7 @@ class RecipeSelectionPage (HobPage): else: self.recipe_model.exclude_item(item_path=path) + self.refresh_selection() self.builder.window_sensitive(True) def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
Signature · 1 line
1.7.4.1
Hi Richard,
This is the second pull request for Hob functionality and GUI fixes, please help to review and pull.
Changes from v1:
1) Modify the Box padding according to Josh's comments.
2) Add a new patch which fixes all Box's padding values in Hob code.
Thanks,
Dongxiao
The following changes since commit 2d56dc7b1f0d186e14c4c8a949b280b6b3fc31de:
codeparser: Call intern over the set contents for better cache performance (2012-03-12 02:22:34 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dxu4/hob-bugfix
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-bugfix
Dongxiao Xu (12):
Hob: add "Close" button to "BinbDialog"
Hob: Disable the handling of "NoProvider" event
cooker: add package rdepends and rrecommends info
Hob: Fix the image installation dependency
Hob: Remove the reset button in recipe/package selection page
Hob: Remove the indication in machine/base image combobox
Hob: Remove the recipe/package populated signal
Hob: Show recipe/package editing button after base image is selected
Hob: Emit command-failed signal even if error msg is None
Hob: Add stop button for parsing progress
Hob: improve recipe/package selection performance
Hob: Change Box's padding value
lib/bb/cooker.py | 4 +- lib/bb/ui/crumbs/builddetailspage.py | 6 +- lib/bb/ui/crumbs/builder.py | 68 +++++++++++++++++---------- lib/bb/ui/crumbs/hig.py | 18 ++++---- lib/bb/ui/crumbs/hobeventhandler.py | 43 ++++++++++-------- lib/bb/ui/crumbs/hoblistmodel.py | 32 +++----------- lib/bb/ui/crumbs/hobpages.py | 2 +- lib/bb/ui/crumbs/imageconfigurationpage.py | 50 ++++++++++++++------- lib/bb/ui/crumbs/imagedetailspage.py | 2 +- lib/bb/ui/crumbs/packageselectionpage.py | 14 +----- lib/bb/ui/crumbs/recipeselectionpage.py | 12 +---- 11 files changed, 128 insertions(+), 123 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 4/12 Hob: Fix the image installation dependency
Get the image installation content from rdepends and rrecommends variables.
--- lib/bb/ui/crumbs/hoblistmodel.py | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
lib/bb/ui/crumbs/hoblistmodel.py +2 -4
@@ -546,9 +546,7 @@ class RecipeListModel(gtk.ListStore): group = event_model["pn"][item]["section"] install = [] - depends = event_model["depends"].get(item, []) - rdepends = event_model["rdepends-pn"].get(item, []) - depends = depends + rdepends + depends = event_model["depends"].get(item, []) + event_model["rdepends-pn"].get(item, []) if ('task-' in name): if ('lib32-' in name or 'lib64-' in name):
@@ -557,7 +555,7 @@ class RecipeListModel(gtk.ListStore): atype = 'task' elif ('-image-' in name): atype = 'image' - install = rdepends + install = event_model["rdepends-pkg"].get(item, []) + event_model["rrecs-pkg"].get(item, []) elif ('meta-' in name): atype = 'toolchain' elif (name == 'dummy-image' or name == 'dummy-toolchain'):
Signature · 1 line
1.7.4.1
PATCH 12/12 Hob: Change Box's padding value
In reply to Dongxiao XuFor Box type of widget, change the padding value to be HIG consistent, that is an increments of 6 pixels.
--- lib/bb/ui/crumbs/builddetailspage.py | 6 +++--- lib/bb/ui/crumbs/hig.py | 14 +++++++------- lib/bb/ui/crumbs/hobpages.py | 2 +- lib/bb/ui/crumbs/imageconfigurationpage.py | 2 +- lib/bb/ui/crumbs/imagedetailspage.py | 2 +- lib/bb/ui/crumbs/packageselectionpage.py | 2 +- lib/bb/ui/crumbs/recipeselectionpage.py | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-)
lib/bb/ui/crumbs/builddetailspage.py +3 -3
@@ -40,9 +40,9 @@ class BuildDetailsPage (HobPage): def create_visual_elements(self): # create visual elements - self.vbox = gtk.VBox(False, 15) + self.vbox = gtk.VBox(False, 12) - self.progress_box = gtk.HBox(False, 5) + self.progress_box = gtk.HBox(False, 6) self.progress_bar = HobProgressBar() self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) self.stop_button = gtk.LinkButton("Stop the build process", "Stop")
@@ -55,7 +55,7 @@ class BuildDetailsPage (HobPage): self.scrolled_view.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.scrolled_view.add(self.build_tv) - self.button_box = gtk.HBox(False, 5) + self.button_box = gtk.HBox(False, 6) self.back_button = gtk.LinkButton("Go back to Image Configuration screen", "<< Back to image configuration") self.back_button.connect("clicked", self.back_button_clicked_cb) self.button_box.pack_start(self.back_button, expand=False, fill=False)
lib/bb/ui/crumbs/hig.py +7 -7
@@ -127,7 +127,7 @@ class AdvancedSettingDialog (CrumbsDialog): return label def gen_spinner_widget(self, content, lower, upper, tooltip=""): - hbox = gtk.HBox(False, 10) + hbox = gtk.HBox(False, 12) adjust = gtk.Adjustment(value=content, lower=lower, upper=upper, step_incr=1) spinner = gtk.SpinButton(adjustment=adjust, climb_rate=1, digits=0)
@@ -141,7 +141,7 @@ class AdvancedSettingDialog (CrumbsDialog): return hbox, spinner def gen_combo_widget(self, curr_item, all_item, tooltip=""): - hbox = gtk.HBox(False, 10) + hbox = gtk.HBox(False, 12) combo = gtk.combo_box_new_text() hbox.pack_start(combo, expand=False, fill=False)
@@ -171,7 +171,7 @@ class AdvancedSettingDialog (CrumbsDialog): dialog.destroy() def gen_entry_widget(self, split_model, content, parent, tooltip=""): - hbox = gtk.HBox(False, 10) + hbox = gtk.HBox(False, 12) entry = gtk.Entry() entry.set_text(content)
@@ -259,7 +259,7 @@ class AdvancedSettingDialog (CrumbsDialog): model.set(it, column, val) def gen_pkgfmt_widget(self, curr_package_format, all_package_format, tooltip=""): - pkgfmt_hbox = gtk.HBox(False, 15) + pkgfmt_hbox = gtk.HBox(False, 12) pkgfmt_store = gtk.ListStore(int, str, gobject.TYPE_BOOLEAN) for format in curr_package_format.split():
@@ -358,9 +358,9 @@ class AdvancedSettingDialog (CrumbsDialog): model.remove(iter) def gen_editable_settings(self, setting, tooltip=""): - setting_hbox = gtk.HBox(False, 10) + setting_hbox = gtk.HBox(False, 12) - vbox = gtk.VBox(False, 10) + vbox = gtk.VBox(False, 12) setting_hbox.pack_start(vbox, expand=True, fill=True) setting_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
@@ -403,7 +403,7 @@ class AdvancedSettingDialog (CrumbsDialog): vbox.pack_start(scroll, expand=True, fill=True) # some buttons - hbox = gtk.HBox(True, 4) + hbox = gtk.HBox(True, 6) vbox.pack_start(hbox, False, False) button = gtk.Button(stock=gtk.STOCK_ADD)
lib/bb/ui/crumbs/hobpages.py +1 -1
@@ -39,7 +39,7 @@ class HobPage (gtk.VBox): else: self.title = title - self.box_group_area = gtk.VBox(False, 15) + self.box_group_area = gtk.VBox(False, 12) self.box_group_area.set_size_request(self.builder_width - 73 - 73, self.builder_height - 88 - 15 - 15) self.group_align = gtk.Alignment(xalign = 0, yalign=0.5, xscale=1, yscale=1) self.group_align.set_padding(15, 15, 73, 73)
lib/bb/ui/crumbs/imageconfigurationpage.py +1 -1
@@ -218,7 +218,7 @@ class ImageConfigurationPage (HobPage): def create_config_build_button(self): # Create the "Build packages" and "Just bake" buttons at the bottom - button_box = gtk.HBox(False, 5) + button_box = gtk.HBox(False, 6) # create button "Just bake" just_bake_button = gtk.Button()
lib/bb/ui/crumbs/imagedetailspage.py +1 -1
@@ -258,7 +258,7 @@ class ImageDetailsPage (HobPage): def create_bottom_buttons(self, buttonlist): # Create the buttons at the bottom - bottom_buttons = gtk.HBox(False, 5) + bottom_buttons = gtk.HBox(False, 6) created = False # create button "Deploy image"
lib/bb/ui/crumbs/packageselectionpage.py +1 -1
@@ -133,7 +133,7 @@ class PackageSelectionPage (HobPage): # add all into the dialog self.box_group_area.add(self.grid) - button_box = gtk.HBox(False, 5) + button_box = gtk.HBox(False, 6) self.box_group_area.pack_start(button_box, expand=False, fill=False) self.build_image_button = gtk.Button()
lib/bb/ui/crumbs/recipeselectionpage.py +1 -1
@@ -157,7 +157,7 @@ class RecipeSelectionPage (HobPage): # add all into the window self.box_group_area.add(self.grid) - button_box = gtk.HBox(False, 5) + button_box = gtk.HBox(False, 6) self.box_group_area.pack_end(button_box, expand=False, fill=False) self.build_packages_button = gtk.Button()
Signature · 1 line
1.7.4.1
Quoted 19 lines · Dongxiao Xu
Hi Richard,
This is the second pull request for Hob functionality and GUI fixes, please help to review and pull.
Changes from v1:
1) Modify the Box padding according to Josh's comments.
2) Add a new patch which fixes all Box's padding values in Hob code.Thanks,
DongxiaoThe following changes since commit
2d56dc7b1f0d186e14c4c8a949b280b6b3fc31de:codeparser: Call intern over the set contents for better cache performance (2012-03-12 02:22:34 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contribdxu4/hob-bugfix
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-bugfix
Quoted 13 lines
Dongxiao Xu (12):
Hob: add "Close" button to "BinbDialog"
Hob: Disable the handling of "NoProvider" event
cooker: add package rdepends and rrecommends info
Hob: Fix the image installation dependency
Hob: Remove the reset button in recipe/package selection page
Hob: Remove the indication in machine/base image combobox
Hob: Remove the recipe/package populated signal
Hob: Show recipe/package editing button after base image is selected
Hob: Emit command-failed signal even if error msg is None
Hob: Add stop button for parsing progress
Hob: improve recipe/package selection performance
Hob: Change Box's padding value
These look good to me, merged to master, thanks.
Richard