summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Wang <shane.wang@intel.com>2012-03-29 00:10:30 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-29 21:12:56 +0100
commitff4387370667cdb5a7ac0c94732fa7e7e022b893 (patch)
treea721bb0e9eaec664911191201036649795650c28
parent3038c0c65d87ebeddd009f1929752585b83cb2c1 (diff)
downloadpoky-ff4387370667cdb5a7ac0c94732fa7e7e022b893.tar.gz
Hob: add Templates and Settings on image details screen
This patch is to add Templates and Settings tool buttons on the image details screen, which makes things easier and simplier. In order to fulfill that, the code splits the functions show_load_template_dialog() and show_adv_settings_dialog() in builder.py because they will possibly be called from different screens later. [Yocto #2163] (Bitbake rev: 29bea7b7076a7b74d36237da86a4eff6605d17ec) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py19
-rw-r--r--bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py12
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py29
3 files changed, 51 insertions, 9 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 2af14dc6ef..1a06dd741a 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -757,10 +757,11 @@ class Builder(gtk.Window):
757 dialog.add_filter(filter) 757 dialog.add_filter(filter)
758 758
759 response = dialog.run() 759 response = dialog.run()
760 path = None
760 if response == gtk.RESPONSE_YES: 761 if response == gtk.RESPONSE_YES:
761 path = dialog.get_filename() 762 path = dialog.get_filename()
762 self.load_template(path)
763 dialog.destroy() 763 dialog.destroy()
764 return response == gtk.RESPONSE_YES, path
764 765
765 def show_save_template_dialog(self): 766 def show_save_template_dialog(self):
766 dialog = gtk.FileChooserDialog("Save Template Files", self, 767 dialog = gtk.FileChooserDialog("Save Template Files", self,
@@ -820,16 +821,20 @@ class Builder(gtk.Window):
820 button = dialog.add_button("Save", gtk.RESPONSE_YES) 821 button = dialog.add_button("Save", gtk.RESPONSE_YES)
821 HobButton.style_button(button) 822 HobButton.style_button(button)
822 response = dialog.run() 823 response = dialog.run()
824 settings_changed = False
823 if response == gtk.RESPONSE_YES: 825 if response == gtk.RESPONSE_YES:
824 self.parameters.enable_proxy = dialog.enable_proxy 826 self.parameters.enable_proxy = dialog.enable_proxy
825 self.configuration = dialog.configuration 827 self.configuration = dialog.configuration
826 # DO reparse recipes 828 settings_changed = dialog.settings_changed
827 if dialog.settings_changed:
828 if self.configuration.curr_mach == "":
829 self.switch_page(self.MACHINE_SELECTION)
830 else:
831 self.switch_page(self.RCPPKGINFO_POPULATING)
832 dialog.destroy() 829 dialog.destroy()
830 return response == gtk.RESPONSE_YES, settings_changed
831
832 def reparse_post_adv_settings(self):
833 # DO reparse recipes
834 if self.configuration.curr_mach == "":
835 self.switch_page(self.MACHINE_SELECTION)
836 else:
837 self.switch_page(self.RCPPKGINFO_POPULATING)
833 838
834 def deploy_image(self, image_name): 839 def deploy_image(self, image_name):
835 if not image_name: 840 if not image_name:
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index d7437a9925..9ad1ea43d5 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -360,11 +360,19 @@ class ImageConfigurationPage (HobPage):
360 self.builder.build_packages() 360 self.builder.build_packages()
361 361
362 def template_button_clicked_cb(self, button): 362 def template_button_clicked_cb(self, button):
363 self.builder.show_load_template_dialog() 363 response, path = self.builder.show_load_template_dialog()
364 if not response:
365 return
366 if path:
367 self.builder.load_template(path)
364 368
365 def my_images_button_clicked_cb(self, button): 369 def my_images_button_clicked_cb(self, button):
366 self.builder.show_load_my_images_dialog() 370 self.builder.show_load_my_images_dialog()
367 371
368 def settings_button_clicked_cb(self, button): 372 def settings_button_clicked_cb(self, button):
369 # Create an advanced settings dialog 373 # Create an advanced settings dialog
370 self.builder.show_adv_settings_dialog() 374 response, settings_changed = self.builder.show_adv_settings_dialog()
375 if not response:
376 return
377 if settings_changed:
378 self.builder.reparse_post_adv_settings()
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 7d06124048..f15aad30a5 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -122,12 +122,24 @@ class ImageDetailsPage (HobPage):
122 self.toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL) 122 self.toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
123 self.toolbar.set_style(gtk.TOOLBAR_BOTH) 123 self.toolbar.set_style(gtk.TOOLBAR_BOTH)
124 124
125 template_button = self.append_toolbar_button(self.toolbar,
126 "Templates",
127 hic.ICON_TEMPLATES_DISPLAY_FILE,
128 hic.ICON_TEMPLATES_HOVER_FILE,
129 "Load a hob building template saved before",
130 self.template_button_clicked_cb)
125 my_images_button = self.append_toolbar_button(self.toolbar, 131 my_images_button = self.append_toolbar_button(self.toolbar,
126 "My images", 132 "My images",
127 hic.ICON_IMAGES_DISPLAY_FILE, 133 hic.ICON_IMAGES_DISPLAY_FILE,
128 hic.ICON_IMAGES_HOVER_FILE, 134 hic.ICON_IMAGES_HOVER_FILE,
129 "Open images built out previously for running or deployment", 135 "Open images built out previously for running or deployment",
130 self.my_images_button_clicked_cb) 136 self.my_images_button_clicked_cb)
137 settings_button = self.append_toolbar_button(self.toolbar,
138 "Settings",
139 hic.ICON_SETTINGS_DISPLAY_FILE,
140 hic.ICON_SETTINGS_HOVER_FILE,
141 "Other advanced settings for build",
142 self.settings_button_clicked_cb)
131 143
132 self.details_top_buttons = self.add_onto_top_bar(self.toolbar) 144 self.details_top_buttons = self.add_onto_top_bar(self.toolbar)
133 145
@@ -386,5 +398,22 @@ class ImageDetailsPage (HobPage):
386 def edit_packages_button_clicked_cb(self, button): 398 def edit_packages_button_clicked_cb(self, button):
387 self.builder.show_packages(ask=False) 399 self.builder.show_packages(ask=False)
388 400
401 def template_button_clicked_cb(self, button):
402 response, path = self.builder.show_load_template_dialog()
403 if not response:
404 return
405 self.builder.initiate_new_build()
406 if path:
407 self.builder.load_template(path)
408
389 def my_images_button_clicked_cb(self, button): 409 def my_images_button_clicked_cb(self, button):
390 self.builder.show_load_my_images_dialog() 410 self.builder.show_load_my_images_dialog()
411
412 def settings_button_clicked_cb(self, button):
413 # Create an advanced settings dialog
414 response, settings_changed = self.builder.show_adv_settings_dialog()
415 if not response:
416 return
417 self.builder.initiate_new_build()
418 if settings_changed:
419 self.builder.reparse_post_adv_settings()