Skip to contentSkip to conversation

hob bug fixes

PATCH Applied Joshua Lock 2 participants 8 messages Aug 3, 2011

lore
Share & tools
lore
#0 lore raw

cover hob bug fixes

This includes fixes for some usability quirks in hob. The shared runningbuild component has had its behaviour modified and most of this series deals with adding machinery to optionally enable the old behaviour and then doing so for the hob.

The following changes since commit 1009ca570a750a00b0e60afcc30ead070c7b310a:

hob: remove temporary directory on program shutdown (2011-07-30 12:21:18 -0700)

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

Joshua Lock (6):
bb/ui/hob: save changes to bblayers.conf when using Add Layer menu
item
bb/ui/crumbs/runningbuild: optionally create list entries
sequentially
bb/ui/hob: show build messages are displayed in the order they're
received
ui/crumbs/runningbuild: add optional readonly mode, default off bb/ui/hob: disable editing in the build messages tree view bb/ui/crumbs/runningbuild: emit signal when command fails with exit
signal

 lib/bb/ui/crumbs/runningbuild.py |   48 +++++++++++++++++++++++--------------
 lib/bb/ui/hob.py                 |    5 ++-
 2 files changed, 33 insertions(+), 20 deletions(-)
Signature · 1 line
1.7.6
#1 lore raw

PATCH 1/6 bb/ui/hob: save changes to bblayers.conf when using Add Layer menu item

Fixes [YOCTO #1283]

---
 lib/bb/ui/hob.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
lib/bb/ui/hob.py +1 -0
index b5c2342..14ea1f2 100644
@@ -334,6 +334,7 @@ class MainWindow (gtk.Window):
 
     def add_layer_cb(self, action):
         self.layers.find_layer(self)
+        self.layers.save_current_layers()
 
     def preferences_cb(self, action):
         resp = self.prefs.run()
Signature · 1 line
1.7.6
#2 lore raw

PATCH 2/6 bb/ui/crumbs/runningbuild: optionally create list entries sequentially

In reply to Joshua Lock

In b947e7aa405966262c0614cae02e7978ec637095 Bob changed the behaviour of the RunningBuildModel such that the items are added to the model in a non-sequential order.

The messages in the view being listed out of order from how they are received is undesirable for users of the hob UI, therefore this patch adds an optional sequential parameter to the RunningBuild initialiser which, when set to True, will always append new messages so that the order shown in the view is that the messages are received in. The parameter defaults to to False such that the behaviour added by Bob is preserved.

Partially addresses [YOCTO #1311]

---
 lib/bb/ui/crumbs/runningbuild.py |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)
lib/bb/ui/crumbs/runningbuild.py +21 -16
index bdab340..c4d6d33 100644
@@ -63,9 +63,10 @@ class RunningBuild (gobject.GObject):
     pids_to_task = {}
     tasks_to_iter = {}
 
-    def __init__ (self):
+    def __init__ (self, sequential=False):
         gobject.GObject.__init__ (self)
         self.model = RunningBuildModel()
+        self.sequential = sequential
 
     def handle_event (self, event, pbar=None):
         # Handle an event from the event queue, this may result in updating
@@ -105,18 +106,18 @@ class RunningBuild (gobject.GObject):
 
             # if we know which package we belong to, we'll append onto its list.
             # otherwise, we'll jump to the top of the master list
-            if parent:
+            if self.sequential or not parent:
                 tree_add = self.model.append
             else:
                 tree_add = self.model.prepend
             tree_add(parent,
-                              (None,
-                               package,
-                               task,
-                               event.getMessage(),
-                               icon,
-                               color,
-                               0))
+                     (None,
+                      package,
+                      task,
+                      event.getMessage(),
+                      icon,
+                      color,
+                      0))
 
         elif isinstance(event, bb.build.TaskStarted):
             (package, task) = (event._package, event._task)
@@ -130,13 +131,17 @@ class RunningBuild (gobject.GObject):
             if ((package, None) in self.tasks_to_iter):
                 parent = self.tasks_to_iter[(package, None)]
             else:
-                parent = self.model.prepend(None, (None,
-                                                   package,
-                                                   None,
-                                                   "Package: %s" % (package),
-                                                   None,
-                                                   Colors.OK,
-                                                   0))
+                if self.sequential:
+                    add = self.model.append
+                else:
+                    add = self.model.prepend
+                parent = add(None, (None,
+                                    package,
+                                    None,
+                                    "Package: %s" % (package),
+                                    None,
+                                    Colors.OK,
+                                    0))
                 self.tasks_to_iter[(package, None)] = parent
 
             # Because this parent package now has an active child mark it as
Signature · 1 line
1.7.6
#3 lore raw

PATCH 3/6 bb/ui/hob: show build messages are displayed in the order they're received

In reply to Joshua Lock

Use the new sequential option of RunningBuild to ensure this.

Fixes the first part of [YOCTO #1311]

---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +1 -1
index 14ea1f2..9debbca 100644
@@ -64,7 +64,7 @@ class MainWindow (gtk.Window):
         self.set_icon_name("applications-development")
         self.set_default_size(1000, 650)
 
-        self.build = RunningBuild()
+        self.build = RunningBuild(sequential=True)
         self.build.connect("build-failed", self.running_build_failed_cb)
         self.build.connect("build-succeeded", self.running_build_succeeded_cb)
         self.build.connect("build-started", self.build_started_cb)
Signature · 1 line
1.7.6
#4 lore raw

PATCH 4/6 ui/crumbs/runningbuild: add optional readonly mode, default off

In reply to Joshua Lock

In b947e7aa405966262c0614cae02e7978ec637095 Bob started to introduce code for a right-click menu, whilst most of the code is non-invasive it does enable the editable property of the gtk.TreeView which can be confusing.

This change adds a readonly parameter, defaulting to False, to the RunningBuildTreeView which if True will prevent the editable property from being set.

---
 lib/bb/ui/crumbs/runningbuild.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/runningbuild.py +3 -2
index c4d6d33..2399ff3 100644
@@ -277,8 +277,9 @@ class RunningBuildTreeView (gtk.TreeView):
     __gsignals__ = {
         "button_press_event" : "override"
         }
-    def __init__ (self):
+    def __init__ (self, readonly=False):
         gtk.TreeView.__init__ (self)
+        self.readonly = readonly
 
         # The icon that indicates whether we're building or failed.
         renderer = gtk.CellRendererPixbuf ()
@@ -290,7 +291,7 @@ class RunningBuildTreeView (gtk.TreeView):
         self.message_renderer = gtk.CellRendererText ()
         self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=3)
         self.message_column.add_attribute(self.message_renderer, 'background', 5)
-        self.message_renderer.set_property('editable', 5)
+        self.message_renderer.set_property('editable', (not self.readonly))
         self.append_column (self.message_column)
 
     def do_button_press_event(self, event):
Signature · 1 line
1.7.6
#5 lore raw

PATCH 5/6 bb/ui/hob: disable editing in the build messages tree view

In reply to Joshua Lock

Addresses the second part of [YOCTO #1311]

---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +1 -1
index 9debbca..a770fc2 100644
@@ -731,7 +731,7 @@ class MainWindow (gtk.Window):
         vbox = gtk.VBox(False, 12)
         vbox.set_border_width(6)
         vbox.show()
-        build_tv = RunningBuildTreeView()
+        build_tv = RunningBuildTreeView(readonly=True)
         build_tv.show()
         build_tv.set_model(self.build.model)
         self.build.model.connect("row-inserted", self.scroll_tv_cb, build_tv)
Signature · 1 line
1.7.6
#6 lore raw

PATCH 6/6 bb/ui/crumbs/runningbuild: emit signal when command fails with exit signal

In reply to Joshua Lock

Emit the generic build-complete signal when a command fails with an exit signal enabling the UI to update itself accordingly.

Addresses [YOCTO #1265]

---
 lib/bb/ui/crumbs/runningbuild.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/runningbuild.py +6 -0
index 2399ff3..bf72e2a 100644
@@ -239,6 +239,12 @@ class RunningBuild (gobject.GObject):
             else:
                 self.emit ("build-succeeded")
 
+        elif isinstance(event, bb.command.CommandFailed):
+            if event.error.startswith("Exited with"):
+                # If the command fails with an exit code we're done, emit the
+                # generic signal for the UI to notify the user
+                self.emit("build-complete")
+
         elif isinstance(event, bb.event.CacheLoadStarted) and pbar:
             pbar.set_title("Loading cache")
             self.progress_total = event.total
Signature · 1 line
1.7.6
#7 lore raw
In reply to Joshua Lock
Quoted 25 lines · Joshua Lock

This includes fixes for some usability quirks in hob. The shared runningbuild component has had its behaviour modified and most of this series deals with adding machinery to optionally enable the old behaviour and then doing so for the hob.

The following changes since commit 1009ca570a750a00b0e60afcc30ead070c7b310a:

hob: remove temporary directory on program shutdown (2011-07-30 12:21:18 -0700)

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

Joshua Lock (6):
bb/ui/hob: save changes to bblayers.conf when using Add Layer menu
item
bb/ui/crumbs/runningbuild: optionally create list entries
sequentially
bb/ui/hob: show build messages are displayed in the order they're
received
ui/crumbs/runningbuild: add optional readonly mode, default off bb/ui/hob: disable editing in the build messages tree view bb/ui/crumbs/runningbuild: emit signal when command fails with exit
signal

Quoted 3 lines
 lib/bb/ui/crumbs/runningbuild.py |   48 +++++++++++++++++++++++--------------
 lib/bb/ui/hob.py                 |    5 ++-
 2 files changed, 33 insertions(+), 20 deletions(-)

Merged to master, thanks.

Richard