dialog.add_filter(filter)
response = dialog.run()
+ path = None
if response == gtk.RESPONSE_YES:
path = dialog.get_filename()
- self.load_template(path)
dialog.destroy()
+ return response == gtk.RESPONSE_YES, path
def show_save_template_dialog(self):
dialog = gtk.FileChooserDialog("Save Template Files", self,
button = dialog.add_button("Save", gtk.RESPONSE_YES)
HobButton.style_button(button)
response = dialog.run()
+ settings_changed = False
if response == gtk.RESPONSE_YES:
self.parameters.enable_proxy = dialog.enable_proxy
self.configuration = dialog.configuration
- # DO reparse recipes
- if dialog.settings_changed:
- if self.configuration.curr_mach == "":
- self.switch_page(self.MACHINE_SELECTION)
- else:
- self.switch_page(self.RCPPKGINFO_POPULATING)
+ settings_changed = dialog.settings_changed
dialog.destroy()
+ return response == gtk.RESPONSE_YES, settings_changed
+
+ def reparse_post_adv_settings(self):
+ # DO reparse recipes
+ if self.configuration.curr_mach == "":
+ self.switch_page(self.MACHINE_SELECTION)
+ else:
+ self.switch_page(self.RCPPKGINFO_POPULATING)
def deploy_image(self, image_name):
if not image_name:
self.builder.build_packages()
def template_button_clicked_cb(self, button):
- self.builder.show_load_template_dialog()
+ response, path = self.builder.show_load_template_dialog()
+ if not response:
+ return
+ if path:
+ self.builder.load_template(path)
def my_images_button_clicked_cb(self, button):
self.builder.show_load_my_images_dialog()
def settings_button_clicked_cb(self, button):
# Create an advanced settings dialog
- self.builder.show_adv_settings_dialog()
+ response, settings_changed = self.builder.show_adv_settings_dialog()
+ if not response:
+ return
+ if settings_changed:
+ self.builder.reparse_post_adv_settings()
self.toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
self.toolbar.set_style(gtk.TOOLBAR_BOTH)
+ template_button = self.append_toolbar_button(self.toolbar,
+ "Templates",
+ hic.ICON_TEMPLATES_DISPLAY_FILE,
+ hic.ICON_TEMPLATES_HOVER_FILE,
+ "Load a hob building template saved before",
+ self.template_button_clicked_cb)
my_images_button = self.append_toolbar_button(self.toolbar,
"My images",
hic.ICON_IMAGES_DISPLAY_FILE,
hic.ICON_IMAGES_HOVER_FILE,
"Open images built out previously for running or deployment",
self.my_images_button_clicked_cb)
+ settings_button = self.append_toolbar_button(self.toolbar,
+ "Settings",
+ hic.ICON_SETTINGS_DISPLAY_FILE,
+ hic.ICON_SETTINGS_HOVER_FILE,
+ "Other advanced settings for build",
+ self.settings_button_clicked_cb)
self.details_top_buttons = self.add_onto_top_bar(self.toolbar)
def edit_packages_button_clicked_cb(self, button):
self.builder.show_packages(ask=False)
+ def template_button_clicked_cb(self, button):
+ response, path = self.builder.show_load_template_dialog()
+ if not response:
+ return
+ self.builder.initiate_new_build()
+ if path:
+ self.builder.load_template(path)
+
def my_images_button_clicked_cb(self, button):
self.builder.show_load_my_images_dialog()
+
+ def settings_button_clicked_cb(self, button):
+ # Create an advanced settings dialog
+ response, settings_changed = self.builder.show_adv_settings_dialog()
+ if not response:
+ return
+ self.builder.initiate_new_build()
+ if settings_changed:
+ self.builder.reparse_post_adv_settings()