Patchwork [bitbake-devel] hob: change behavior for "cancel" button from the Recipe selection page

login
register
mail settings
Submitter Cristiana Voicu
Date Oct. 12, 2012, 12:29 p.m.
Message ID <1350044986-21937-1-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/38117/
State New
Headers show

Comments

Cristiana Voicu - Oct. 12, 2012, 12:29 p.m.
-when returned to the Image configuration page, after canceling on the
Recipe selection page, the image selected previously is now shown corectly

[YOCTO #3205}
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py                |    1 +
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    1 +
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    3 +++
 3 files changed, 5 insertions(+)
Richard Purdie - Oct. 24, 2012, 8:10 p.m.
On Fri, 2012-10-12 at 15:29 +0300, Cristiana Voicu wrote:
> -when returned to the Image configuration page, after canceling on the
> Recipe selection page, the image selected previously is now shown corectly
> 
> [YOCTO #3205}
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/builder.py                |    1 +
>  bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    1 +
>  bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    3 +++
>  3 files changed, 5 insertions(+)

Merged to master, thanks.

Richard

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 6ddc5b6..7a30b7c 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -126,6 +126,7 @@  class Configuration:
         self.selected_image = None
         self.selected_recipes = []
         self.selected_packages = []
+        self.initial_selected_image = None
         self.initial_selected_packages = []
         self.initial_user_selected_packages = []
 
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 8988df0..cbef85a 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -432,6 +432,7 @@  class ImageConfigurationPage (HobPage):
         self.builder.just_bake()
 
     def edit_image_button_clicked_cb(self, button):
+        self.builder.configuration.initial_selected_image = self.builder.configuration.selected_image
         self.builder.show_recipes()
 
     def template_button_clicked_cb(self, button):
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index 8655c29..79c7790 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -193,6 +193,9 @@  class RecipeSelectionPage (HobPage):
         self.builder.build_packages()
 
     def back_button_clicked_cb(self, button):
+        self.builder.recipe_model.set_selected_image(self.builder.configuration.initial_selected_image)
+        self.builder.image_configuration_page.update_image_combo(self.builder.recipe_model, self.builder.configuration.initial_selected_image)
+        self.builder.image_configuration_page.update_image_desc()
         self.builder.show_configuration()
 
     def refresh_selection(self):