diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builddetailspage.py')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 110 |
1 files changed, 110 insertions, 0 deletions
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 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # | ||
3 | # BitBake Graphical GTK User Interface | ||
4 | # | ||
5 | # Copyright (C) 2012 Intel Corporation | ||
6 | # | ||
7 | # Authored by Dongxiao Xu <dongxiao.xu@intel.com> | ||
8 | # Authored by Shane Wang <shane.wang@intel.com> | ||
9 | # | ||
10 | # This program is free software; you can redistribute it and/or modify | ||
11 | # it under the terms of the GNU General Public License version 2 as | ||
12 | # published by the Free Software Foundation. | ||
13 | # | ||
14 | # This program is distributed in the hope that it will be useful, | ||
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | # GNU General Public License for more details. | ||
18 | # | ||
19 | # You should have received a copy of the GNU General Public License along | ||
20 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
22 | |||
23 | import gtk | ||
24 | from bb.ui.crumbs.progressbar import HobProgressBar | ||
25 | from bb.ui.crumbs.hobwidget import hic | ||
26 | from bb.ui.crumbs.runningbuild import RunningBuildTreeView | ||
27 | from bb.ui.crumbs.hobpages import HobPage | ||
28 | |||
29 | # | ||
30 | # BuildDetailsPage | ||
31 | # | ||
32 | |||
33 | class BuildDetailsPage (HobPage): | ||
34 | |||
35 | def __init__(self, builder): | ||
36 | super(BuildDetailsPage, self).__init__(builder, "Building ...") | ||
37 | |||
38 | # create visual elements | ||
39 | self.create_visual_elements() | ||
40 | |||
41 | def create_visual_elements(self): | ||
42 | # create visual elements | ||
43 | self.vbox = gtk.VBox(False, 15) | ||
44 | |||
45 | self.progress_box = gtk.HBox(False, 5) | ||
46 | self.progress_bar = HobProgressBar() | ||
47 | self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) | ||
48 | self.stop_button = gtk.LinkButton("Stop the build process", "Stop") | ||
49 | self.stop_button.connect("clicked", self.stop_button_clicked_cb) | ||
50 | self.progress_box.pack_end(self.stop_button, expand=False, fill=False) | ||
51 | |||
52 | self.build_tv = RunningBuildTreeView(readonly=True) | ||
53 | self.build_tv.set_model(self.builder.handler.build.model) | ||
54 | self.scrolled_view = gtk.ScrolledWindow () | ||
55 | self.scrolled_view.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) | ||
56 | self.scrolled_view.add(self.build_tv) | ||
57 | |||
58 | self.button_box = gtk.HBox(False, 5) | ||
59 | self.back_button = gtk.LinkButton("Go back to Image Configuration screen", "<< Back to image configuration") | ||
60 | self.back_button.connect("clicked", self.back_button_clicked_cb) | ||
61 | self.button_box.pack_start(self.back_button, expand=False, fill=False) | ||
62 | |||
63 | def _remove_all_widget(self): | ||
64 | children = self.vbox.get_children() or [] | ||
65 | for child in children: | ||
66 | self.vbox.remove(child) | ||
67 | children = self.box_group_area.get_children() or [] | ||
68 | for child in children: | ||
69 | self.box_group_area.remove(child) | ||
70 | children = self.get_children() or [] | ||
71 | for child in children: | ||
72 | self.remove(child) | ||
73 | |||
74 | def show_page(self, step): | ||
75 | self._remove_all_widget() | ||
76 | if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: | ||
77 | self.title = "Building packages ..." | ||
78 | else: | ||
79 | self.title = "Building image ..." | ||
80 | self.build_details_top = self.add_onto_top_bar(None) | ||
81 | self.pack_start(self.build_details_top, expand=False, fill=False) | ||
82 | self.pack_start(self.group_align, expand=True, fill=True) | ||
83 | |||
84 | self.box_group_area.pack_start(self.vbox, expand=True, fill=True) | ||
85 | |||
86 | self.progress_bar.reset() | ||
87 | self.vbox.pack_start(self.progress_box, expand=False, fill=False) | ||
88 | |||
89 | self.vbox.pack_start(self.scrolled_view, expand=True, fill=True) | ||
90 | |||
91 | self.box_group_area.pack_end(self.button_box, expand=False, fill=False) | ||
92 | self.show_all() | ||
93 | self.back_button.hide() | ||
94 | |||
95 | def update_progress_bar(self, title, fraction, status=True): | ||
96 | self.progress_bar.update(fraction) | ||
97 | self.progress_bar.set_title(title) | ||
98 | self.progress_bar.set_rcstyle(status) | ||
99 | |||
100 | def back_button_clicked_cb(self, button): | ||
101 | self.builder.show_configuration() | ||
102 | |||
103 | def show_back_button(self): | ||
104 | self.back_button.show() | ||
105 | |||
106 | def stop_button_clicked_cb(self, button): | ||
107 | self.builder.stop_build() | ||
108 | |||
109 | def hide_stop_button(self): | ||
110 | self.stop_button.hide() | ||