diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2012-09-18 18:15:55 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-20 12:05:15 +0100 |
commit | c0c04a5404c15b6556a29b7dad16e44f7761cafe (patch) | |
tree | 19920ee2d3c22a2916b09f0a62f2bac95cb1c662 /bitbake/lib/bb/ui/crumbs/builddetailspage.py | |
parent | f77488e5650b816f8bbdd53c1da525ffa88ee6f0 (diff) | |
download | poky-c0c04a5404c15b6556a29b7dad16e44f7761cafe.tar.gz |
bitbake: hob: add a top bar when building process is stopped
When a build was stopped, it wasn't obvious what to do next.
Now, on the page it appers a top bar with 3 buttons: "edit image",
"open log", "build new image"
[YOCTO #2537]
(Bitbake rev: a6afd15b7a40919313e26777b514ae44b587a0f6)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builddetailspage.py')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builddetailspage.py | 76 |
1 files changed, 72 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index 8d76ade6a4..85f65b7e7f 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py | |||
@@ -238,7 +238,7 @@ class BuildDetailsPage (HobPage): | |||
238 | open_log_button = HobAltButton("Open log") | 238 | open_log_button = HobAltButton("Open log") |
239 | open_log_button.set_relief(gtk.RELIEF_HALF) | 239 | open_log_button.set_relief(gtk.RELIEF_HALF) |
240 | open_log_button.set_tooltip_text("Open the build's log file") | 240 | open_log_button.set_tooltip_text("Open the build's log file") |
241 | open_log_button.connect('clicked', self.failure_open_log_button_clicked_cb, log_file) | 241 | open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) |
242 | build_fail_tab.attach(open_log_button, 14, 23, 9, 12) | 242 | build_fail_tab.attach(open_log_button, 14, 23, 9, 12) |
243 | 243 | ||
244 | attach_pos = (24 if log_file else 14) | 244 | attach_pos = (24 if log_file else 14) |
@@ -250,11 +250,11 @@ class BuildDetailsPage (HobPage): | |||
250 | 250 | ||
251 | return build_fail_top | 251 | return build_fail_top |
252 | 252 | ||
253 | def show_fail_page(self, title, action_names): | 253 | def show_fail_page(self, title): |
254 | self._remove_all_widget() | 254 | self._remove_all_widget() |
255 | self.title = "Hob cannot build your %s" % title | 255 | self.title = "Hob cannot build your %s" % title |
256 | 256 | ||
257 | self.build_fail_bar = self.add_build_fail_top_bar(action_names, self.builder.current_logfile) | 257 | self.build_fail_bar = self.add_build_fail_top_bar(title, self.builder.current_logfile) |
258 | 258 | ||
259 | self.pack_start(self.group_align, expand=True, fill=True) | 259 | self.pack_start(self.group_align, expand=True, fill=True) |
260 | self.box_group_area.pack_start(self.build_fail_bar, expand=False, fill=False) | 260 | self.box_group_area.pack_start(self.build_fail_bar, expand=False, fill=False) |
@@ -266,6 +266,63 @@ class BuildDetailsPage (HobPage): | |||
266 | self.show_all() | 266 | self.show_all() |
267 | self.back_button.hide() | 267 | self.back_button.hide() |
268 | 268 | ||
269 | def add_build_stop_top_bar(self, action, log_file=None): | ||
270 | color = HobColors.LIGHT_GRAY | ||
271 | build_stop_top = gtk.EventBox() | ||
272 | build_stop_top.set_size_request(-1, 200) | ||
273 | build_stop_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) | ||
274 | build_stop_top.set_flags(gtk.CAN_DEFAULT) | ||
275 | build_stop_top.grab_default() | ||
276 | |||
277 | build_stop_tab = gtk.Table(11, 46, True) | ||
278 | build_stop_top.add(build_stop_tab) | ||
279 | |||
280 | icon = gtk.Image() | ||
281 | icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INFO_HOVER_FILE) | ||
282 | icon.set_from_pixbuf(icon_pix_buffer) | ||
283 | build_stop_tab.attach(icon, 1, 4, 0, 6) | ||
284 | |||
285 | label = gtk.Label() | ||
286 | label.set_alignment(0.0, 0.5) | ||
287 | label.set_markup("<span size='x-large'><b>%s</b></span>" % self.title) | ||
288 | build_stop_tab.attach(label, 4, 26, 0, 6) | ||
289 | |||
290 | action_button = HobButton("Edit %s" % action) | ||
291 | action_button.set_size_request(-1, 40) | ||
292 | action_button.set_tooltip_text("Edit the %s parameters" % action) | ||
293 | action_button.connect('clicked', self.stop_primary_action_button_clicked_cb, action) | ||
294 | build_stop_tab.attach(action_button, 4, 13, 6, 9) | ||
295 | |||
296 | if log_file: | ||
297 | open_log_button = HobAltButton("Open log") | ||
298 | open_log_button.set_relief(gtk.RELIEF_HALF) | ||
299 | open_log_button.set_tooltip_text("Open the build's log file") | ||
300 | open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) | ||
301 | build_stop_tab.attach(open_log_button, 14, 23, 6, 9) | ||
302 | |||
303 | attach_pos = (24 if log_file else 14) | ||
304 | build_button = HobAltButton("Build new image") | ||
305 | build_button.set_size_request(-1, 40) | ||
306 | build_button.set_tooltip_text("Create a new image from scratch") | ||
307 | build_button.connect('clicked', self.new_image_button_clicked_cb) | ||
308 | build_stop_tab.attach(build_button, attach_pos, attach_pos + 9, 6, 9) | ||
309 | |||
310 | return build_stop_top, action_button | ||
311 | |||
312 | def show_stop_page(self, action): | ||
313 | self._remove_all_widget() | ||
314 | self.title = "Build stopped" | ||
315 | self.build_stop_bar, action_button = self.add_build_stop_top_bar(action, self.builder.current_logfile) | ||
316 | |||
317 | self.pack_start(self.group_align, expand=True, fill=True) | ||
318 | self.box_group_area.pack_start(self.build_stop_bar, expand=False, fill=False) | ||
319 | self.box_group_area.pack_start(self.vbox, expand=True, fill=True) | ||
320 | |||
321 | self.vbox.pack_start(self.notebook, expand=True, fill=True) | ||
322 | self.show_all() | ||
323 | self.back_button.hide() | ||
324 | return action_button | ||
325 | |||
269 | def show_page(self, step): | 326 | def show_page(self, step): |
270 | self._remove_all_widget() | 327 | self._remove_all_widget() |
271 | if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: | 328 | if step == self.builder.PACKAGE_GENERATING or step == self.builder.FAST_IMAGE_GENERATING: |
@@ -299,6 +356,9 @@ class BuildDetailsPage (HobPage): | |||
299 | def back_button_clicked_cb(self, button): | 356 | def back_button_clicked_cb(self, button): |
300 | self.builder.show_configuration() | 357 | self.builder.show_configuration() |
301 | 358 | ||
359 | def new_image_button_clicked_cb(self, button): | ||
360 | self.builder.reset() | ||
361 | |||
302 | def show_back_button(self): | 362 | def show_back_button(self): |
303 | self.back_button.show() | 363 | self.back_button.show() |
304 | 364 | ||
@@ -328,7 +388,15 @@ class BuildDetailsPage (HobPage): | |||
328 | elif "Edit image configuration" in action: | 388 | elif "Edit image configuration" in action: |
329 | self.builder.show_configuration() | 389 | self.builder.show_configuration() |
330 | 390 | ||
331 | def failure_open_log_button_clicked_cb(self, button, log_file): | 391 | def stop_primary_action_button_clicked_cb(self, button, action): |
392 | if "recipes" in action: | ||
393 | self.builder.show_recipes() | ||
394 | elif "packages" in action: | ||
395 | self.builder.show_packages() | ||
396 | elif "image" in action: | ||
397 | self.builder.show_configuration() | ||
398 | |||
399 | def open_log_button_clicked_cb(self, button, log_file): | ||
332 | if log_file: | 400 | if log_file: |
333 | os.system("xdg-open /%s" % log_file) | 401 | os.system("xdg-open /%s" % log_file) |
334 | 402 | ||