Skip to contentSkip to conversation

Hob GUI tweaks and bugfixes

PATCH Applied Joshua Lock 2 participants 10 messages Jul 23, 2011 – Jul 25, 2011 Arm STM32

lore
Share & tools
lore
#0 lore raw

cover Hob GUI tweaks and bugfixes

This series contains largely cosmetic and purely GUI related changes to address some bugs filed against Hob and a few other GUI tweaks.

The following changes since commit abc67ed6921c98ed581f101ec1acc589fd9ce7e9:

bitbake/utils: Add contains helper function from lib.oe.utils (2011-07-22 12:11:01 +0100)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Joshua Lock (8):
hob: refer to tasks as Package Collections ui/crumbs/tasklistmodel: don't show native and cross recipes ui/hob: clear the search entry when resetting
ui/hob: if the user clicks Stop a second time only offer 'Force Stop'
hob: only add new layer's to the UI
ui/crumbs/hobprefs: set higher arbitrary limit on threads &
parallelism
ui/crumbs/hobprefs: tweak the package format tooltip
hob: rework image output type setting

 lib/bb/ui/crumbs/configurator.py    |   10 ++++--
 lib/bb/ui/crumbs/hobeventhandler.py |   21 +++++++++++-
 lib/bb/ui/crumbs/hobprefs.py        |   60 ++++++++++++++++++++++-------------
 lib/bb/ui/crumbs/layereditor.py     |    5 ++-
 lib/bb/ui/crumbs/tasklistmodel.py   |    3 ++
 lib/bb/ui/hob.py                    |   58 +++++++++++++++++++++------------
 6 files changed, 107 insertions(+), 50 deletions(-)
Signature · 1 line
1.7.6
#1 lore raw

PATCH 1/8 hob: refer to tasks as Package Collections

---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +1 -1
index 2df344f..b60ca2f 100644
@@ -602,7 +602,7 @@ class MainWindow (gtk.Window):
         self.tasks_tree.set_search_column(0)
         self.tasks_tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
 
-        col = gtk.TreeViewColumn('Package')
+        col = gtk.TreeViewColumn('Package Collection')
         col.set_min_width(430)
         col1 = gtk.TreeViewColumn('Description')
         col1.set_min_width(430)
Signature · 1 line
1.7.6
#2 lore raw

PATCH 2/8 ui/crumbs/tasklistmodel: don't show native and cross recipes

In reply to Joshua Lock

Addresses [YOCTO #1224]

---
 lib/bb/ui/crumbs/tasklistmodel.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +3 -0
index 112fdde..f4dffc6 100644
@@ -185,6 +185,9 @@ class TaskListModel(gtk.ListStore):
         if model.get_value(it, self.COL_TYPE) != 'package':
             return False
         else:
+            name = model.get_value(it, self.COL_NAME)
+            if name.count('-native') or name.count('cross'):
+                return False
             return True
 
     """
Signature · 1 line
1.7.6
#3 lore raw

PATCH 3/8 ui/hob: clear the search entry when resetting

In reply to Joshua Lock

When resetting and clearing all selections the searched for term is no longer the selected row in the packages list, clear the search entry to prevent cognitive disconnect.

---
 lib/bb/ui/hob.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
lib/bb/ui/hob.py +7 -6
index b60ca2f..a8bbd73 100644
@@ -282,6 +282,7 @@ class MainWindow (gtk.Window):
         dialog.destroy()
         if response == gtk.RESPONSE_OK:
             self.reset_build()
+            self.search.set_text("")
         return
 
     def reset_build(self):
@@ -576,12 +577,12 @@ class MainWindow (gtk.Window):
 
         hb = gtk.HBox(False, 0)
         hb.show()
-        search = gtk.Entry()
-        search.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, "gtk-clear")
-        search.connect("icon-release", self.search_entry_clear_cb)
-        search.show()
-        self.pkgsaz_tree.set_search_entry(search)
-        hb.pack_end(search, False, False, 0)
+        self.search = gtk.Entry()
+        self.search.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, "gtk-clear")
+        self.search.connect("icon-release", self.search_entry_clear_cb)
+        self.search.show()
+        self.pkgsaz_tree.set_search_entry(self.search)
+        hb.pack_end(self.search, False, False, 0)
         label = gtk.Label("Search packages:")
         label.show()
         hb.pack_end(label, False, False, 6)
Signature · 1 line
1.7.6
#4 lore raw

PATCH 4/8 ui/hob: if the user clicks Stop a second time only offer 'Force Stop'

In reply to Joshua Lock

Fixes [YOCTO #1264]

---
 lib/bb/ui/hob.py |   38 ++++++++++++++++++++++++++------------
 1 files changed, 26 insertions(+), 12 deletions(-)
lib/bb/ui/hob.py +26 -12
index a8bbd73..8e3e7bc 100644
@@ -46,6 +46,7 @@ class MainWindow (gtk.Window):
         self.files_to_clean = []
         self.selected_image = None
         self.selected_packages = None
+        self.stopping = False
 
         self.model = taskmodel
         self.model.connect("tasklist-populated", self.update_model)
@@ -403,6 +404,7 @@ class MainWindow (gtk.Window):
         self.nb.set_current_page(0)
 
     def build_complete_cb(self, running_build):
+        self.stopping = False
         self.back.connect("clicked", self.back_button_clicked_cb)
         self.back.set_sensitive(True)
         self.cancel.set_sensitive(False)
@@ -651,20 +653,32 @@ class MainWindow (gtk.Window):
         return vbox
 
     def cancel_build(self, button):
-        lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this build?\n"
-        lbl = lbl + "'Force Stop' will stop the build as quickly as"
-        lbl = lbl + " possible but may well leave your build directory in an"
-        lbl = lbl + " unusable state that requires manual steps to fix.\n"
-        lbl = lbl + "'Stop' will stop the build as soon as all in"
-        lbl = lbl + " progress build tasks are finished. However if a"
-        lbl = lbl + " lengthy compilation phase is in progress this may take"
-        lbl = lbl + " some time."
-        dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
-        dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
-        dialog.add_button("Stop", gtk.RESPONSE_OK)
-        dialog.add_button("Force Stop", gtk.RESPONSE_YES)
+        if self.stopping:
+            lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once,"
+            lbl = lbl + " would you like to 'Force Stop' the build?\n\n"
+            lbl = lbl + "This will stop the build as quickly as possible but may"
+            lbl = lbl + " well leave your build directory in an  unusable state"
+            lbl = lbl + " that requires manual steps to fix.\n"
+            dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
+            dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
+            dialog.add_button("Force Stop", gtk.RESPONSE_YES)
+        else:
+            lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this"
+            lbl = lbl + " build?\n\n'Force Stop' will stop the build as quickly as"
+            lbl = lbl + " possible but may well leave your build directory in an"
+            lbl = lbl + " unusable state that requires manual steps to fix.\n\n"
+            lbl = lbl + "'Stop' will stop the build as soon as all in"
+            lbl = lbl + " progress build tasks are finished. However if a"
+            lbl = lbl + " lengthy compilation phase is in progress this may take"
+            lbl = lbl + " some time."
+            dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
+            dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
+            dialog.add_button("Stop", gtk.RESPONSE_OK)
+            dialog.add_button("Force Stop", gtk.RESPONSE_YES)
         response = dialog.run()
         dialog.destroy()
+        if response != gtk.RESPONSE_CANCEL:
+            self.stopping = True
         if response == gtk.RESPONSE_OK:
             self.handler.cancel_build()
         elif response == gtk.RESPONSE_YES:
Signature · 1 line
1.7.6
#5 lore raw

PATCH 5/8 hob: only add new layer's to the UI

In reply to Joshua Lock

If a user added the same layer more than once the underlying bblayers.conf file would not have multiple entries but the UI would show an entry for the layer for each time it was added. This patch changes the Configurator to return None values if the layer wasn't added to bblayers.conf and the LayerEditor to only update the UI if non-None values are returned.

Fixes [YOCTO #1275]

---
 lib/bb/ui/crumbs/configurator.py |    4 +++-
 lib/bb/ui/crumbs/layereditor.py  |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)
lib/bb/ui/crumbs/configurator.py +3 -1
index 5511799..e7c524a 100644
@@ -139,7 +139,9 @@ class Configurator(gobject.GObject):
         name = self._getLayerName(layerpath)
         if name not in self.enabled_layers:
             self.addLayer(name, layerpath)
-        return name, layerpath
+            return name, layerpath
+        else:
+            return None, None
 
     def addLayer(self, name, path):
         self.enabled_layers[name] = path
lib/bb/ui/crumbs/layereditor.py +3 -2
index 76a2eb5..7c581d6 100644
@@ -132,5 +132,6 @@ class LayerEditor(gtk.Dialog):
             # FIXME: verify we've actually got a layer conf?
             if path.endswith(".conf"):
                 name, layerpath = self.configurator.addLayerConf(path)
-                self.newly_added[name] = layerpath
-                self.layer_store.append([name, layerpath, True])
+                if name:
+                    self.newly_added[name] = layerpath
+                    self.layer_store.append([name, layerpath, True])
Signature · 1 line
1.7.6
#6 lore raw

PATCH 6/8 ui/crumbs/hobprefs: set higher arbitrary limit on threads & parallelism

In reply to Joshua Lock

We don't have a good handle on a sane cap value so just set it to an arbitrary, but reasonably high, number. Once we have some more numbers on values for number of threads and make parallelism we can integrate the algorithm into the GUI.

Addresses [YOCTO #1266]

---
 lib/bb/ui/crumbs/hobprefs.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/hobprefs.py +6 -1
index 779c14a..e01a266 100644
@@ -243,7 +243,12 @@ class HobPrefs(gtk.Dialog):
         pbox.pack_start(hbox, expand=False, fill=False, padding=6)
         label = gtk.Label("BitBake threads:")
         label.show()
-        spin_max = 9 #self.cpu_cnt * 3
+        # NOTE: may be a good idea in future to intelligently cap the maximum
+        # values but we need more data to make an educated decision, for now
+        # set a high maximum as a value for upper bounds is required by the
+        # gtk.Adjustment
+        spin_max = 30 # seems like a high enough arbitrary number
+        #spin_max = self.cpu_cnt * 3
         hbox.pack_start(label, expand=False, fill=False, padding=6)
         bbadj = gtk.Adjustment(value=self.bbthread, lower=1, upper=spin_max, step_incr=1)
         bbspinner = gtk.SpinButton(adjustment=bbadj, climb_rate=1, digits=0)
Signature · 1 line
1.7.6
#7 lore raw

PATCH 7/8 ui/crumbs/hobprefs: tweak the package format tooltip

In reply to Joshua Lock
---
 lib/bb/ui/crumbs/hobprefs.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/hobprefs.py +2 -1
index e01a266..ab2f0d8 100644
@@ -210,7 +210,8 @@ class HobPrefs(gtk.Dialog):
         label.show()
         hbox.pack_start(label, expand=False, fill=False, padding=6)
         self.package_combo = gtk.combo_box_new_text()
-        self.package_combo.set_tooltip_text("Select the package format you would like to use in your image")
+        self.package_combo.set_tooltip_text("""The package format is that used in creation
+ of the root filesystem and also dictates the package manager used in your image""")
         self.package_combo.show()
         hbox.pack_start(self.package_combo, expand=False, fill=False, padding=6)
         # Image output type selector
Signature · 1 line
1.7.6
#8 lore raw

PATCH 8/8 hob: rework image output type setting

In reply to Joshua Lock

The preferences UI to set the image output type only supported setting a single value whereas it's common practice, particularly for those making use of the ADT, to set multiple values. This is also the default in Poky.

This reworked preferences UI dynamically generates check boxes for each available image type and sets an appropriate string representing all image types when checkboxes are toggled.

Includes fixes for [YOCTO #1273]

---
 lib/bb/ui/crumbs/configurator.py    |    6 +++-
 lib/bb/ui/crumbs/hobeventhandler.py |   21 +++++++++++++-
 lib/bb/ui/crumbs/hobprefs.py        |   50 +++++++++++++++++++++--------------
 lib/bb/ui/hob.py                    |    5 ++-
 4 files changed, 56 insertions(+), 26 deletions(-)
lib/bb/ui/crumbs/configurator.py +4 -2
index e7c524a..6481608 100644
@@ -90,12 +90,14 @@ class Configurator(gobject.GObject):
         pclass = getString('PACKAGE_CLASSES')
         if pclass and pclass != self.config.get('PACKAGE_CLASSES', ''):
             self.config['PACKAGE_CLASSES'] = pclass
+        fstypes = getString('IMAGE_FSTYPES')
+        if fstypes and fstypes != self.config.get('IMAGE_FSTYPES', ''):
+            self.config['IMAGE_FSTYPES'] = fstypes
 
         self.orig_config = copy.deepcopy(self.config)
 
     def setLocalConfVar(self, var, val):
-        if var in self.config:
-            self.config[var] = val
+        self.config[var] = val
 
     def _loadLayerConf(self, path):
         self.bblayers = path
lib/bb/ui/crumbs/hobeventhandler.py +19 -2
index fa79e0c..2f45350 100644
@@ -74,6 +74,8 @@ class HobHandler(gobject.GObject):
         self.model = taskmodel
         self.server = server
 
+        self.image_output_types = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]).split(" ")
+
         self.command_map = {
             "findConfigFilePathLocal" : ("findConfigFilePath", ["hob.local.conf"], "findConfigFilePathHobLocal"),
             "findConfigFilePathHobLocal" : ("findConfigFilePath", ["bblayers.conf"], "findConfigFilePathLayers"),
@@ -258,8 +260,23 @@ class HobHandler(gobject.GObject):
             self.building = None
             self.emit("build-complete")
 
-    def set_image_output_type(self, output_type):
-        self.server.runCommand(["setVariable", "IMAGE_FSTYPES", output_type])
+    def set_fstypes(self, fstypes):
+        self.server.runCommand(["setVariable", "IMAGE_FSTYPES", fstypes])
+
+    def add_image_output_type(self, output_type):
+        if output_type not in self.image_output_types:
+            self.image_output_types.append(output_type)
+            fstypes = " ".join(self.image_output_types)
+            self.set_fstypes(fstypes)
+        return fstypes
+
+    def remove_image_output_type(self, output_type):
+        if output_type in self.image_output_types:
+            ind = self.image_output_types.index(output_type)
+            self.image_output_types.pop(ind)
+            fstypes = " ".join(self.image_output_types)
+            self.set_fstypes(fstypes)
+        return fstypes
 
     def get_image_deploy_dir(self):
         return self.server.runCommand(["getVariable", "DEPLOY_DIR_IMAGE"])
lib/bb/ui/crumbs/hobprefs.py +30 -20

80 lines not on this page · raw message

lib/bb/ui/hob.py +3 -2
index 8e3e7bc..09a63c6 100644
@@ -900,7 +900,8 @@ def main (server, eventHandler):
         # up to and including the space
         pmake = int(pmake.lstrip("-j "))
 
-    image_types = server.runCommand(["getVariable", "IMAGE_TYPES"])
+    selected_image_types = server.runCommand(["getVariable", "IMAGE_FSTYPES"])
+    all_image_types = server.runCommand(["getVariable", "IMAGE_TYPES"])
 
     pclasses = server.runCommand(["getVariable", "PACKAGE_CLASSES"]).split(" ")
     # NOTE: we're only supporting one value for PACKAGE_CLASSES being set
@@ -909,7 +910,7 @@ def main (server, eventHandler):
     pkg, sep, pclass = pclasses[0].rpartition("_")
 
     prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
-                     pmake, bbthread, image_types)
+                     pmake, bbthread, selected_image_types, all_image_types)
     layers = LayerEditor(configurator, None)
     window = MainWindow(taskmodel, handler, configurator, prefs, layers, mach)
     prefs.set_parent_window(window)
Signature · 1 line
1.7.6
#9 lore raw
In reply to Joshua Lock
Quoted 11 lines · Joshua Lock

This series contains largely cosmetic and purely GUI related changes to address some bugs filed against Hob and a few other GUI tweaks.

The following changes since commit abc67ed6921c98ed581f101ec1acc589fd9ce7e9:

bitbake/utils: Add contains helper function from lib.oe.utils (2011-07-22 12:11:01 +0100)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Quoted 10 lines

Joshua Lock (8):
hob: refer to tasks as Package Collections ui/crumbs/tasklistmodel: don't show native and cross recipes ui/hob: clear the search entry when resetting
ui/hob: if the user clicks Stop a second time only offer 'Force Stop'
hob: only add new layer's to the UI
ui/crumbs/hobprefs: set higher arbitrary limit on threads &
parallelism
ui/crumbs/hobprefs: tweak the package format tooltip
hob: rework image output type setting

Merged to master, thanks.

Richard