summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-07-16 13:33:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-06 13:02:26 +0100
commitc83f8185a851c02469fa3ce928049b056c56509b (patch)
tree775ac4f8dd1b4aba587eae106a42e03ed14af86c /bitbake/lib/bb
parent42a4f33fc0626897f0d9b23db53c42def7c2fbf8 (diff)
downloadpoky-c83f8185a851c02469fa3ce928049b056c56509b.tar.gz
bitbake: hob: implement the "retrieve image dialog" + changes to image combo box
Tha changes related to the image combo box are related to the action done in the retrieveImageDialog. When the user wants to select a customize image, but then he cancels the action, the combo box is set to --select a base image--. If the user selects an image using the new dialog, a new item with its name is added to the combo box list and then it is activated. [YOCTO #4193] (Bitbake rev: f25322de7e47719b31808397174e5c4f6d8649f2) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py1
-rw-r--r--bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py37
2 files changed, 35 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 3ddfb36a0c..86fdbfe9f7 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -520,6 +520,7 @@ class Builder(gtk.Window):
520 self.handler.generate_configuration() 520 self.handler.generate_configuration()
521 521
522 def initiate_new_build_async(self): 522 def initiate_new_build_async(self):
523 self.configuration.selected_image = None
523 self.switch_page(self.MACHINE_SELECTION) 524 self.switch_page(self.MACHINE_SELECTION)
524 self.handler.init_cooker() 525 self.handler.init_cooker()
525 self.handler.set_extra_inherit("image_types") 526 self.handler.set_extra_inherit("image_types")
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 3d86b6b431..e1211bc6d3 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -28,6 +28,7 @@ from bb.ui.crumbs.hobcolor import HobColors
28from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton 28from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton
29from bb.ui.crumbs.hoblistmodel import RecipeListModel 29from bb.ui.crumbs.hoblistmodel import RecipeListModel
30from bb.ui.crumbs.hobpages import HobPage 30from bb.ui.crumbs.hobpages import HobPage
31from bb.ui.crumbs.hig.retrieveimagedialog import RetrieveImageDialog
31 32
32# 33#
33# ImageConfigurationPage 34# ImageConfigurationPage
@@ -48,6 +49,7 @@ class ImageConfigurationPage (HobPage):
48 self.machine_combo_changed_by_manual = True 49 self.machine_combo_changed_by_manual = True
49 self.stopping = False 50 self.stopping = False
50 self.warning_shift = 0 51 self.warning_shift = 0
52 self.custom_image_selected = None
51 self.create_visual_elements() 53 self.create_visual_elements()
52 54
53 def create_visual_elements(self): 55 def create_visual_elements(self):
@@ -366,8 +368,28 @@ class ImageConfigurationPage (HobPage):
366 self.builder.window_sensitive(False) 368 self.builder.window_sensitive(False)
367 selected_image = self.image_combo.get_active_text() 369 selected_image = self.image_combo.get_active_text()
368 if selected_image == self.__custom_image__: 370 if selected_image == self.__custom_image__:
369 return 371 topdir = self.builder.get_topdir()
372 images_dir = topdir + "/recipes/images/"
373 self.builder.ensure_dir(images_dir)
374
375 dialog = RetrieveImageDialog(images_dir, "Select from my image recipes",
376 self.builder, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
377 response = dialog.run()
378 if response == gtk.RESPONSE_OK:
379 image_name = dialog.get_filename()
380 head, tail = os.path.split(image_name)
381 selected_image = os.path.splitext(tail)[0]
382 self.custom_image_selected = selected_image
383 self.update_image_combo(self.builder.recipe_model, selected_image)
384 else:
385 selected_image = self.__dummy_image__
386 self.update_image_combo(self.builder.recipe_model, None)
387 dialog.destroy()
388
370 if not selected_image or (selected_image == self.__dummy_image__): 389 if not selected_image or (selected_image == self.__dummy_image__):
390 self.builder.window_sensitive(True)
391 self.just_bake_button.hide()
392 self.edit_image_button.hide()
371 return 393 return
372 394
373 # remove __dummy_image__ item from the store list after first user selection 395 # remove __dummy_image__ item from the store list after first user selection
@@ -436,6 +458,7 @@ class ImageConfigurationPage (HobPage):
436 self.image_combo.append_text(self.__custom_image__) 458 self.image_combo.append_text(self.__custom_image__)
437 self.image_combo.append_text(self.builder.recipe_model.__custom_image__) 459 self.image_combo.append_text(self.builder.recipe_model.__custom_image__)
438 self.image_combo.append_text("--Separator--") 460 self.image_combo.append_text("--Separator--")
461 cnt = cnt + 3
439 462
440 topdir = self.builder.get_topdir() 463 topdir = self.builder.get_topdir()
441 # append and set active 464 # append and set active
@@ -471,6 +494,14 @@ class ImageConfigurationPage (HobPage):
471 active = cnt 494 active = cnt
472 cnt = cnt + 1 495 cnt = cnt + 1
473 496
497 if self.custom_image_selected:
498 self.image_combo.append_text("--Separator--")
499 cnt = cnt + 1
500 self.image_combo.append_text(self.custom_image_selected)
501 if self.custom_image_selected == selected_image:
502 active = cnt
503 cnt = cnt + 1
504
474 if selected_image == self.builder.recipe_model.__custom_image__: 505 if selected_image == self.builder.recipe_model.__custom_image__:
475 active = cnt 506 active = cnt
476 507
@@ -484,14 +515,14 @@ class ImageConfigurationPage (HobPage):
484 def layer_button_clicked_cb(self, button): 515 def layer_button_clicked_cb(self, button):
485 # Create a layer selection dialog 516 # Create a layer selection dialog
486 self.builder.show_layer_selection_dialog() 517 self.builder.show_layer_selection_dialog()
487 518
488 def view_adv_configuration_button_clicked_cb(self, button): 519 def view_adv_configuration_button_clicked_cb(self, button):
489 # Create an advanced settings dialog 520 # Create an advanced settings dialog
490 response, settings_changed = self.builder.show_adv_settings_dialog() 521 response, settings_changed = self.builder.show_adv_settings_dialog()
491 if not response: 522 if not response:
492 return 523 return
493 if settings_changed: 524 if settings_changed:
494 self.builder.reparse_post_adv_settings() 525 self.builder.reparse_post_adv_settings()
495 526
496 def just_bake_button_clicked_cb(self, button): 527 def just_bake_button_clicked_cb(self, button):
497 self.builder.parsing_warnings = [] 528 self.builder.parsing_warnings = []