From f353148390e093719a9734e46629a6570ef92557 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 2 Aug 2011 16:59:01 -0700 Subject: bb/ui/crumbs/runningbuild: optionally create list entries sequentially 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] CC: Bob Foerster (Bitbake rev: b16663e1919fddbf63d0ca7f9ad3ffdc7d1121fd) Signed-off-by: Joshua Lock Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/runningbuild.py | 37 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index bdab34040c..c4d6d33de5 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py @@ -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 -- cgit v1.2.3-54-g00ecf