diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2011-11-28 14:32:40 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-24 18:04:27 +0000 |
commit | 656f9a07588cc00704825a78de9649ca4a1552b8 (patch) | |
tree | 653c7941689599994d5876162c540fb7ee22736e /bitbake/lib/bb/ui/crumbs/progressbar.py | |
parent | 14df6d53b6856ec78322b9c0ef01e26c0406fe28 (diff) | |
download | poky-656f9a07588cc00704825a78de9649ca4a1552b8.tar.gz |
Hob: A new implemetation (v2)
This commit implements a new design for hob
Some of the new features:
- Friendly new designed GUI. Quick response to user actions.
- Two step builds support package generation and image generation.
- Support running GUI seprarately from bitbake server.
- Recipe/package selection and deselection.
- Accurate customization for image contents and size.
- Progress bars showing the parsing and build status.
- Load/save user configurations from/into templates.
(Bitbake rev: 4dacd29f9c957d20f4583330b51e5420f9c3338d)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Fengxia Hua <fengxia.hua@intel.com>
Designed-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/progressbar.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/progressbar.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/progressbar.py b/bitbake/lib/bb/ui/crumbs/progressbar.py new file mode 100644 index 0000000000..882d461711 --- /dev/null +++ b/bitbake/lib/bb/ui/crumbs/progressbar.py | |||
@@ -0,0 +1,52 @@ | |||
1 | # BitBake Graphical GTK User Interface | ||
2 | # | ||
3 | # Copyright (C) 2011 Intel Corporation | ||
4 | # | ||
5 | # Authored by Shane Wang <shane.wang@intel.com> | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | |||
20 | import gtk | ||
21 | from bb.ui.crumbs.hobcolor import HobColors | ||
22 | |||
23 | class HobProgressBar (gtk.ProgressBar): | ||
24 | def __init__(self): | ||
25 | gtk.ProgressBar.__init__(self) | ||
26 | self.set_rcstyle(True) | ||
27 | self.percentage = 0 | ||
28 | |||
29 | def set_rcstyle(self, status): | ||
30 | rcstyle = gtk.RcStyle() | ||
31 | rcstyle.fg[2] = gtk.gdk.Color(HobColors.BLACK) | ||
32 | if status: | ||
33 | rcstyle.bg[3] = gtk.gdk.Color(HobColors.RUNNING) | ||
34 | else: | ||
35 | rcstyle.bg[3] = gtk.gdk.Color(HobColors.ERROR) | ||
36 | self.modify_style(rcstyle) | ||
37 | |||
38 | def set_title(self, text=None): | ||
39 | if not text: | ||
40 | text = "" | ||
41 | text += " %.0f%%" % self.percentage | ||
42 | self.set_text(text) | ||
43 | |||
44 | def reset(self): | ||
45 | self.set_fraction(0) | ||
46 | self.set_text("") | ||
47 | self.set_rcstyle(True) | ||
48 | self.percentage = 0 | ||
49 | |||
50 | def update(self, fraction): | ||
51 | self.percentage = int(fraction * 100) | ||
52 | self.set_fraction(fraction) | ||