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/builddetailspage.py | 110 +++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 bitbake/lib/bb/ui/crumbs/builddetailspage.py (limited to 'bitbake/lib/bb/ui/crumbs/builddetailspage.py') diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py new file mode 100755 index 0000000000..941f1e30b3 --- /dev/null +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2012 Intel Corporation +# +# Authored by Dongxiao Xu +# 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.progressbar import HobProgressBar +from bb.ui.crumbs.hobwidget import hic +from bb.ui.crumbs.runningbuild import RunningBuildTreeView +from bb.ui.crumbs.hobpages import HobPage + +# +# BuildDetailsPage +# + +class BuildDetailsPage (HobPage): + + def __init__(self, builder): + super(BuildDetailsPage, self).__init__(builder, "Building ...") + + # create visual elements + self.create_visual_elements() + + def create_visual_elements(self): + # create visual elements + self.vbox = gtk.VBox(False, 15) + + self.progress_box = gtk.HBox(False, 5) + self.progress_bar = HobProgressBar() + self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) + self.stop_button = gtk.LinkButton("Stop the build process", "Stop") + self.stop_button.connect("clicked", self.stop_button_clicked_cb) + self.progress_box.pack_end(self.stop_button, expand=False, fill=False) + + self.build_tv = RunningBuildTreeView(readonly=True) + self.build_tv.set_model(self.builder.handler.build.model) + self.scrolled_view = gtk.ScrolledWindow () + self.scrolled_view.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.scrolled_view.add(self.build_tv) + + self.button_box = gtk.HBox(False, 5) + self.back_button = gtk.LinkButton("Go back to Image Configuration screen", "<< Back to image configuration") + self.back_button.connect("clicked", self.back_button_clicked_cb) + self.button_box.pack_start(self.back_button, expand=False, fill=False) + + def _remove_all_widget(self): + children = self.vbox.get_children() or [] + for child in children: + self.vbox.remove(child) + children = self.box_group_area.get_children() or [] + for child in children: + self.box_group_area.remove(child) + children = self.get_children() or [] + for child in children: + self.remove(child) + + def show_page(self, step): + self._remove_all_widget() + if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: + self.title = "Building packages ..." + else: + self.title = "Building image ..." + self.build_details_top = self.add_onto_top_bar(None) + self.pack_start(self.build_details_top, expand=False, fill=False) + self.pack_start(self.group_align, expand=True, fill=True) + + self.box_group_area.pack_start(self.vbox, expand=True, fill=True) + + self.progress_bar.reset() + self.vbox.pack_start(self.progress_box, expand=False, fill=False) + + self.vbox.pack_start(self.scrolled_view, expand=True, fill=True) + + self.box_group_area.pack_end(self.button_box, expand=False, fill=False) + self.show_all() + self.back_button.hide() + + def update_progress_bar(self, title, fraction, status=True): + self.progress_bar.update(fraction) + self.progress_bar.set_title(title) + self.progress_bar.set_rcstyle(status) + + def back_button_clicked_cb(self, button): + self.builder.show_configuration() + + def show_back_button(self): + self.back_button.show() + + def stop_button_clicked_cb(self, button): + self.builder.stop_build() + + def hide_stop_button(self): + self.stop_button.hide() -- cgit v1.2.3-54-g00ecf