diff options
author | Liming An <limingx.l.an@intel.com> | 2012-03-27 23:15:45 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-28 16:49:19 +0100 |
commit | 7990d36f508a8eab4865b124045c02326680430d (patch) | |
tree | a8ff63d06580de07b4d31775ed3a8963bb09d241 /bitbake | |
parent | 26cce34e4dd0171d06407fb417577e67db3a5dc9 (diff) | |
download | poky-7990d36f508a8eab4865b124045c02326680430d.tar.gz |
Hob: fixed some not compatible places for make runningbuild.py can be reused by another application
The runningbuild.py has been shared by different applications, not only hob, so fixed the some not compatibled codes
(From Poky rev: 99fa7388500fa97fe4629456daa50bb5637e51e6)
(Bitbake rev: 23c13560fa76442c798058700863bd91491ca826)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 20 |
3 files changed, 20 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index db45fe8e77..e8dbad7ad1 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py | |||
@@ -150,7 +150,7 @@ class BuildDetailsPage (HobPage): | |||
150 | self.scrolled_view_failure.add(self.failure_tv) | 150 | self.scrolled_view_failure.add(self.failure_tv) |
151 | self.notebook.append_page(self.scrolled_view_failure, gtk.Label("Issues")) | 151 | self.notebook.append_page(self.scrolled_view_failure, gtk.Label("Issues")) |
152 | 152 | ||
153 | self.build_tv = RunningBuildTreeView(readonly=True) | 153 | self.build_tv = RunningBuildTreeView(readonly=True, hob=True) |
154 | self.build_tv.set_model(self.builder.handler.build.model) | 154 | self.build_tv.set_model(self.builder.handler.build.model) |
155 | self.scrolled_view_build = gtk.ScrolledWindow () | 155 | self.scrolled_view_build = gtk.ScrolledWindow () |
156 | self.scrolled_view_build.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) | 156 | self.scrolled_view_build.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS) |
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 22898fb273..89ff23e072 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
@@ -824,6 +824,7 @@ class HobIconChecker(hic): | |||
824 | ('hic-ok', 'gtk-ok', 'ok') : self.ICON_INDI_TICK_FILE, | 824 | ('hic-ok', 'gtk-ok', 'ok') : self.ICON_INDI_TICK_FILE, |
825 | ('hic-dialog-error', 'gtk-dialog-error', 'dialog-error') : self.ICON_INDI_ERROR_FILE, | 825 | ('hic-dialog-error', 'gtk-dialog-error', 'dialog-error') : self.ICON_INDI_ERROR_FILE, |
826 | ('hic-dialog-warning', 'gtk-dialog-warning', 'dialog-warning') : self.ICON_INDI_ALERT_FILE, | 826 | ('hic-dialog-warning', 'gtk-dialog-warning', 'dialog-warning') : self.ICON_INDI_ALERT_FILE, |
827 | ('hic-task-refresh', 'gtk-execute', 'execute') : self.ICON_INDI_REFRESH_FILE, | ||
827 | } | 828 | } |
828 | valid_stock_id = stock_name | 829 | valid_stock_id = stock_name |
829 | if stock_name: | 830 | if stock_name: |
@@ -924,9 +925,8 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf): | |||
924 | def __init__(self): | 925 | def __init__(self): |
925 | gtk.CellRendererPixbuf.__init__(self) | 926 | gtk.CellRendererPixbuf.__init__(self) |
926 | self.control = RefreshRuningController() | 927 | self.control = RefreshRuningController() |
927 | # create default refrensh stock icon | 928 | # add icon checker for make the gtk-icon transfer to hob-icon |
928 | self.checker = HobIconChecker() | 929 | self.checker = HobIconChecker() |
929 | self.checker.set_hob_icon_to_stock_icon(hic.ICON_INDI_REFRESH_FILE, "task-refresh") | ||
930 | 930 | ||
931 | def get_pixbuf_from_stock_icon(self, widget, stock_id="", size=gtk.ICON_SIZE_DIALOG): | 931 | def get_pixbuf_from_stock_icon(self, widget, stock_id="", size=gtk.ICON_SIZE_DIALOG): |
932 | if widget and stock_id and gtk.icon_factory_lookup_default(stock_id): | 932 | if widget and stock_id and gtk.icon_factory_lookup_default(stock_id): |
@@ -938,7 +938,7 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf): | |||
938 | if new_name and type(new_name) == str: | 938 | if new_name and type(new_name) == str: |
939 | # check the name is need to transfer to hob icon or not | 939 | # check the name is need to transfer to hob icon or not |
940 | name = self.checker.check_stock_icon(new_name) | 940 | name = self.checker.check_stock_icon(new_name) |
941 | if name.startswith("hic") or name.startswith("gtk") or name == "task-refresh": | 941 | if name.startswith("hic") or name.startswith("gtk"): |
942 | stock_id = name | 942 | stock_id = name |
943 | else: | 943 | else: |
944 | stock_id = 'gtk-' + name | 944 | stock_id = 'gtk-' + name |
@@ -946,7 +946,7 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf): | |||
946 | return stock_id | 946 | return stock_id |
947 | 947 | ||
948 | ''' render cell exactly, "icon-name" is priority | 948 | ''' render cell exactly, "icon-name" is priority |
949 | if use the 'task-refresh' will make the pix animation | 949 | if use the 'hic-task-refresh' will make the pix animation |
950 | if 'pix' will change the pixbuf for it from the pixbuf or image. | 950 | if 'pix' will change the pixbuf for it from the pixbuf or image. |
951 | ''' | 951 | ''' |
952 | def do_render(self, window, tree, background_area,cell_area, expose_area, flags): | 952 | def do_render(self, window, tree, background_area,cell_area, expose_area, flags): |
@@ -971,7 +971,7 @@ class HobCellRendererPixbuf(gtk.CellRendererPixbuf): | |||
971 | 971 | ||
972 | if stock_id: | 972 | if stock_id: |
973 | pix = self.get_pixbuf_from_stock_icon(tree, stock_id, self.props.stock_size) | 973 | pix = self.get_pixbuf_from_stock_icon(tree, stock_id, self.props.stock_size) |
974 | if stock_id == 'task-refresh': | 974 | if stock_id == 'hic-task-refresh': |
975 | self.control.append_running_cell_area(cell_area) | 975 | self.control.append_running_cell_area(cell_area) |
976 | if self.control.is_active(): | 976 | if self.control.is_active(): |
977 | self.control.on_draw_cb(pix, window.cairo_create(), x, y, w, h, True) | 977 | self.control.on_draw_cb(pix, window.cairo_create(), x, y, w, h, True) |
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 102cc7dc86..8d1f4e1cb9 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -56,7 +56,7 @@ class RunningBuildModel (gtk.TreeStore): | |||
56 | return model | 56 | return model |
57 | 57 | ||
58 | def foreach_cell_func(self, model, path, iter, usr_data=None): | 58 | def foreach_cell_func(self, model, path, iter, usr_data=None): |
59 | if model.get_value(iter, self.COL_ICON) == "task-refresh": | 59 | if model.get_value(iter, self.COL_ICON) == "gtk-execute": |
60 | model.set(iter, self.COL_ICON, "") | 60 | model.set(iter, self.COL_ICON, "") |
61 | 61 | ||
62 | def close_task_refresh(self): | 62 | def close_task_refresh(self): |
@@ -183,7 +183,7 @@ class RunningBuild (gobject.GObject): | |||
183 | # Because this parent package now has an active child mark it as | 183 | # Because this parent package now has an active child mark it as |
184 | # such. | 184 | # such. |
185 | # @todo if parent is already in error, don't mark it green | 185 | # @todo if parent is already in error, don't mark it green |
186 | self.model.set(parent, self.model.COL_ICON, "task-refresh", | 186 | self.model.set(parent, self.model.COL_ICON, "gtk-execute", |
187 | self.model.COL_COLOR, HobColors.RUNNING) | 187 | self.model.COL_COLOR, HobColors.RUNNING) |
188 | 188 | ||
189 | # Add an entry in the model for this task | 189 | # Add an entry in the model for this task |
@@ -191,7 +191,7 @@ class RunningBuild (gobject.GObject): | |||
191 | package, | 191 | package, |
192 | task, | 192 | task, |
193 | "Task: %s" % (task), | 193 | "Task: %s" % (task), |
194 | "task-refresh", | 194 | "gtk-execute", |
195 | HobColors.RUNNING, | 195 | HobColors.RUNNING, |
196 | 0)) | 196 | 0)) |
197 | 197 | ||
@@ -339,18 +339,26 @@ class RunningBuildTreeView (gtk.TreeView): | |||
339 | __gsignals__ = { | 339 | __gsignals__ = { |
340 | "button_press_event" : "override" | 340 | "button_press_event" : "override" |
341 | } | 341 | } |
342 | def __init__ (self, readonly=False): | 342 | def __init__ (self, readonly=False, hob=False): |
343 | gtk.TreeView.__init__ (self) | 343 | gtk.TreeView.__init__ (self) |
344 | self.readonly = readonly | 344 | self.readonly = readonly |
345 | 345 | ||
346 | # The icon that indicates whether we're building or failed. | 346 | # The icon that indicates whether we're building or failed. |
347 | renderer = HobCellRendererPixbuf () | 347 | # add 'hob' flag because there has not only hob to share this code |
348 | if hob: | ||
349 | renderer = HobCellRendererPixbuf () | ||
350 | else: | ||
351 | renderer = gtk.CellRendererPixbuf() | ||
348 | col = gtk.TreeViewColumn ("Status", renderer) | 352 | col = gtk.TreeViewColumn ("Status", renderer) |
349 | col.add_attribute (renderer, "icon-name", 4) | 353 | col.add_attribute (renderer, "icon-name", 4) |
350 | self.append_column (col) | 354 | self.append_column (col) |
351 | 355 | ||
352 | # The message of the build. | 356 | # The message of the build. |
353 | self.message_renderer = HobWarpCellRendererText (col_number=1) | 357 | # add 'hob' flag because there has not only hob to share this code |
358 | if hob: | ||
359 | self.message_renderer = HobWarpCellRendererText (col_number=1) | ||
360 | else: | ||
361 | self.message_renderer = gtk.CellRendererText () | ||
354 | self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=3) | 362 | self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=3) |
355 | self.message_column.add_attribute(self.message_renderer, 'background', 5) | 363 | self.message_column.add_attribute(self.message_renderer, 'background', 5) |
356 | self.message_renderer.set_property('editable', (not self.readonly)) | 364 | self.message_renderer.set_property('editable', (not self.readonly)) |