diff options
author | Shane Wang <shane.wang@intel.com> | 2012-03-12 20:55:44 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-20 15:21:33 +0000 |
commit | dab638e150fb2af56f54f0752383965b016f4960 (patch) | |
tree | a36c1ba628b33db08fd6e3241661823557616543 /bitbake | |
parent | c4017bc518d31b58e988d4b51ea9e0a33acf9bc9 (diff) | |
download | poky-dab638e150fb2af56f54f0752383965b016f4960.tar.gz |
Hob: show indicators on the tabs of the Hob notebook
This patch is to show the indicators (e.g., the number of the issues) in the build details page to highlight.
(From Poky rev: 2e08a8e6818b8f1df7eaac499ebc3a5854efe7be)
(Bitbake rev: f2eead1bc20c48b2f36e880a879a5a50e6e6567b)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@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 | 10 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 5 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 14 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 4 |
4 files changed, 33 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index 63d2c7b329..7a5cfe67ff 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py | |||
@@ -37,6 +37,8 @@ class BuildDetailsPage (HobPage): | |||
37 | def __init__(self, builder): | 37 | def __init__(self, builder): |
38 | super(BuildDetailsPage, self).__init__(builder, "Building ...") | 38 | super(BuildDetailsPage, self).__init__(builder, "Building ...") |
39 | 39 | ||
40 | self.num_of_issues = 0 | ||
41 | |||
40 | # create visual elements | 42 | # create visual elements |
41 | self.create_visual_elements() | 43 | self.create_visual_elements() |
42 | 44 | ||
@@ -80,6 +82,14 @@ class BuildDetailsPage (HobPage): | |||
80 | self.back_button.connect("clicked", self.back_button_clicked_cb) | 82 | self.back_button.connect("clicked", self.back_button_clicked_cb) |
81 | self.button_box.pack_start(self.back_button, expand=False, fill=False) | 83 | self.button_box.pack_start(self.back_button, expand=False, fill=False) |
82 | 84 | ||
85 | def show_issues(self): | ||
86 | self.num_of_issues += 1 | ||
87 | self.notebook.show_indicator_icon("Issues", self.num_of_issues) | ||
88 | |||
89 | def reset_issues(self): | ||
90 | self.num_of_issues = 0 | ||
91 | self.notebook.hide_indicator_icon("Issues") | ||
92 | |||
83 | def _remove_all_widget(self): | 93 | def _remove_all_widget(self): |
84 | children = self.vbox.get_children() or [] | 94 | children = self.vbox.get_children() or [] |
85 | for child in children: | 95 | for child in children: |
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 1d255acd25..318bcbf9ae 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -212,6 +212,7 @@ class Builder(gtk.Window): | |||
212 | self.handler.build.connect("build-succeeded", self.handler_build_succeeded_cb) | 212 | self.handler.build.connect("build-succeeded", self.handler_build_succeeded_cb) |
213 | self.handler.build.connect("build-failed", self.handler_build_failed_cb) | 213 | self.handler.build.connect("build-failed", self.handler_build_failed_cb) |
214 | self.handler.build.connect("task-started", self.handler_task_started_cb) | 214 | self.handler.build.connect("task-started", self.handler_task_started_cb) |
215 | self.handler.build.connect("log-error", self.handler_build_failure_cb) | ||
215 | self.handler.connect("generating-data", self.handler_generating_data_cb) | 216 | self.handler.connect("generating-data", self.handler_generating_data_cb) |
216 | self.handler.connect("data-generated", self.handler_data_generated_cb) | 217 | self.handler.connect("data-generated", self.handler_data_generated_cb) |
217 | self.handler.connect("command-succeeded", self.handler_command_succeeded_cb) | 218 | self.handler.connect("command-succeeded", self.handler_command_succeeded_cb) |
@@ -533,6 +534,7 @@ class Builder(gtk.Window): | |||
533 | elif self.current_step == self.PACKAGE_GENERATING: | 534 | elif self.current_step == self.PACKAGE_GENERATING: |
534 | fraction = 0 | 535 | fraction = 0 |
535 | self.build_details_page.update_progress_bar("Build Started: ", fraction) | 536 | self.build_details_page.update_progress_bar("Build Started: ", fraction) |
537 | self.build_details_page.reset_issues() | ||
536 | 538 | ||
537 | def build_succeeded(self): | 539 | def build_succeeded(self): |
538 | if self.current_step == self.FAST_IMAGE_GENERATING: | 540 | if self.current_step == self.FAST_IMAGE_GENERATING: |
@@ -600,6 +602,9 @@ class Builder(gtk.Window): | |||
600 | fraction = 0.2 + 0.8 * fraction | 602 | fraction = 0.2 + 0.8 * fraction |
601 | self.build_details_page.update_progress_bar(title + ": ", fraction) | 603 | self.build_details_page.update_progress_bar(title + ": ", fraction) |
602 | 604 | ||
605 | def handler_build_failure_cb(self, running_build): | ||
606 | self.build_details_page.show_issues() | ||
607 | |||
603 | def destroy_window_cb(self, widget, event): | 608 | def destroy_window_cb(self, widget, event): |
604 | lbl = "<b>Do you really want to exit the Hob image creator?</b>" | 609 | lbl = "<b>Do you really want to exit the Hob image creator?</b>" |
605 | dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO) | 610 | dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO) |
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 8fa663c78a..2c3d8311d1 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
@@ -619,6 +619,20 @@ class HobNotebook(gtk.VBox): | |||
619 | 619 | ||
620 | self.tb.show() | 620 | self.tb.show() |
621 | 621 | ||
622 | def show_indicator_icon(self, title, number): | ||
623 | for i, child in enumerate(self.tabbar.children): | ||
624 | if child["toggled_page"] == -1: | ||
625 | continue | ||
626 | if child["title"] == title: | ||
627 | self.tabbar.show_indicator_icon(i, number) | ||
628 | |||
629 | def hide_indicator_icon(self, title): | ||
630 | for i, child in enumerate(self.tabbar.children): | ||
631 | if child["toggled_page"] == -1: | ||
632 | continue | ||
633 | if child["title"] == title: | ||
634 | self.tabbar.hide_indicator_icon(i) | ||
635 | |||
622 | def tab_switched_cb(self, widget, page): | 636 | def tab_switched_cb(self, widget, page): |
623 | self.notebook.set_current_page(page) | 637 | self.notebook.set_current_page(page) |
624 | 638 | ||
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 6e6aac9855..7343a29caf 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -84,6 +84,9 @@ class RunningBuild (gobject.GObject): | |||
84 | 'task-started' : (gobject.SIGNAL_RUN_LAST, | 84 | 'task-started' : (gobject.SIGNAL_RUN_LAST, |
85 | gobject.TYPE_NONE, | 85 | gobject.TYPE_NONE, |
86 | (gobject.TYPE_PYOBJECT,)), | 86 | (gobject.TYPE_PYOBJECT,)), |
87 | 'log-error' : (gobject.SIGNAL_RUN_LAST, | ||
88 | gobject.TYPE_NONE, | ||
89 | ()), | ||
87 | } | 90 | } |
88 | pids_to_task = {} | 91 | pids_to_task = {} |
89 | tasks_to_iter = {} | 92 | tasks_to_iter = {} |
@@ -134,6 +137,7 @@ class RunningBuild (gobject.GObject): | |||
134 | if event.levelno >= logging.ERROR: | 137 | if event.levelno >= logging.ERROR: |
135 | icon = "dialog-error" | 138 | icon = "dialog-error" |
136 | color = HobColors.ERROR | 139 | color = HobColors.ERROR |
140 | self.emit("log-error") | ||
137 | elif event.levelno >= logging.WARNING: | 141 | elif event.levelno >= logging.WARNING: |
138 | icon = "dialog-warning" | 142 | icon = "dialog-warning" |
139 | color = HobColors.WARNING | 143 | color = HobColors.WARNING |