summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/runningbuild.py
diff options
context:
space:
mode:
authorLiming An <limingx.l.an@intel.com>2012-03-23 22:29:46 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-28 16:49:18 +0100
commit673a8f44c55c503a6f4e68c2586685641ca7d74e (patch)
tree1ac475f5c5ec9984471d387c347cbae30c08b623 /bitbake/lib/bb/ui/crumbs/runningbuild.py
parentceee95efb1590b63a397bc680f1391d4c494fdd9 (diff)
downloadpoky-673a8f44c55c503a6f4e68c2586685641ca7d74e.tar.gz
Hob: add refresh icon as ui request in building log
add a refresh icon to indicator the running task, for avoid add more heavy to bitbake building process, increased the timer interval counter, and decreased the refresh icon render size. (From Poky rev: cf76d2cef0905a442e61769560173b2e6a58fb62) (Bitbake rev: d5923a484f80bc1577f78035152c2d0728e4a1f3) Signed-off-by: Liming An <limingx.l.an@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/runningbuild.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/runningbuild.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index 0f58e4e678..aecfadfb34 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -27,7 +27,7 @@ import urllib
27import urllib2 27import urllib2
28import pango 28import pango
29from bb.ui.crumbs.hobcolor import HobColors 29from bb.ui.crumbs.hobcolor import HobColors
30from bb.ui.crumbs.hobwidget import HobWarpCellRendererText 30from bb.ui.crumbs.hobwidget import HobWarpCellRendererText, HobCellRendererPixbuf
31 31
32class RunningBuildModel (gtk.TreeStore): 32class RunningBuildModel (gtk.TreeStore):
33 (COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = range(7) 33 (COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = range(7)
@@ -68,6 +68,14 @@ class RunningBuildModel (gtk.TreeStore):
68 model.set_visible_func(self.failure_model_filter) 68 model.set_visible_func(self.failure_model_filter)
69 return model 69 return model
70 70
71 def foreach_cell_func(self, model, path, iter, usr_data=None):
72 if model.get_value(iter, self.COL_ICON) == "task-refresh":
73 model.set(iter, self.COL_ICON, "")
74
75 def close_task_refresh(self):
76 self.foreach(self.foreach_cell_func, None)
77
78
71class RunningBuild (gobject.GObject): 79class RunningBuild (gobject.GObject):
72 __gsignals__ = { 80 __gsignals__ = {
73 'build-started' : (gobject.SIGNAL_RUN_LAST, 81 'build-started' : (gobject.SIGNAL_RUN_LAST,
@@ -189,7 +197,7 @@ class RunningBuild (gobject.GObject):
189 # Because this parent package now has an active child mark it as 197 # Because this parent package now has an active child mark it as
190 # such. 198 # such.
191 # @todo if parent is already in error, don't mark it green 199 # @todo if parent is already in error, don't mark it green
192 self.model.set(parent, self.model.COL_ICON, "gtk-execute", 200 self.model.set(parent, self.model.COL_ICON, "task-refresh",
193 self.model.COL_COLOR, HobColors.RUNNING) 201 self.model.COL_COLOR, HobColors.RUNNING)
194 202
195 # Add an entry in the model for this task 203 # Add an entry in the model for this task
@@ -197,7 +205,7 @@ class RunningBuild (gobject.GObject):
197 package, 205 package,
198 task, 206 task,
199 "Task: %s" % (task), 207 "Task: %s" % (task),
200 "gtk-execute", 208 "task-refresh",
201 HobColors.RUNNING, 209 HobColors.RUNNING,
202 0)) 210 0))
203 211
@@ -284,6 +292,8 @@ class RunningBuild (gobject.GObject):
284 # Emit a generic "build-complete" signal for things wishing to 292 # Emit a generic "build-complete" signal for things wishing to
285 # handle when the build is finished 293 # handle when the build is finished
286 self.emit("build-complete") 294 self.emit("build-complete")
295 # reset the all cell's icon indicator
296 self.model.close_task_refresh()
287 if pbar: 297 if pbar:
288 pbar.set_text(event.msg) 298 pbar.set_text(event.msg)
289 299
@@ -292,6 +302,8 @@ class RunningBuild (gobject.GObject):
292 # If the command fails with an exit code we're done, emit the 302 # If the command fails with an exit code we're done, emit the
293 # generic signal for the UI to notify the user 303 # generic signal for the UI to notify the user
294 self.emit("build-complete") 304 self.emit("build-complete")
305 # reset the all cell's icon indicator
306 self.model.close_task_refresh()
295 307
296 elif isinstance(event, bb.event.CacheLoadStarted) and pbar: 308 elif isinstance(event, bb.event.CacheLoadStarted) and pbar:
297 pbar.set_title("Loading cache") 309 pbar.set_title("Loading cache")
@@ -346,7 +358,7 @@ class RunningBuildTreeView (gtk.TreeView):
346 self.readonly = readonly 358 self.readonly = readonly
347 359
348 # The icon that indicates whether we're building or failed. 360 # The icon that indicates whether we're building or failed.
349 renderer = gtk.CellRendererPixbuf () 361 renderer = HobCellRendererPixbuf ()
350 col = gtk.TreeViewColumn ("Status", renderer) 362 col = gtk.TreeViewColumn ("Status", renderer)
351 col.add_attribute (renderer, "icon-name", 4) 363 col.add_attribute (renderer, "icon-name", 4)
352 self.append_column (col) 364 self.append_column (col)