Skip to contentSkip to conversation

hob: remove save/load template functionality

PATCH New Cristiana Voicu 1 participant 1 message Jan 31, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hob: remove save/load template functionality

The Hob templates functionality, in its current incarnation, is confusing and has no clear utility.

[YOCTO #3696]
---
 bitbake/lib/bb/ui/crumbs/builder.py                |   33 ---------------
 bitbake/lib/bb/ui/crumbs/hobwidget.py              |    2 -
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   13 ------
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |   42 +-------------------
 .../bb/ui/icons/templates/templates_display.png    |  Bin 5651 -> 0 bytes
 .../lib/bb/ui/icons/templates/templates_hover.png  |  Bin 5791 -> 0 bytes
 6 files changed, 1 insertion(+), 89 deletions(-)
 delete mode 100644 bitbake/lib/bb/ui/icons/templates/templates_display.png
 delete mode 100644 bitbake/lib/bb/ui/icons/templates/templates_hover.png
bitbake/lib/bb/ui/crumbs/builder.py +0 -33
index 9da926d..1a38e75 100755
@@ -1225,39 +1225,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:
bitbake/lib/bb/ui/crumbs/hobwidget.py +0 -2
index 3ca9066..0bdae3b 100644
@@ -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'))
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +0 -13
index a0cbe85..3b14205 100644
@@ -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,
@@ -486,13 +480,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()
 
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +1 -41

72 lines not on this page · raw message

bitbake/lib/bb/ui/icons/templates/templates_display.png deleted binary +0 -0
deleted file mode 100644
index 153c7afb621a3a9562f57b3e7908e5d7409aabf0..0000000000000000000000000000000000000000
GIT binary patch
bitbake/lib/bb/ui/icons/templates/templates_hover.png deleted binary +0 -0
deleted file mode 100644
index afb7165fe5ff8f54083a37533f085787e266825a..0000000000000000000000000000000000000000
GIT binary patch
Signature · 1 line
1.7.9.5