From 656f9a07588cc00704825a78de9649ca4a1552b8 Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Mon, 28 Nov 2011 14:32:40 +0800 Subject: 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 Signed-off-by: Shane Wang Signed-off-by: Liming An Signed-off-by: Fengxia Hua Designed-by: Belen Barros Pena Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/progressbar.py | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bitbake/lib/bb/ui/crumbs/progressbar.py (limited to 'bitbake/lib/bb/ui/crumbs/progressbar.py') 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 @@ +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2011 Intel Corporation +# +# Authored by Shane Wang +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import gtk +from bb.ui.crumbs.hobcolor import HobColors + +class HobProgressBar (gtk.ProgressBar): + def __init__(self): + gtk.ProgressBar.__init__(self) + self.set_rcstyle(True) + self.percentage = 0 + + def set_rcstyle(self, status): + rcstyle = gtk.RcStyle() + rcstyle.fg[2] = gtk.gdk.Color(HobColors.BLACK) + if status: + rcstyle.bg[3] = gtk.gdk.Color(HobColors.RUNNING) + else: + rcstyle.bg[3] = gtk.gdk.Color(HobColors.ERROR) + self.modify_style(rcstyle) + + def set_title(self, text=None): + if not text: + text = "" + text += " %.0f%%" % self.percentage + self.set_text(text) + + def reset(self): + self.set_fraction(0) + self.set_text("") + self.set_rcstyle(True) + self.percentage = 0 + + def update(self, fraction): + self.percentage = int(fraction * 100) + self.set_fraction(fraction) -- cgit v1.2.3-54-g00ecf