Patchwork [bitbake-devel,1/6] Hob: Change base image to "Create your own image" if customized

login
register
mail settings
Submitter Dongxiao Xu
Date April 9, 2012, 8:41 a.m.
Message ID <dd78b73c5af03552bc63a118f5a8b0e26709b321.1333960654.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/25367/
State New
Headers show

Comments

Dongxiao Xu - April 9, 2012, 8:41 a.m.
Once user did customization to his base image, we change the base image
to be "Create your own image" to avoid some issues caused by the
relationship between base image and its default recipes and packages.

This fixes [YOCTO #2211]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py                |    3 +++
 lib/bb/ui/crumbs/imageconfigurationpage.py |    2 ++
 lib/bb/ui/crumbs/packageselectionpage.py   |    6 ++++++
 lib/bb/ui/crumbs/recipeselectionpage.py    |    5 +++++
 4 files changed, 16 insertions(+), 0 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index a3410d4..bc7e610 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -272,6 +272,9 @@  class Builder(gtk.Window):
         self.recipe_model = recipe_model
         self.package_model = package_model
 
+        # Indicate whether user has customized the image
+        self.customized = False
+
         # create visual elements
         self.create_visual_elements()
 
diff --git a/lib/bb/ui/crumbs/imageconfigurationpage.py b/lib/bb/ui/crumbs/imageconfigurationpage.py
index d8cb752..5c2539d 100644
--- a/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -291,6 +291,8 @@  class ImageConfigurationPage (HobPage):
         if not selected_image:
             return
 
+        self.builder.customized = False
+
         selected_recipes = []
 
         image_path = self.builder.recipe_model.pn_path[selected_image]
diff --git a/lib/bb/ui/crumbs/packageselectionpage.py b/lib/bb/ui/crumbs/packageselectionpage.py
index 7926636..dd0df25 100755
--- a/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/lib/bb/ui/crumbs/packageselectionpage.py
@@ -90,6 +90,7 @@  class PackageSelectionPage (HobPage):
         super(PackageSelectionPage, self).__init__(builder, "Packages")
 
         # set invisiable members
+        self.recipe_model = self.builder.recipe_model
         self.package_model = self.builder.package_model
 
         # create visual elements
@@ -183,6 +184,11 @@  class PackageSelectionPage (HobPage):
             self.package_model.exclude_item(item_path=path)
 
         self.refresh_selection()
+        if not self.builder.customized:
+            self.builder.customized = True
+            self.builder.configuration.selected_image = self.recipe_model.__dummy_image__
+            self.builder.rcppkglist_populated()
+
         self.builder.window_sensitive(True)
 
     def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
diff --git a/lib/bb/ui/crumbs/recipeselectionpage.py b/lib/bb/ui/crumbs/recipeselectionpage.py
index e4616a8..2d438d5 100755
--- a/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -187,6 +187,11 @@  class RecipeSelectionPage (HobPage):
             self.recipe_model.exclude_item(item_path=path)
 
         self.refresh_selection()
+        if not self.builder.customized:
+            self.builder.customized = True
+            self.builder.configuration.selected_image = self.recipe_model.__dummy_image__
+            self.builder.rcppkglist_populated()
+
         self.builder.window_sensitive(True)
 
     def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):