bitbake: hob: fixes for image combo box
authorCristiana Voicu <cristiana.voicu@intel.com>
Tue, 27 Aug 2013 10:27:37 +0000 (13:27 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 Aug 2013 10:47:35 +0000 (11:47 +0100)
When an image from scratch is selected, and recipes parsing
is canceled, the image shown by the combo box isn't correct.

[YOCTO #5000]
(Bitbake rev: f8166ace0bd9155199166990ce15da24eb2e793b)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py

index ca168bc..060fee2 100644 (file)
@@ -496,16 +496,15 @@ class ImageConfigurationPage (HobPage):
                 cnt = cnt + 1
         self.image_combo.append_text(self.builder.recipe_model.__custom_image__)
 
+        if selected_image == self.builder.recipe_model.__custom_image__:
+            active = cnt
+
         if self.custom_image_selected:
             self.image_combo.append_text("--Separator--")
-            cnt = cnt + 1
             self.image_combo.append_text(self.custom_image_selected)
+            cnt = cnt + 2
             if self.custom_image_selected == selected_image:
                 active = cnt
-            cnt = cnt + 1
-
-        if selected_image == self.builder.recipe_model.__custom_image__:
-            active = cnt
 
         self.image_combo.set_active(active)