]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
hob: remove save/load template functionality
authorCristiana Voicu <cristiana.voicu@intel.com>
Thu, 31 Jan 2013 12:43:08 +0000 (14:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Feb 2013 12:09:20 +0000 (12:09 +0000)
The Hob templates functionality, in its current incarnation,
is confusing and has no clear utility.

[YOCTO #3696]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/crumbs/builder.py
lib/bb/ui/crumbs/hobwidget.py
lib/bb/ui/crumbs/imageconfigurationpage.py
lib/bb/ui/crumbs/imagedetailspage.py

index 6805f20cc5d5d35b84fd84aa73faafb750c10477..f6adabe42f3ac67e4bbe5d85faa3e7bca2da0c46 100755 (executable)
@@ -1230,39 +1230,6 @@ class Builder(gtk.Window):
                 self.update_config_async()
         dialog.destroy()
 
-    def show_load_template_dialog(self):
-        dialog = gtk.FileChooserDialog("Load Template Files", self,
-                                       gtk.FILE_CHOOSER_ACTION_OPEN)
-        button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
-        HobAltButton.style_button(button)
-        button = dialog.add_button("Open", gtk.RESPONSE_YES)
-        HobButton.style_button(button)
-        filter = gtk.FileFilter()
-        filter.set_name("Hob Files")
-        filter.add_pattern("*.hob")
-        dialog.add_filter(filter)
-
-        response = dialog.run()
-        path = None
-        if response == gtk.RESPONSE_YES:
-            path = dialog.get_filename()
-        dialog.destroy()
-        return response == gtk.RESPONSE_YES, path
-
-    def show_save_template_dialog(self):
-        dialog = gtk.FileChooserDialog("Save Template Files", self,
-                                       gtk.FILE_CHOOSER_ACTION_SAVE)
-        button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
-        HobAltButton.style_button(button)
-        button = dialog.add_button("Save", gtk.RESPONSE_YES)
-        HobButton.style_button(button)
-        dialog.set_current_name("hob")
-        response = dialog.run()
-        if response == gtk.RESPONSE_YES:
-            path = dialog.get_filename()
-            self.save_template(path)
-        dialog.destroy()
-
     def get_image_extension(self):
         image_extension = {}
         for type in self.parameters.image_types:
index 3ca9066227a6bcc5cd9d3fedadb3627ee9e76a7b..0bdae3b58cbb15d8c03bf6262b8ff45582c10be1 100644 (file)
@@ -44,8 +44,6 @@ class hic:
     ICON_PACKAGES_HOVER_FILE      = os.path.join(HOB_ICON_BASE_DIR, ('packages/packages_hover.png'))
     ICON_LAYERS_DISPLAY_FILE      = os.path.join(HOB_ICON_BASE_DIR, ('layers/layers_display.png'))
     ICON_LAYERS_HOVER_FILE        = os.path.join(HOB_ICON_BASE_DIR, ('layers/layers_hover.png'))
-    ICON_TEMPLATES_DISPLAY_FILE   = os.path.join(HOB_ICON_BASE_DIR, ('templates/templates_display.png'))
-    ICON_TEMPLATES_HOVER_FILE     = os.path.join(HOB_ICON_BASE_DIR, ('templates/templates_hover.png'))
     ICON_IMAGES_DISPLAY_FILE      = os.path.join(HOB_ICON_BASE_DIR, ('images/images_display.png'))
     ICON_IMAGES_HOVER_FILE        = os.path.join(HOB_ICON_BASE_DIR, ('images/images_hover.png'))
     ICON_SETTINGS_DISPLAY_FILE    = os.path.join(HOB_ICON_BASE_DIR, ('settings/settings_display.png'))
index 956f5ced84f0ed525a941205965e85a71b127333..615b5445cb553dc94fc7b20d8589e64583643a2e 100644 (file)
@@ -55,12 +55,6 @@ class ImageConfigurationPage (HobPage):
         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 previously saved template",
-            self.template_button_clicked_cb)
         my_images_button = self.append_toolbar_button(self.toolbar,
             "Images",
             hic.ICON_IMAGES_DISPLAY_FILE,
@@ -494,13 +488,6 @@ class ImageConfigurationPage (HobPage):
         self.builder.configuration.initial_selected_image = self.builder.configuration.selected_image
         self.builder.show_recipes()
 
-    def template_button_clicked_cb(self, button):
-        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()
 
index 1b60aa8ed5fb3615ebe2edad050e23f41fd840ed..d5864136aa8b2a587b88eea3fe4727a019b82a4e 100755 (executable)
@@ -197,12 +197,6 @@ class ImageDetailsPage (HobPage):
         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 previously saved template",
-            self.template_button_clicked_cb)
         my_images_button = self.append_toolbar_button(self.toolbar,
             "Images",
             hic.ICON_IMAGES_DISPLAY_FILE,
@@ -265,11 +259,7 @@ class ImageDetailsPage (HobPage):
             self.build_result = self.BuildDetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color)
             self.box_group_area.pack_start(self.build_result, expand=False, fill=False)
 
-        # create the buttons at the bottom first because the buttons are used in apply_button_per_image()
-        if self.build_succeeded:
-            self.buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"]
-        else: # get to this page from "My images"
-            self.buttonlist = ["Build new image", "Run image", "Deploy image"]
+        self.buttonlist = ["Build new image", "Run image", "Deploy image"]
 
         # Name
         self.image_store = []
@@ -582,26 +572,6 @@ class ImageDetailsPage (HobPage):
             created = True
             is_runnable = True
 
-        name = "Save as template"
-        if name in buttonlist:
-            if created == True:
-                # separator
-                #label = gtk.Label(" or ")
-                #self.details_bottom_buttons.pack_end(label, expand=False, fill=False)
-
-                # create button "Save as template"
-                save_button = HobAltButton("Save as template")
-            else:
-                save_button = HobButton("Save as template")
-                #save_button.set_size_request(205, 49)
-                save_button.set_flags(gtk.CAN_DEFAULT)
-                packed = True
-            save_button.set_tooltip_text("Save the image configuration for reuse")
-            button_id = save_button.connect("clicked", self.save_button_clicked_cb)
-            self.button_ids[button_id] = save_button
-            self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False)
-            create = True
-
         name = "Build new image"
         if name in buttonlist:
             # create button "Build new image"
@@ -618,9 +588,6 @@ class ImageDetailsPage (HobPage):
 
         return is_runnable
 
-    def save_button_clicked_cb(self, button):
-        self.builder.show_save_template_dialog()
-
     def deploy_button_clicked_cb(self, button):
         if self.toggled_image:
             if self.num_toggled > 1:
@@ -648,13 +615,6 @@ class ImageDetailsPage (HobPage):
     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
-        if path:
-            self.builder.load_template(path)
-
     def my_images_button_clicked_cb(self, button):
         self.builder.show_load_my_images_dialog()