Skip to contentSkip to conversation

Hob: bug fixes

PATCH Applied Shane Wang 2 participants 7 messages Mar 28, 2012 – Mar 29, 2012

lore
Share & tools
lore

Shane Wang

author
#0 lore raw

cover Hob: bug fixes

Fix bug 2163 and some words

The following changes since commit bbef66e4005def54d70d3720ec131fa7edc22e2a:

Hob: allow users to setup the proxies (2012-03-28 15:57:39 +0800)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob-fixes-2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-2

Shane Wang (5):
Hob: add Templates and Settings on image details screen
Hob: change some words for build configurations on build details
screen
Hob: change some words on image configuration screen to make them
consistent
Hob: change some words on recipes screen and package screen to make
them consistent
Hob: change some words in settings dialog to make them consistent

 bitbake/lib/bb/ui/crumbs/builddetailspage.py       |   22 +++++++-------
 bitbake/lib/bb/ui/crumbs/builder.py                |   19 ++++++++-----
 bitbake/lib/bb/ui/crumbs/hig.py                    |   22 +++++++-------
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   18 +++++++++---
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |   29 ++++++++++++++++++++
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py   |    4 +-
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    6 ++--
 7 files changed, 81 insertions(+), 39 deletions(-)
Signature · 1 line
1.7.6
author
#1 lore raw

PATCH 1/5 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/lib/bb/ui/crumbs/builder.py                |   19 ++++++++-----
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   12 +++++++-
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py       |   29 ++++++++++++++++++++
 3 files changed, 51 insertions(+), 9 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +12 -7
index 2af14dc..1a06dd7 100755
@@ -757,10 +757,11 @@ class Builder(gtk.Window):
         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,
@@ -820,16 +821,20 @@ class Builder(gtk.Window):
         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:
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +10 -2
index d7437a9..9ad1ea4 100644
@@ -360,11 +360,19 @@ class ImageConfigurationPage (HobPage):
         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()
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +29 -0
index 7d06124..f15aad3 100755
@@ -122,12 +122,24 @@ 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 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)
 
@@ -386,5 +398,22 @@ 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
+        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()
Signature · 1 line
1.7.6
author
#2 lore raw

PATCH 2/5 Hob: change some words for build configurations on build details screen

This patch is to change some words of variables to make them consistent with the GUI.

---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +11 -11
index e8dbad7..abbee4c 100755
@@ -83,15 +83,15 @@ class BuildConfigurationTreeView(gtk.TreeView):
 
     def show(self, src_config_info, src_params):
         vars = []
-        vars.append(self.set_vars("BB VERSION:", src_params.bb_version))
-        vars.append(self.set_vars("TARGET_ARCH:", src_params.target_arch))
-        vars.append(self.set_vars("TARGET_OS:", src_params.target_os))
-        vars.append(self.set_vars("MACHINE:", src_config_info.curr_mach))
-        vars.append(self.set_vars("DISTRO:", src_config_info.curr_distro))
-        vars.append(self.set_vars("DISTRO_VERSION:", src_params.distro_version))
-        vars.append(self.set_vars("SDK_MACHINE:", src_config_info.curr_sdk_machine))
-        vars.append(self.set_vars("TUNE_FEATURE:", src_params.tune_pkgarch))
-        vars.append(self.set_vars("LAYERS:", src_config_info.layers))
+        vars.append(self.set_vars("BB version:", src_params.bb_version))
+        vars.append(self.set_vars("Target arch:", src_params.target_arch))
+        vars.append(self.set_vars("Target OS:", src_params.target_os))
+        vars.append(self.set_vars("Machine:", src_config_info.curr_mach))
+        vars.append(self.set_vars("Distro:", src_config_info.curr_distro))
+        vars.append(self.set_vars("Distro version:", src_params.distro_version))
+        vars.append(self.set_vars("SDK machine:", src_config_info.curr_sdk_machine))
+        vars.append(self.set_vars("Tune feature:", src_params.tune_pkgarch))
+        vars.append(self.set_vars("Layers:", src_config_info.layers))
 
         for path in src_config_info.layers:
             import os, os.path
@@ -99,7 +99,7 @@ class BuildConfigurationTreeView(gtk.TreeView):
                 f = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path)
                 if f:
                     branch = f.readline().lstrip('\n').rstrip('\n')
-                    vars.append(self.set_vars("BRANCH:", branch))
+                    vars.append(self.set_vars("Branch:", branch))
                     f.close()
                 break
 
@@ -140,7 +140,7 @@ class BuildDetailsPage (HobPage):
         self.scrolled_view_config = gtk.ScrolledWindow ()
         self.scrolled_view_config.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
         self.scrolled_view_config.add(self.config_tv)
-        self.notebook.append_page(self.scrolled_view_config, gtk.Label("Build Configuration"))
+        self.notebook.append_page(self.scrolled_view_config, gtk.Label("Build configuration"))
 
         self.failure_tv = BuildFailureTreeView()
         self.failure_model = self.builder.handler.build.model.failure_model()
Signature · 1 line
1.7.6
author
#3 lore raw

PATCH 3/5 Hob: change some words on image configuration screen to make them consistent

In reply to Shane Wang
---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -3
index 9ad1ea4..f9a432f 100644
@@ -200,7 +200,7 @@ class ImageConfigurationPage (HobPage):
         # button to view recipes
         icon_file = hic.ICON_RCIPE_DISPLAY_FILE
         hover_file = hic.ICON_RCIPE_HOVER_FILE
-        self.view_recipes_button = HobImageButton("View Recipes",
+        self.view_recipes_button = HobImageButton("View recipes",
                                         "Add/remove recipes and tasks",
                                         icon_file, hover_file)
         self.view_recipes_button.connect("clicked", self.view_recipes_button_clicked_cb)
@@ -208,7 +208,7 @@ class ImageConfigurationPage (HobPage):
         # button to view packages
         icon_file = hic.ICON_PACKAGES_DISPLAY_FILE
         hover_file = hic.ICON_PACKAGES_HOVER_FILE
-        self.view_packages_button = HobImageButton("View Packages",
+        self.view_packages_button = HobImageButton("View packages",
                                         "Add/remove previously built packages",
                                         icon_file, hover_file)
         self.view_packages_button.connect("clicked", self.view_packages_button_clicked_cb)
@@ -241,7 +241,7 @@ class ImageConfigurationPage (HobPage):
         button_box.pack_end(label, expand=False, fill=False)
 
         # create button "Build Packages"
-        build_packages_button = HobAltButton("Build Packages")
+        build_packages_button = HobAltButton("Build packages")
         build_packages_button.connect("clicked", self.build_packages_button_clicked_cb)
         button_box.pack_end(build_packages_button, expand=False, fill=False)
 
Signature · 1 line
1.7.6
author
#4 lore raw

PATCH 4/5 Hob: change some words on recipes screen and package screen to make them consistent

In reply to Shane Wang
---
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    4 ++--
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
bitbake/lib/bb/ui/crumbs/packageselectionpage.py +2 -2
index 67ae5d1..d855e58 100755
@@ -37,7 +37,7 @@ class PackageSelectionPage (HobPage):
          'name'    : 'Included',
          'filter'  : { PackageListModel.COL_INC : [True] },
          'columns' : [{
-                       'col_name' : 'Package Name',
+                       'col_name' : 'Package name',
                        'col_id'   : PackageListModel.COL_NAME,
                        'col_style': 'text',
                        'col_min'  : 100,
@@ -65,7 +65,7 @@ class PackageSelectionPage (HobPage):
          'name'    : 'All packages',
          'filter'  : {},
          'columns' : [{
-                       'col_name' : 'Package Name',
+                       'col_name' : 'Package name',
                        'col_id'   : PackageListModel.COL_NAME,
                        'col_style': 'text',
                        'col_min'  : 100,
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +3 -3
index ebdb7c1..e4616a8 100755
@@ -37,7 +37,7 @@ class RecipeSelectionPage (HobPage):
          'filter'  : { RecipeListModel.COL_INC  : [True],
                        RecipeListModel.COL_TYPE : ['recipe', 'task'] },
          'columns' : [{
-                       'col_name' : 'Recipe Name',
+                       'col_name' : 'Recipe name',
                        'col_id'   : RecipeListModel.COL_NAME,
                        'col_style': 'text',
                        'col_min'  : 100,
@@ -59,7 +59,7 @@ class RecipeSelectionPage (HobPage):
          'name'    : 'All recipes',
          'filter'  : { RecipeListModel.COL_TYPE : ['recipe'] },
          'columns' : [{
-                       'col_name' : 'Recipe Name',
+                       'col_name' : 'Recipe name',
                        'col_id'   : RecipeListModel.COL_NAME,
                        'col_style': 'text',
                        'col_min'  : 100,
@@ -87,7 +87,7 @@ class RecipeSelectionPage (HobPage):
          'name'    : 'Tasks',
          'filter'  : { RecipeListModel.COL_TYPE : ['task'] },
          'columns' : [{
-                       'col_name' : 'Task Name',
+                       'col_name' : 'Task name',
                        'col_id'   : RecipeListModel.COL_NAME,
                        'col_style': 'text',
                        'col_min'  : 100,
Signature · 1 line
1.7.6
author
#5 lore raw

PATCH 5/5 Hob: change some words in settings dialog to make them consistent

In reply to Shane Wang
---
 bitbake/lib/bb/ui/crumbs/hig.py |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/crumbs/hig.py +11 -11
index 4753c92..1aa055e 100644
@@ -399,7 +399,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Packaging Format:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Packaging format:</span>")
         tooltip = "Select package formats that will be used. "
         tooltip += "The first format will be used for final image"
         pkgfmt_widget, self.rootfs_combo, self.check_hbox = self.gen_pkgfmt_widget(self.configuration.curr_package_format, self.all_package_formats, tooltip)
@@ -408,7 +408,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Image Rootfs Size: (MB)</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Image rootfs size: (MB)</span>")
         tooltip = "Sets the size of your target image.\nThis is the basic size of your target image, unless your selected package size exceeds this value, or you set value to \"Image Extra Size\"."
         rootfs_size_widget, self.rootfs_size_spinner = self.gen_spinner_widget(int(self.configuration.image_rootfs_size*1.0/1024), 0, 1024, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -416,7 +416,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Image Extra Size: (MB)</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Image extra size: (MB)</span>")
         tooltip = "Sets the extra free space of your target image.\nDefaultly, system will reserve 30% of your image size as your free space. If your image contains zypper, it will bring in 50MB more space. The maximum free space is 1024MB."
         extra_size_widget, self.extra_size_spinner = self.gen_spinner_widget(int(self.configuration.image_extra_size*1.0/1024), 0, 1024, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -432,7 +432,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_hbox = gtk.HBox(False, 6)
         advanced_vbox.pack_start(sub_hbox, expand=False, fill=False)
-        self.toolchain_checkbox = gtk.CheckButton("Build Toolchain")
+        self.toolchain_checkbox = gtk.CheckButton("Build toolchain")
         self.toolchain_checkbox.set_tooltip_text("Check this box to build the related toolchain with your image")
         self.toolchain_checkbox.set_active(self.configuration.toolchain_build)
         sub_hbox.pack_start(self.toolchain_checkbox, expand=False, fill=False)
@@ -449,7 +449,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Select Distro:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Select distro:</span>")
         tooltip = "This is the Yocto distribution you would like to use"
         distro_widget, self.distro_combo = self.gen_combo_widget(self.configuration.curr_distro, self.all_distros, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -457,7 +457,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">BB_NUMBER_THREADS:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">BB number threads:</span>")
         tooltip = "Sets the number of threads that bitbake tasks can run simultaneously"
         bbthread_widget, self.bb_spinner = self.gen_spinner_widget(self.configuration.bbthread, 1, self.max_threads, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -465,7 +465,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">PARALLEL_MAKE:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Parallel make:</span>")
         tooltip = "Sets the make parallism, as known as 'make -j'"
         pmake_widget, self.pmake_spinner = self.gen_spinner_widget(self.configuration.pmake, 1, self.max_threads, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -473,7 +473,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Set Download Directory:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Set download directory:</span>")
         tooltip = "Select a folder that caches the upstream project source code"
         dldir_widget, self.dldir_text = self.gen_entry_widget(self.configuration.dldir, self, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -481,7 +481,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Directory:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE directory:</span>")
         tooltip = "Select a folder that caches your prebuilt results"
         sstatedir_widget, self.sstatedir_text = self.gen_entry_widget(self.configuration.sstatedir, self, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -489,7 +489,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE Mirror:</span>")
+        label = self.gen_label_widget("<span weight=\"bold\">Select SSTATE mirror:</span>")
         tooltip = "Select the prebuilt mirror that will fasten your build speed"
         sstatemirror_widget, self.sstatemirror_text = self.gen_entry_widget(self.configuration.sstatemirror, self, tooltip)
         sub_vbox.pack_start(label, expand=False, fill=False)
@@ -503,7 +503,7 @@ class AdvancedSettingDialog (CrumbsDialog):
 
         sub_vbox = gtk.VBox(False, 6)
         advanced_vbox.pack_start(sub_vbox, expand=False, fill=False)
-        self.proxy_checkbox = gtk.CheckButton("Enable Proxy")
+        self.proxy_checkbox = gtk.CheckButton("Enable proxy")
         self.proxy_checkbox.set_tooltip_text("Check this box to setup the proxy you specified")
         self.proxy_checkbox.set_active(self.enable_proxy)
         self.proxy_checkbox.connect("toggled", self.proxy_checkbox_toggled_cb)
Signature · 1 line
1.7.6
#6 lore raw
In reply to Shane Wang
Quoted 10 lines · Shane Wang

Fix bug 2163 and some words

The following changes since commit bbef66e4005def54d70d3720ec131fa7edc22e2a:

Hob: allow users to setup the proxies (2012-03-28 15:57:39 +0800)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib shane/hob-fixes-2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=shane/hob-fixes-2

Quoted 9 lines

Shane Wang (5):
Hob: add Templates and Settings on image details screen
Hob: change some words for build configurations on build details
screen
Hob: change some words on image configuration screen to make them
consistent
Hob: change some words on recipes screen and package screen to make
them consistent
Hob: change some words in settings dialog to make them consistent

Merged to master, thanks.

Richard