Skip to contentSkip to conversation

Hob: Functionality and GUI fixes

GIT PULL In review Dongxiao Xu 2 participants 29 messages Mar 14, 2012 – Mar 15, 2012 Arm STM32

lore
Share & tools
lore
#0 lore raw

Hi Richard,

This pull request is a bunch of fixes to the new Hob, please help to review and pull.

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 (11):
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

 lib/bb/cooker.py                           |    4 +-
 lib/bb/ui/crumbs/builder.py                |   68 +++++++++++++++++----------
 lib/bb/ui/crumbs/hig.py                    |    4 +-
 lib/bb/ui/crumbs/hobeventhandler.py        |   43 ++++++++++--------
 lib/bb/ui/crumbs/hoblistmodel.py           |   32 +++-----------
 lib/bb/ui/crumbs/imageconfigurationpage.py |   48 +++++++++++++------
 lib/bb/ui/crumbs/packageselectionpage.py   |   12 +-----
 lib/bb/ui/crumbs/recipeselectionpage.py    |   10 +----
 8 files changed, 113 insertions(+), 108 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/11 Hob: add "Close" button to "BinbDialog"

For 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
index e175a2a..28b7eef 100644
@@ -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
#3 lore raw

PATCH 2/11 Hob: Disable the handling of "NoProvider" event

In reply to Dongxiao Xu

Currently 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
index 6c109fc..9c82bfe 100644
@@ -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
#9 lore raw

PATCH 4/11 Hob: Fix the image installation dependency

In reply to Dongxiao Xu

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
index 0b7c0cb..0378828 100644
@@ -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
#7 lore raw

PATCH 3/11 cooker: add package rdepends and rrecommends info

In reply to Dongxiao Xu

When 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
index 78d8754..eada435 100644
@@ -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
#15 lore raw

PATCH 6/11 Hob: Remove the indication in machine/base image combobox

In reply to Dongxiao Xu

Remove 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
index 0378828..c19aaa8 100644
@@ -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
index f029bf8..3b1201e 100644
@@ -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
#17 lore raw

PATCH 7/11 Hob: Remove the recipe/package populated signal

In reply to Dongxiao Xu

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.

---
 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
index f9844de..c6b1a3d 100755
@@ -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
index c19aaa8..edd61b5 100644
@@ -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
#19 lore raw

PATCH 8/11 Hob: Show recipe/package editing button after base image is selected

In reply to Dongxiao Xu

Only 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
index c6b1a3d..f52b475 100755
@@ -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
index 3b1201e..f386281 100644
@@ -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
#21 lore raw

PATCH 9/11 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
index f52b475..1363475 100755
@@ -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
index 9c82bfe..cd25754 100644
@@ -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
#23 lore raw

PATCH 10/11 Hob: Add stop button for parsing progress

In reply to Dongxiao Xu

Add 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
index 1363475..1d255ac 100755
@@ -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
index cd25754..790e2ef 100644
@@ -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
index f386281..2af9054 100644
@@ -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, 5)
         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
#13 lore raw

PATCH 5/11 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
index a905030..f9844de 100755
@@ -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
index a8628ac..0427fe2 100755
@@ -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
index aea9c0c..234734c 100755
@@ -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
#26 lore raw

PATCH 11/11 Hob: improve recipe/package selection performance

In reply to Dongxiao Xu

Originally 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
index edd61b5..caf31bc 100644
@@ -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
index 0427fe2..4fb199e 100755
@@ -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
index 234734c..50d4363 100755
@@ -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
#27 lore raw

Re: [PATCH 11/11] Hob: improve recipe/package selection performance

Quoted 8 lines · Dongxiao Xu

Originally 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.

Awesome! So instead of sending the change notification for each included/excluded item with this change the signal will be sent once when a set of changes are made. Right?

Quoted 2 lines
Quoted 90 lines
---
  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
index edd61b5..caf31bc 100644
@@ -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
index 0427fe2..4fb199e 100755
@@ -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
index 234734c..50d4363 100755
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#24 lore raw

Re: [PATCH 10/11] Hob: Add stop button for parsing progress

In reply to Dongxiao Xu
Quoted 3 lines · Dongxiao Xu

Add a Stop button to allow user to quit the parsing process.

I'm upset to see using 5 for padding after having raised the issue so many times... I don't think it's a good enough reason to bounce this functionality when the padding is all over app-wide though.

Quoted 109 lines
---
  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
index 1363475..1d255ac 100755
@@ -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
index cd25754..790e2ef 100644
@@ -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
index f386281..2af9054 100644
@@ -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, 5)
          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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#22 lore raw

Re: [PATCH 09/11] Hob: Emit command-failed signal even if error msg is None

In reply to Dongxiao Xu
Quoted 1 line · Dongxiao Xu
Quoted 45 lines
---
  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
index f52b475..1363475 100755
@@ -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
index 9c82bfe..cd25754 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#18 lore raw

Re: [PATCH 07/11] Hob: Remove the recipe/package populated signal

In reply to Dongxiao Xu
Quoted 5 lines · Dongxiao Xu

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.

AFAICS this switches the GUI even if the model is not ready, which seems like a reasonable change.

Quoted 125 lines
---
  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
index f9844de..c6b1a3d 100755
@@ -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
index c19aaa8..edd61b5 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#20 lore raw

Re: [PATCH 08/11] Hob: Show recipe/package editing button after base image is selected

In reply to Dongxiao Xu
Quoted 3 lines · Dongxiao Xu

Only show recipe and package editing button after base image is selected.

Quoted 97 lines
---
  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
index c6b1a3d..f52b475 100755
@@ -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
index 3b1201e..f386281 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#10 lore raw

Re: [PATCH 04/11] Hob: Fix the image installation dependency

In reply to Dongxiao Xu
Quoted 24 lines · Dongxiao Xu

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 +1 -3
index 0b7c0cb..0378828 100644
@@ -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):

lib/bb/ui/crumbs/hoblistmodel.py class RecipeListModel(gtk.ListStore): · line 558

Quoted 5 lines
lib/bb/ui/crumbs/hoblistmodel.py +1 -1
@@ -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, [])

rrecs should be recommendations, not requirements - are we making the conscious decision to include all recommended packages when building with Hob?

Quoted 3 lines
lib/bb/ui/crumbs/hoblistmodel.py +0 -0
              elif ('meta-' in name):
                  atype = 'toolchain'
              elif (name == 'dummy-image' or name == 'dummy-toolchain'):
Signature · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#14 lore raw

Re: [PATCH 05/11] Hob: Remove the reset button in recipe/package selection page

In reply to Dongxiao Xu
Quoted 1 line · Dongxiao Xu
Quoted 79 lines
---
  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
index a905030..f9844de 100755
@@ -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
index a8628ac..0427fe2 100755
@@ -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
index aea9c0c..234734c 100755
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#16 lore raw

Re: [PATCH 06/11] Hob: Remove the indication in machine/base image combobox

In reply to Dongxiao Xu
Quoted 5 lines · Dongxiao Xu

Remove the "--select a machine--" prompt in machine selection. Also change "--select a base image--" to "Start from scratch" for base image selection.

Looks good.

Quoted 77 lines
---
  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
index 0378828..c19aaa8 100644
@@ -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
index f029bf8..3b1201e 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#2 lore raw

Re: [PATCH 01/11] Hob: add "Close" button to "BinbDialog"

In reply to Dongxiao Xu
Quoted 7 lines · Dongxiao Xu

For 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

I think we want to switch to persistent tooltips for this functionality but until that change is ready this is a good patch.

Quoted 24 lines
---
  lib/bb/ui/crumbs/hig.py |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/hig.py +2 -2
index e175a2a..28b7eef 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#4 lore raw

Re: [PATCH 02/11] Hob: Disable the handling of "NoProvider" event

In reply to Dongxiao Xu
Quoted 5 lines · Dongxiao Xu

Currently 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.

I'm not sure we'll ever be able to strongly guarantee that NoProvider issues won't creep in. Would we better off coming up with a more tenable long term solution?

Quoted 2 lines

This is a reasonable short-term solution

Quoted 52 lines
---
  lib/bb/ui/crumbs/hobeventhandler.py |   37 ++++++++++++++++++----------------
  1 files changed, 20 insertions(+), 17 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +20 -17
index 6c109fc..9c82bfe 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#8 lore raw

Re: [PATCH 03/11] cooker: add package rdepends and rrecommends info

In reply to Dongxiao Xu
Quoted 4 lines · Dongxiao Xu

When calculating the image installation dependency, we need the rdepends and rrecommends information of certain packages.

Quoted 26 lines
---
  lib/bb/cooker.py |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
lib/bb/cooker.py +3 -1
index 78d8754..eada435 100644
@@ -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 · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#28 lore raw

Re: [PATCH 11/11] Hob: improve recipe/package selection performance

In reply to Joshua Lock
Quoted 6 lines · Joshua Lock
Quoted 4 lines · Dongxiao Xu

Originally 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.

Quoted 8 lines
Quoted 4 lines

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.

Awesome! So instead of sending the change notification for each included/excluded item with this change the signal will be sent once when a set of changes are made. Right?

Yes, you are right. Now the signal only emits once where a bunch of changes happen.

Thanks,
Dongxiao

Quoted 97 lines
Quoted 3 lines
Quoted 90 lines
---
  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
index edd61b5..caf31bc 100644
@@ -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
index 0427fe2..4fb199e 100755
@@ -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
index 234734c..50d4363 100755
@@ -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):
#25 lore raw

Re: [PATCH 10/11] Hob: Add stop button for parsing progress

In reply to Joshua Lock
Quoted 9 lines · Joshua Lock
Quoted 3 lines · Dongxiao Xu

Add a Stop button to allow user to quit the parsing process.

I'm upset to see using 5 for padding after having raised the issue so many times... I don't think it's a good enough reason to bounce this functionality when the padding is all over app-wide though.

Sorry for this change...
I just simply copied another piece of code in builddetailspage and didn't care the padding value.

I will modify both of these values to 6.

Thanks,
Dongxiao

Quoted 113 lines
Quoted 109 lines
---
  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
index 1363475..1d255ac 100755
@@ -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
index cd25754..790e2ef 100644
@@ -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
index f386281..2af9054 100644
@@ -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, 5)
          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)
#11 lore raw

Re: [PATCH 04/11] Hob: Fix the image installation dependency

In reply to Joshua Lock
Quoted 23 lines · Joshua Lock
Quoted 21 lines · Dongxiao Xu

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 +1 -3
index 0b7c0cb..0378828 100644
@@ -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, [])
 
Quoted 12 lines

lib/bb/ui/crumbs/hoblistmodel.py class RecipeListModel(gtk.ListStore): · line 558

Quoted 8 lines
lib/bb/ui/crumbs/hoblistmodel.py +1 -1
              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, [])

rrecs should be recommendations, not requirements - are we making the conscious decision to include all recommended packages when building with Hob?

Per my understanding, RRECOMMENDS means that if the recommended package do exists, then install it. Else if it doesn't, system will not report error as missing dependency. (Correct me if it is wrong)

Here in Hob code, we will try to install both RDEPENDS and RRECOMMENDS packages. But note that here the "install" variable is only used to make selections in "Package Selection" page. Therefore if a recommended package doesn't exists, it will not be included in the installation list.

Thanks,
Dongxiao

Quoted 5 lines
Quoted 4 lines
lib/bb/ui/crumbs/hoblistmodel.py +0 -0
              elif ('meta-' in name):
                  atype = 'toolchain'
              elif (name == 'dummy-image' or name == 'dummy-toolchain'):
#5 lore raw

Re: [PATCH 02/11] Hob: Disable the handling of "NoProvider" event

In reply to Joshua Lock
Quoted 11 lines · Joshua Lock
Quoted 5 lines · Dongxiao Xu

Currently 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.

I'm not sure we'll ever be able to strongly guarantee that NoProvider issues won't creep in. Would we better off coming up with a more tenable long term solution?

The current code is a strict check for NoProvider issue. Do you have any suggestion on this one? What about putting the NoProvider error in building time?

Thanks,
Dongxiao

Quoted 61 lines
Quoted 3 lines

This is a reasonable short-term solution

Quoted 52 lines
---
  lib/bb/ui/crumbs/hobeventhandler.py |   37 ++++++++++++++++++----------------
  1 files changed, 20 insertions(+), 17 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +20 -17
index 6c109fc..9c82bfe 100644
@@ -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 = []
#12 lore raw

Re: [PATCH 04/11] Hob: Fix the image installation dependency

In reply to Xu, Dongxiao
Quoted 37 lines · Dongxiao
Quoted 23 lines · Joshua Lock
Quoted 21 lines · Dongxiao Xu

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 +1 -3
index 0b7c0cb..0378828 100644
@@ -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, [])
 
Quoted 12 lines

lib/bb/ui/crumbs/hoblistmodel.py class RecipeListModel(gtk.ListStore): · line 558

Quoted 8 lines
lib/bb/ui/crumbs/hoblistmodel.py +1 -1
               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, [])

rrecs should be recommendations, not requirements - are we making the conscious decision to include all recommended packages when building with Hob?

Quoted 3 lines

Per my understanding, RRECOMMENDS means that if the recommended package do exists, then install it. Else if it doesn't, system will not report error as missing dependency. (Correct me if it is wrong)

I thought that the behaviour was dependant on which package backend you use (RPM, etc.) but the Yocto documentation agrees with your assertion so this behaviour seems reasonable.

Cheers,
Joshua

Signature · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre
#6 lore raw

Re: [PATCH 02/11] Hob: Disable the handling of "NoProvider" event

In reply to Xu, Dongxiao
Quoted 9 lines · Dongxiao
Quoted 8 lines · Joshua Lock
Quoted 5 lines · Dongxiao Xu

Currently 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.

Quoted 7 lines
Quoted 3 lines

I'm not sure we'll ever be able to strongly guarantee that NoProvider issues won't creep in. Would we better off coming up with a more tenable long term solution?

The current code is a strict check for NoProvider issue. Do you have any suggestion on this one? What about putting the NoProvider error in building time?

The ideal, from a user perspective, would I think be that any NoProvider recipes just aren't included in the list of available recipes/packages.

Joshua

Signature · 3 lines
Joshua '贾詡' Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre