bitbake/crumbs: add optional pbar parameter to RunningBuild.handle_event()

Defaults to None, but if set will pass the ParseProgress sofar and total to
pbar's update() method.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
Joshua Lock 2010-11-25 15:54:19 +00:00 committed by Richard Purdie
parent 1307d64286
commit 84384aa8a9
1 changed files with 9 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class RunningBuild (gobject.GObject):
gobject.GObject.__init__ (self)
self.model = RunningBuildModel()
def handle_event (self, event):
def handle_event (self, event, pbar=None):
# Handle an event from the event queue, this may result in updating
# the model and thus the UI. Or it may be to tell us that the build
# has finished successfully (or not, as the case may be.)
@ -162,6 +162,14 @@ class RunningBuild (gobject.GObject):
else:
self.emit ("build-succeeded")
elif isinstance(event, bb.event.ParseProgress) and pbar:
x = event.sofar
y = event.total
if x == y:
pbar.hide()
return
pbar.update(x, y)
class RunningBuildTreeView (gtk.TreeView):
def __init__ (self):
gtk.TreeView.__init__ (self)