diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/runningbuild.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 10ca394061..6e6aac9855 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -25,6 +25,7 @@ import logging | |||
25 | import time | 25 | import time |
26 | import urllib | 26 | import urllib |
27 | import urllib2 | 27 | import urllib2 |
28 | import pango | ||
28 | from bb.ui.crumbs.hobcolor import HobColors | 29 | from bb.ui.crumbs.hobcolor import HobColors |
29 | 30 | ||
30 | class RunningBuildModel (gtk.TreeStore): | 31 | class RunningBuildModel (gtk.TreeStore): |
@@ -40,6 +41,32 @@ class RunningBuildModel (gtk.TreeStore): | |||
40 | gobject.TYPE_STRING, | 41 | gobject.TYPE_STRING, |
41 | gobject.TYPE_INT) | 42 | gobject.TYPE_INT) |
42 | 43 | ||
44 | def config_model_filter(self, model, it): | ||
45 | msg = model.get(it, self.COL_MESSAGE)[0] | ||
46 | if msg == None or type(msg) != str: | ||
47 | return False | ||
48 | if msg.startswith("\nOE Build Configuration:\n"): | ||
49 | return True | ||
50 | return False | ||
51 | |||
52 | def failure_model_filter(self, model, it): | ||
53 | color = model.get(it, self.COL_COLOR)[0] | ||
54 | if color == None: | ||
55 | return False | ||
56 | if color == HobColors.ERROR: | ||
57 | return True | ||
58 | return False | ||
59 | |||
60 | def config_model(self): | ||
61 | model = self.filter_new() | ||
62 | model.set_visible_func(self.config_model_filter) | ||
63 | return model | ||
64 | |||
65 | def failure_model(self): | ||
66 | model = self.filter_new() | ||
67 | model.set_visible_func(self.failure_model_filter) | ||
68 | return model | ||
69 | |||
43 | class RunningBuild (gobject.GObject): | 70 | class RunningBuild (gobject.GObject): |
44 | __gsignals__ = { | 71 | __gsignals__ = { |
45 | 'build-started' : (gobject.SIGNAL_RUN_LAST, | 72 | 'build-started' : (gobject.SIGNAL_RUN_LAST, |
@@ -376,3 +403,41 @@ class RunningBuildTreeView (gtk.TreeView): | |||
376 | message = model.get(it, model.COL_MESSAGE)[0] | 403 | message = model.get(it, model.COL_MESSAGE)[0] |
377 | 404 | ||
378 | self._add_to_clipboard(message) | 405 | self._add_to_clipboard(message) |
406 | |||
407 | |||
408 | class BuildConfigurationTreeView(gtk.TreeView): | ||
409 | |||
410 | def __init__ (self): | ||
411 | gtk.TreeView.__init__(self) | ||
412 | self.set_rules_hint(False) | ||
413 | self.set_headers_visible(False) | ||
414 | self.set_property("hover-expand", True) | ||
415 | self.get_selection().set_mode(gtk.SELECTION_SINGLE) | ||
416 | |||
417 | # The message of the build. | ||
418 | self.message_renderer = gtk.CellRendererText () | ||
419 | self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR) | ||
420 | font = self.get_style().font_desc | ||
421 | font.set_size(pango.SCALE * 13) | ||
422 | self.message_renderer.set_property('font-desc', font) | ||
423 | self.append_column (self.message_column) | ||
424 | |||
425 | |||
426 | class BuildFailureTreeView(gtk.TreeView): | ||
427 | |||
428 | def __init__ (self): | ||
429 | gtk.TreeView.__init__(self) | ||
430 | self.set_rules_hint(False) | ||
431 | self.set_headers_visible(False) | ||
432 | self.get_selection().set_mode(gtk.SELECTION_SINGLE) | ||
433 | |||
434 | # The icon that indicates whether we're building or failed. | ||
435 | renderer = gtk.CellRendererPixbuf () | ||
436 | col = gtk.TreeViewColumn ("Status", renderer) | ||
437 | col.add_attribute (renderer, "icon-name", RunningBuildModel.COL_ICON) | ||
438 | self.append_column (col) | ||
439 | |||
440 | # The message of the build. | ||
441 | self.message_renderer = gtk.CellRendererText () | ||
442 | self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR) | ||
443 | self.append_column (self.message_column) | ||