From: Joshua Lock <josh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 03/12] Hob: show indicators on the tabs of the Hob notebook
Date: Mon, 19 Mar 2012 16:49:49 -0700 [thread overview]
Message-ID: <4F67C61D.9060903@linux.intel.com> (raw)
In-Reply-To: <8432d919ec2154295bd60cf608f83843ca030b1b.1331910234.git.shane.wang@intel.com>
On 16/03/12 08:10, Shane Wang wrote:
> This patch is to show the indicators (e.g., the number of the issues) in the build details page to highlight.
>
> Signed-off-by: Liming An<limingx.l.an@intel.com>
> Signed-off-by: Shane Wang<shane.wang@intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
> ---
> bitbake/lib/bb/ui/crumbs/builddetailspage.py | 10 ++++++++++
> bitbake/lib/bb/ui/crumbs/builder.py | 5 +++++
> bitbake/lib/bb/ui/crumbs/hobwidget.py | 14 ++++++++++++++
> 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 63d2c7b..7a5cfe6 100755
> --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> @@ -37,6 +37,8 @@ class BuildDetailsPage (HobPage):
> def __init__(self, builder):
> super(BuildDetailsPage, self).__init__(builder, "Building ...")
>
> + self.num_of_issues = 0
> +
> # create visual elements
> self.create_visual_elements()
>
> @@ -80,6 +82,14 @@ class BuildDetailsPage (HobPage):
> self.back_button.connect("clicked", self.back_button_clicked_cb)
> self.button_box.pack_start(self.back_button, expand=False, fill=False)
>
> + def show_issues(self):
> + self.num_of_issues += 1
> + self.notebook.show_indicator_icon("Issues", self.num_of_issues)
> +
> + def reset_issues(self):
> + self.num_of_issues = 0
> + self.notebook.hide_indicator_icon("Issues")
> +
> def _remove_all_widget(self):
> children = self.vbox.get_children() or []
> for child in children:
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
> index 1d255ac..318bcbf 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):
> self.handler.build.connect("build-succeeded", self.handler_build_succeeded_cb)
> self.handler.build.connect("build-failed", self.handler_build_failed_cb)
> self.handler.build.connect("task-started", self.handler_task_started_cb)
> + self.handler.build.connect("log-error", self.handler_build_failure_cb)
> self.handler.connect("generating-data", self.handler_generating_data_cb)
> self.handler.connect("data-generated", self.handler_data_generated_cb)
> self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
> @@ -533,6 +534,7 @@ class Builder(gtk.Window):
> elif self.current_step == self.PACKAGE_GENERATING:
> fraction = 0
> self.build_details_page.update_progress_bar("Build Started: ", fraction)
> + self.build_details_page.reset_issues()
>
> def build_succeeded(self):
> if self.current_step == self.FAST_IMAGE_GENERATING:
> @@ -600,6 +602,9 @@ class Builder(gtk.Window):
> fraction = 0.2 + 0.8 * fraction
> self.build_details_page.update_progress_bar(title + ": ", fraction)
>
> + def handler_build_failure_cb(self, running_build):
> + self.build_details_page.show_issues()
> +
> def destroy_window_cb(self, widget, event):
> lbl = "<b>Do you really want to exit the Hob image creator?</b>"
> 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 8fa663c..2c3d831 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):
>
> self.tb.show()
>
> + def show_indicator_icon(self, title, number):
> + for i, child in enumerate(self.tabbar.children):
> + if child["toggled_page"] == -1:
> + continue
> + if child["title"] == title:
> + self.tabbar.show_indicator_icon(i, number)
> +
> + def hide_indicator_icon(self, title):
> + for i, child in enumerate(self.tabbar.children):
> + if child["toggled_page"] == -1:
> + continue
> + if child["title"] == title:
> + self.tabbar.hide_indicator_icon(i)
> +
> def tab_switched_cb(self, widget, page):
> self.notebook.set_current_page(page)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
> index eedd8d9..ddac232 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):
> 'task-started' : (gobject.SIGNAL_RUN_LAST,
> gobject.TYPE_NONE,
> (gobject.TYPE_PYOBJECT,)),
> + 'log-error' : (gobject.SIGNAL_RUN_LAST,
> + gobject.TYPE_NONE,
> + ()),
> }
> pids_to_task = {}
> tasks_to_iter = {}
> @@ -134,6 +137,7 @@ class RunningBuild (gobject.GObject):
> if event.levelno>= logging.ERROR:
> icon = "dialog-error"
> color = HobColors.ERROR
> + self.emit("log-error")
> elif event.levelno>= logging.WARNING:
> icon = "dialog-warning"
> color = HobColors.WARNING
--
Joshua '贾詡' Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-03-19 23:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 15:10 [PATCH 00/12] [V3]Hob Notebook Implementation and Others Shane Wang
2012-03-16 15:10 ` [PATCH 01/12] Hob: implement a self-defined notebook visual component for Hob Shane Wang
2012-03-19 23:49 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 02/12] Hob: use HobNotebook to implement a notebook in build details page Shane Wang
2012-03-19 23:49 ` Joshua Lock
2012-03-20 13:44 ` Wang, Shane
2012-03-20 14:17 ` Wang, Shane
2012-03-16 15:10 ` [PATCH 03/12] Hob: show indicators on the tabs of the Hob notebook Shane Wang
2012-03-19 23:49 ` Joshua Lock [this message]
2012-03-16 15:10 ` [PATCH 04/12] Hob: change the code style to enumerate a list in a for-loop Shane Wang
2012-03-19 23:50 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 05/12] Hob: fix '!= None' and '== None' in the code Shane Wang
2012-03-19 23:51 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 06/12] Hob: allow users to setup the proxies Shane Wang
2012-03-19 23:51 ` Joshua Lock
2012-03-20 13:27 ` Wang, Shane
2012-03-26 17:38 ` Barros Pena, Belen
2012-03-16 15:10 ` [PATCH 07/12] Hob: remove the invalid code in hobwidget.py Shane Wang
2012-03-19 23:51 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 08/12] Hob: change the range dance in hobwidget make it like a pythonista Shane Wang
2012-03-19 23:57 ` Joshua Lock
2012-03-20 12:16 ` An, LimingX L
2012-03-16 15:10 ` [PATCH 09/12] Hob: fix static variable "self.search" to parameter "search" in signal callback function Shane Wang
2012-03-19 23:52 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 10/12] Hob: add auto adjust background area function for long issue text Shane Wang
2012-03-19 23:52 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 11/12] Hob: change HobNoteBook tab edge color from green to gray Shane Wang
2012-03-19 23:53 ` Joshua Lock
2012-03-16 15:10 ` [PATCH 12/12] Hob: per UI design add refresh icon for building log Shane Wang
2012-03-19 23:53 ` Joshua Lock
2012-03-20 13:04 ` An, LimingX L
2012-03-20 18:29 ` Joshua Lock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F67C61D.9060903@linux.intel.com \
--to=josh@linux.intel.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox