Skip to contentSkip to conversation

Hob: bug-fixes

PATCH In review Liming An 3 participants 7 messages May 14, 2012 – May 20, 2012 Arm STM32

lore
Share & tools
lore

Liming An

author
#0 lore raw

cover Hob: bug-fixes

The following changes since commit 12b4543ac9f54c0db0ee4a7ee546a71946a051f8:

classes/rootfs_*: fix splitting package dependency strings (2012-05-13 20:09:56 +0100)

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

Liming An (3):
Hob: apply a line length to consistantly across 'base image'
descriptions
Hob: add '--select a machine--' and '--select a base image--' to GUI Hob:add function about clicked a row to load image file for 'my
images' page

 bitbake/lib/bb/ui/crumbs/builder.py                |    6 ++--
 bitbake/lib/bb/ui/crumbs/hig.py                    |   18 ++++++++-
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |    6 ++--
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   37 +++++++++++++++----
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    2 +-
 5 files changed, 52 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/3 Hob: apply a line length to consistantly across 'base image' descriptions

[YOCTO #2310]

---
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +2 -0
index 0463ee8..7d19912 100644
@@ -201,6 +201,8 @@ class ImageConfigurationPage (HobPage):
 
         self.image_desc = gtk.Label()
         self.image_desc.set_alignment(0.0, 0.5)
+        self.image_desc.set_size_request(400, -1)
+        self.image_desc.set_justify(gtk.JUSTIFY_LEFT)
         self.image_desc.set_line_wrap(True)
 
         # button to view recipes
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/3 Hob: add '--select a machine--' and '--select a base image--' to GUI

[YOCTO #2175]

---
 bitbake/lib/bb/ui/crumbs/builder.py                |    6 ++--
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |    6 ++--
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   35 +++++++++++++++----
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    2 +-
 4 files changed, 34 insertions(+), 15 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +3 -3
index 42d0f2c..eb60b89 100755
@@ -438,7 +438,7 @@ class Builder(gtk.Window):
         toolchain_packages = []
         if self.configuration.toolchain_build:
             toolchain_packages = self.package_model.get_selected_packages_toolchain()
-        if self.configuration.selected_image == self.recipe_model.__dummy_image__:
+        if self.configuration.selected_image == self.recipe_model.__custom_image__:
             packages = self.package_model.get_selected_packages()
             image = self.hob_image
         else:
@@ -752,7 +752,7 @@ class Builder(gtk.Window):
             fraction = 1.0
             self.parameters.image_names = []
             selected_image = self.recipe_model.get_selected_image()
-            if selected_image == self.recipe_model.__dummy_image__:
+            if selected_image == self.recipe_model.__custom_image__:
                 linkname = 'hob-image-' + self.configuration.curr_mach
             else:
                 linkname = selected_image + '-' + self.configuration.curr_mach
@@ -890,7 +890,7 @@ class Builder(gtk.Window):
         selected_packages = self.package_model.get_selected_packages() or []
 
         # If no base image and no selected packages don't build anything
-        if not (selected_packages or selected_image != self.recipe_model.__dummy_image__):
+        if not (selected_packages or selected_image != self.recipe_model.__custom_image__):
             lbl = "<b>No selections made</b>\nYou have not made any selections"
             lbl = lbl + " so there isn't anything to bake at this time."
             dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
bitbake/lib/bb/ui/crumbs/hoblistmodel.py +3 -3
index 0b54f91..37cee78 100644
@@ -456,7 +456,7 @@ class RecipeListModel(gtk.ListStore):
     """
     (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN, COL_FADE_INC) = range(12)
 
-    __dummy_image__ = "Create your own image"
+    __custom_image__ = "Create your own image"
 
     __gsignals__ = {
         "recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST,
@@ -565,14 +565,14 @@ class RecipeListModel(gtk.ListStore):
         self.clear()
 
         # dummy image for prompt
-        self.set(self.append(), self.COL_NAME, self.__dummy_image__,
+        self.set(self.append(), self.COL_NAME, self.__custom_image__,
                  self.COL_DESC, "Use the 'View recipes' and 'View packages' " \
                                 "options to select what you want to include " \
                                 "in your image.",
                  self.COL_LIC, "", self.COL_GROUP, "",
                  self.COL_DEPS, "", self.COL_BINB, "",
                  self.COL_TYPE, "image", self.COL_INC, False,
-                 self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN, self.__dummy_image__)
+                 self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN, self.__custom_image__)
 
         for item in event_model["pn"]:
             name = item
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +27 -8
index 7d19912..51594b3 100644
@@ -33,6 +33,9 @@ from bb.ui.crumbs.hobpages import HobPage
 #
 class ImageConfigurationPage (HobPage):
 
+    __dummy_machine__ = "--select a machine--"
+    __dummy_image__   = "--select a base image--"
+
     def __init__(self, builder):
         super(ImageConfigurationPage, self).__init__(builder, "Image configuration")
 
@@ -261,9 +264,15 @@ class ImageConfigurationPage (HobPage):
 
     def machine_combo_changed_cb(self, machine_combo):
         combo_item = machine_combo.get_active_text()
-        if not combo_item:
+        if not combo_item or combo_item == self.__dummy_machine__:
             return
 
+        # remove __dummy_machine__ item from the store list after first user selection
+        # because it is no longer valid
+        combo_store = machine_combo.get_model()
+        if len(combo_store) and (combo_store[0][0] == self.__dummy_machine__):
+            machine_combo.remove_text(0)
+
         self.builder.configuration.curr_mach = combo_item
         if self.machine_combo_changed_by_manual:
             self.builder.configuration.clear_selection()
@@ -274,13 +283,13 @@ class ImageConfigurationPage (HobPage):
         self.builder.populate_recipe_package_info_async()
 
     def update_machine_combo(self):
-        all_machines = self.builder.parameters.all_machines
+        all_machines = [self.__dummy_machine__] + self.builder.parameters.all_machines
 
         model = self.machine_combo.get_model()
         model.clear()
         for machine in all_machines:
             self.machine_combo.append_text(machine)
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def switch_machine_combo(self):
         self.machine_combo_changed_by_manual = False
@@ -291,7 +300,7 @@ class ImageConfigurationPage (HobPage):
                 self.machine_combo.set_active(active)
                 return
             active += 1
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def update_image_desc(self, selected_image):
         desc = ""
@@ -311,9 +320,15 @@ class ImageConfigurationPage (HobPage):
     def image_combo_changed_cb(self, combo):
         self.builder.window_sensitive(False)
         selected_image = self.image_combo.get_active_text()
-        if not selected_image:
+        if not selected_image or (selected_image == self.__dummy_image__):
             return
 
+        # remove __dummy_image__ item from the store list after first user selection
+        # because it is no longer valid
+        combo_store = combo.get_model()
+        if len(combo_store) and (combo_store[0][0] == self.__dummy_image__):
+            combo.remove_text(0)
+
         self.builder.customized = False
 
         selected_recipes = []
@@ -356,14 +371,14 @@ class ImageConfigurationPage (HobPage):
             path = image_model.get_path(it)
             it = image_model.iter_next(it)
             image_name = image_model[path][recipe_model.COL_NAME]
-            if image_name == self.builder.recipe_model.__dummy_image__:
+            if image_name == self.builder.recipe_model.__custom_image__:
                 continue
             self.image_combo.append_text(image_name)
             if image_name == selected_image:
                 active = cnt
             cnt = cnt + 1
-        self.image_combo.append_text(self.builder.recipe_model.__dummy_image__)
-        if selected_image == self.builder.recipe_model.__dummy_image__:
+        self.image_combo.append_text(self.builder.recipe_model.__custom_image__)
+        if selected_image == self.builder.recipe_model.__custom_image__:
             active = cnt
 
         self.image_combo.set_active(-1)
@@ -371,6 +386,10 @@ class ImageConfigurationPage (HobPage):
 
         if active != -1:
             self.show_baseimg_selected()
+        else:
+            # Set a indicator text to combo store when first open
+            self.image_combo.insert_text(0, self.__dummy_image__)
+            self.image_combo.set_active(0)
 
         self._image_combo_connect_signal()
 
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +1 -1
index 6bc9c16..5164999 100755
@@ -219,7 +219,7 @@ class RecipeSelectionPage (HobPage):
         self.refresh_selection()
         if not self.builder.customized:
             self.builder.customized = True
-            self.builder.configuration.selected_image = self.recipe_model.__dummy_image__
+            self.builder.configuration.selected_image = self.recipe_model.__custom_image__
             self.builder.rcppkglist_populated()
 
         self.builder.window_sensitive(True)
Signature · 1 line
1.7.5.4
#3 lore raw

Re: [PATCH 2/3] Hob: add '--select a machine--' and '--select a base image--' to GUI

Hi Liming,

I simply tried this patch, and I saw the "--select a base image--" is listed in the bottom part of the combo menu.

I think it should be the first one?

Thanks,
Dongxiao

Quoted 234 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Liming An
Sent: Monday, May 14, 2012 8:52 PM
To: [email protected]
Subject: [bitbake-devel] [PATCH 2/3] Hob: add '--select a machine--' and '--select a base image--' to GUI

[YOCTO #2175]

---
 bitbake/lib/bb/ui/crumbs/builder.py                |    6 ++--
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |    6 ++--
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   35
+++++++++++++++----
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    2 +-
 4 files changed, 34 insertions(+), 15 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +0 -1
index 42d0f2c..eb60b89 100755
@@ -438,7 +438,7 @@ class Builder(gtk.Window):
         toolchain_packages = []
         if self.configuration.toolchain_build:
             toolchain_packages =
 self.package_model.get_selected_packages_toolchain()
-        if self.configuration.selected_image ==

self.recipe_model.__dummy_image__:
+ if self.configuration.selected_image ==
self.recipe_model.__custom_image__:
packages = self.package_model.get_selected_packages() image = self.hob_image
else:

bitbake/lib/bb/ui/crumbs/builder.py +1 -1
@@ -752,7 +752,7 @@ class Builder(gtk.Window):
             fraction = 1.0
             self.parameters.image_names = []
             selected_image = self.recipe_model.get_selected_image()
-            if selected_image == self.recipe_model.__dummy_image__:
+            if selected_image == self.recipe_model.__custom_image__:
                 linkname = 'hob-image-' + self.configuration.curr_mach
             else:
                 linkname = selected_image + '-' +

self.configuration.curr_mach @@ -890,7 +890,7 @@ class Builder(gtk.Window):
selected_packages = self.package_model.get_selected_packages()
or []

# If no base image and no selected packages don't build anything
- if not (selected_packages or selected_image !=
self.recipe_model.__dummy_image__):
+ if not (selected_packages or selected_image !=
self.recipe_model.__custom_image__):
lbl = "<b>No selections made</b>\nYou have not made any
selections"
lbl = lbl + " so there isn't anything to bake at this time." dialog = CrumbsMessageDialog(self, lbl,
gtk.STOCK_DIALOG_INFO) diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 0b54f91..37cee78 100644

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +0 -0
@@ -456,7 +456,7 @@ class RecipeListModel(gtk.ListStore):
     """
     (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB,

COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN, COL_FADE_INC) = range(12)

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +2 -3
-    __dummy_image__ = "Create your own image"
+    __custom_image__ = "Create your own image"
 
     __gsignals__ = {
         "recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST, @@
-565,14 +565,14 @@ class RecipeListModel(gtk.ListStore):
         self.clear()
 
         # dummy image for prompt
-        self.set(self.append(), self.COL_NAME, self.__dummy_image__,
+        self.set(self.append(), self.COL_NAME, self.__custom_image__,
                  self.COL_DESC, "Use the 'View recipes' and 'View

packages' " \
"options to select what you want to
include " \
"in your image.",
self.COL_LIC, "", self.COL_GROUP, "", self.COL_DEPS, "", self.COL_BINB, "", self.COL_TYPE, "image", self.COL_INC, False,
- self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN,
self.__dummy_image__)

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +2 -0
+                 self.COL_IMG, False, self.COL_INSTALL, "",
+ self.COL_PN, self.__custom_image__)
 
         for item in event_model["pn"]:
             name = item
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +0 -0
index 7d19912..51594b3 100644
@@ -33,6 +33,9 @@ from bb.ui.crumbs.hobpages import HobPage  #  class

ImageConfigurationPage (HobPage):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+    __dummy_machine__ = "--select a machine--"
+    __dummy_image__   = "--select a base image--"
+
     def __init__(self, builder):
         super(ImageConfigurationPage, self).__init__(builder, "Image

configuration")

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +2 -1
@@ -261,9 +264,15 @@ class ImageConfigurationPage (HobPage):
 
     def machine_combo_changed_cb(self, machine_combo):
         combo_item = machine_combo.get_active_text()
-        if not combo_item:
+        if not combo_item or combo_item == self.__dummy_machine__:
             return
 
+        # remove __dummy_machine__ item from the store list after first

user selection

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+        # because it is no longer valid
+        combo_store = machine_combo.get_model()
+        if len(combo_store) and (combo_store[0][0] ==

self.__dummy_machine__):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +8 -4
+            machine_combo.remove_text(0)
+
         self.builder.configuration.curr_mach = combo_item
         if self.machine_combo_changed_by_manual:
             self.builder.configuration.clear_selection()
@@ -274,13 +283,13 @@ class ImageConfigurationPage (HobPage):
         self.builder.populate_recipe_package_info_async()
 
     def update_machine_combo(self):
-        all_machines = self.builder.parameters.all_machines
+        all_machines = [self.__dummy_machine__] +
+ self.builder.parameters.all_machines
 
         model = self.machine_combo.get_model()
         model.clear()
         for machine in all_machines:
             self.machine_combo.append_text(machine)
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def switch_machine_combo(self):
         self.machine_combo_changed_by_manual = False @@ -291,7
+300,7 @@ class ImageConfigurationPage (HobPage):
                 self.machine_combo.set_active(active)
                 return
             active += 1
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def update_image_desc(self, selected_image):
         desc = ""
@@ -311,9 +320,15 @@ class ImageConfigurationPage (HobPage):
     def image_combo_changed_cb(self, combo):
         self.builder.window_sensitive(False)
         selected_image = self.image_combo.get_active_text()
-        if not selected_image:
+        if not selected_image or (selected_image ==

self.__dummy_image__):
return

+ # remove __dummy_image__ item from the store list after first
user selection

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+        # because it is no longer valid
+        combo_store = combo.get_model()
+        if len(combo_store) and (combo_store[0][0] ==

self.__dummy_image__):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +2 -1
+            combo.remove_text(0)
+
         self.builder.customized = False
 
         selected_recipes = []
@@ -356,14 +371,14 @@ class ImageConfigurationPage (HobPage):
             path = image_model.get_path(it)
             it = image_model.iter_next(it)
             image_name = image_model[path][recipe_model.COL_NAME]
-            if image_name ==

self.builder.recipe_model.__dummy_image__:
+ if image_name ==
self.builder.recipe_model.__custom_image__:
continue
self.image_combo.append_text(image_name)
if image_name == selected_image:
active = cnt
cnt = cnt + 1
- self.image_combo.append_text(self.builder.recipe_model.__dummy_image__)

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +1 -1
-        if selected_image == self.builder.recipe_model.__dummy_image__:
+

self.image_combo.append_text(self.builder.recipe_model.__custom_image__)
+ if selected_image == self.builder.recipe_model.__custom_image__:
active = cnt

self.image_combo.set_active(-1) @@ -371,6 +386,10 @@ class
ImageConfigurationPage (HobPage):

         if active != -1:
             self.show_baseimg_selected()
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +4 -0
+        else:
+            # Set a indicator text to combo store when first open
+            self.image_combo.insert_text(0, self.__dummy_image__)
+            self.image_combo.set_active(0)
 
         self._image_combo_connect_signal()
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +0 -1
index 6bc9c16..5164999 100755
@@ -219,7 +219,7 @@ class RecipeSelectionPage (HobPage):
         self.refresh_selection()
         if not self.builder.customized:
             self.builder.customized = True
-            self.builder.configuration.selected_image =

self.recipe_model.__dummy_image__
+ self.builder.configuration.selected_image =
+ self.recipe_model.__custom_image__
self.builder.rcppkglist_populated()

self.builder.window_sensitive(True)
--
1.7.5.4

_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel

#4 lore raw

Re: [PATCH 2/3] Hob: add '--select a machine--' and '--select a base image--' to GUI

I will followed your advice to change it. Thanks!

-----Original Message-----
From: Xu, Dongxiao
Sent: Wednesday, May 16, 2012 2:36 PM
To: An, LimingX L; [email protected]
Subject: RE: [bitbake-devel] [PATCH 2/3] Hob: add '--select a machine--' and '--select a base image--' to GUI

Hi Liming,

I simply tried this patch, and I saw the "--select a base image--" is listed in the bottom part of the combo menu.

I think it should be the first one?

Thanks,
Dongxiao

Quoted 238 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Liming An
Sent: Monday, May 14, 2012 8:52 PM
To: [email protected]
Subject: [bitbake-devel] [PATCH 2/3] Hob: add '--select a machine--' and '--select a base image--' to GUI

[YOCTO #2175]

---
 bitbake/lib/bb/ui/crumbs/builder.py                |    6 ++--
 bitbake/lib/bb/ui/crumbs/hoblistmodel.py           |    6 ++--
 bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py |   35
+++++++++++++++----
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py    |    2 +-
 4 files changed, 34 insertions(+), 15 deletions(-)
bitbake/lib/bb/ui/crumbs/builder.py +0 -1
index 42d0f2c..eb60b89 100755
@@ -438,7 +438,7 @@ class Builder(gtk.Window):
         toolchain_packages = []
         if self.configuration.toolchain_build:
             toolchain_packages =
 self.package_model.get_selected_packages_toolchain()
-        if self.configuration.selected_image ==

self.recipe_model.__dummy_image__:
+ if self.configuration.selected_image ==
self.recipe_model.__custom_image__:
packages = self.package_model.get_selected_packages() image = self.hob_image
else:

bitbake/lib/bb/ui/crumbs/builder.py +1 -1
@@ -752,7 +752,7 @@ class Builder(gtk.Window):
             fraction = 1.0
             self.parameters.image_names = []
             selected_image = self.recipe_model.get_selected_image()
-            if selected_image == self.recipe_model.__dummy_image__:
+            if selected_image == self.recipe_model.__custom_image__:
                 linkname = 'hob-image-' + self.configuration.curr_mach
             else:
                 linkname = selected_image + '-' + 

self.configuration.curr_mach @@ -890,7 +890,7 @@ class Builder(gtk.Window):
selected_packages =
self.package_model.get_selected_packages()
or []

# If no base image and no selected packages don't build anything
- if not (selected_packages or selected_image !=
self.recipe_model.__dummy_image__):
+ if not (selected_packages or selected_image !=
self.recipe_model.__custom_image__):
lbl = "<b>No selections made</b>\nYou have not made any
selections"
lbl = lbl + " so there isn't anything to bake at this time." dialog = CrumbsMessageDialog(self, lbl,
gtk.STOCK_DIALOG_INFO) diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 0b54f91..37cee78 100644

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +0 -0
@@ -456,7 +456,7 @@ class RecipeListModel(gtk.ListStore):
     """
     (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, 

COL_TYPE, COL_INC, COL_IMG, COL_INSTALL, COL_PN, COL_FADE_INC) = range(12)

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +2 -3
-    __dummy_image__ = "Create your own image"
+    __custom_image__ = "Create your own image"
 
     __gsignals__ = {
         "recipe-selection-changed" : (gobject.SIGNAL_RUN_LAST, @@
-565,14 +565,14 @@ class RecipeListModel(gtk.ListStore):
         self.clear()
 
         # dummy image for prompt
-        self.set(self.append(), self.COL_NAME, self.__dummy_image__,
+        self.set(self.append(), self.COL_NAME, self.__custom_image__,
                  self.COL_DESC, "Use the 'View recipes' and 'View 

packages' " \
"options to select what you want to
include " \
"in your image.",
self.COL_LIC, "", self.COL_GROUP, "", self.COL_DEPS, "", self.COL_BINB, "", self.COL_TYPE, "image", self.COL_INC, False,
- self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN,
self.__dummy_image__)

bitbake/lib/bb/ui/crumbs/hoblistmodel.py +2 -0
+                 self.COL_IMG, False, self.COL_INSTALL, "", 
+ self.COL_PN, self.__custom_image__)
 
         for item in event_model["pn"]:
             name = item
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +0 -0
index 7d19912..51594b3 100644
@@ -33,6 +33,9 @@ from bb.ui.crumbs.hobpages import HobPage  #  class 

ImageConfigurationPage (HobPage):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+    __dummy_machine__ = "--select a machine--"
+    __dummy_image__   = "--select a base image--"
+
     def __init__(self, builder):
         super(ImageConfigurationPage, self).__init__(builder, "Image

configuration")

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -1
@@ -261,9 +264,15 @@ class ImageConfigurationPage (HobPage):
 
     def machine_combo_changed_cb(self, machine_combo):
         combo_item = machine_combo.get_active_text()
-        if not combo_item:
+        if not combo_item or combo_item == self.__dummy_machine__:
             return
 
+        # remove __dummy_machine__ item from the store list after 
+ first

user selection

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+        # because it is no longer valid
+        combo_store = machine_combo.get_model()
+        if len(combo_store) and (combo_store[0][0] ==

self.__dummy_machine__):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +8 -4
+            machine_combo.remove_text(0)
+
         self.builder.configuration.curr_mach = combo_item
         if self.machine_combo_changed_by_manual:
             self.builder.configuration.clear_selection()
@@ -274,13 +283,13 @@ class ImageConfigurationPage (HobPage):
         self.builder.populate_recipe_package_info_async()
 
     def update_machine_combo(self):
-        all_machines = self.builder.parameters.all_machines
+        all_machines = [self.__dummy_machine__] + 
+ self.builder.parameters.all_machines
 
         model = self.machine_combo.get_model()
         model.clear()
         for machine in all_machines:
             self.machine_combo.append_text(machine)
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def switch_machine_combo(self):
         self.machine_combo_changed_by_manual = False @@ -291,7
+300,7 @@ class ImageConfigurationPage (HobPage):
                 self.machine_combo.set_active(active)
                 return
             active += 1
-        self.machine_combo.set_active(-1)
+        self.machine_combo.set_active(0)
 
     def update_image_desc(self, selected_image):
         desc = ""
@@ -311,9 +320,15 @@ class ImageConfigurationPage (HobPage):
     def image_combo_changed_cb(self, combo):
         self.builder.window_sensitive(False)
         selected_image = self.image_combo.get_active_text()
-        if not selected_image:
+        if not selected_image or (selected_image ==

self.__dummy_image__):
return

+ # remove __dummy_image__ item from the store list after first
user selection

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +3 -0
+        # because it is no longer valid
+        combo_store = combo.get_model()
+        if len(combo_store) and (combo_store[0][0] ==

self.__dummy_image__):

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +2 -1
+            combo.remove_text(0)
+
         self.builder.customized = False
 
         selected_recipes = []
@@ -356,14 +371,14 @@ class ImageConfigurationPage (HobPage):
             path = image_model.get_path(it)
             it = image_model.iter_next(it)
             image_name = image_model[path][recipe_model.COL_NAME]
-            if image_name ==

self.builder.recipe_model.__dummy_image__:
+ if image_name ==
self.builder.recipe_model.__custom_image__:
continue
self.image_combo.append_text(image_name)
if image_name == selected_image:
active = cnt
cnt = cnt + 1
- self.image_combo.append_text(self.builder.recipe_model.__dummy_image__)

bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +1 -1
-        if selected_image == self.builder.recipe_model.__dummy_image__:
+

self.image_combo.append_text(self.builder.recipe_model.__custom_image_ _)
+ if selected_image == self.builder.recipe_model.__custom_image__:
active = cnt

self.image_combo.set_active(-1) @@ -371,6 +386,10 @@ class
ImageConfigurationPage (HobPage):

         if active != -1:
             self.show_baseimg_selected()
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +4 -0
+        else:
+            # Set a indicator text to combo store when first open
+            self.image_combo.insert_text(0, self.__dummy_image__)
+            self.image_combo.set_active(0)
 
         self._image_combo_connect_signal()
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +0 -1
index 6bc9c16..5164999 100755
@@ -219,7 +219,7 @@ class RecipeSelectionPage (HobPage):
         self.refresh_selection()
         if not self.builder.customized:
             self.builder.customized = True
-            self.builder.configuration.selected_image =

self.recipe_model.__dummy_image__
+ self.builder.configuration.selected_image =
+ self.recipe_model.__custom_image__
self.builder.rcppkglist_populated()

self.builder.window_sensitive(True)
--
1.7.5.4

_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel

author
#5 lore raw

PATCH 3/3 Hob:add function about clicked a row to load image file for 'my images' page

In reply to Liming An

[YOCTO #2238]

---
 bitbake/lib/bb/ui/crumbs/hig.py |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/crumbs/hig.py +16 -2
index 4baf960..721d145 100644
@@ -1073,12 +1073,13 @@ class ImageSelectionDialog (CrumbsDialog):
         self.image_table = HobViewTable(self.__columns__)
         self.image_table.set_size_request(-1, 300)
         self.image_table.connect("toggled", self.toggled_cb)
+        self.image_table.connect_group_selection(self.table_selected_cb)
+        self.image_table.connect("row-activated", self.row_actived_cb)
         self.vbox.pack_start(self.image_table, expand=True, fill=True)
 
         self.show_all()
 
-    def toggled_cb(self, table, cell, path, columnid, tree):
-        model = tree.get_model()
+    def change_image_cb(self, model, path, columnid):
         if not model:
             return
         iter = model.get_iter_first()
@@ -1089,6 +1090,19 @@ class ImageSelectionDialog (CrumbsDialog):
 
         model[path][columnid] = True
 
+    def toggled_cb(self, table, cell, path, columnid, tree):
+        model = tree.get_model()
+        self.change_image_cb(model, path, columnid)
+
+    def table_selected_cb(self, selection):
+        model, paths = selection.get_selected_rows()
+        if paths:
+            self.change_image_cb(model, paths[0], 1)
+
+    def row_actived_cb(self, tab, model, path):
+        self.change_image_cb(model, path, 1)
+        self.emit('response', gtk.RESPONSE_YES)
+
     def select_path_cb(self, action, parent, entry):
         dialog = gtk.FileChooserDialog("", parent,
                                        gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
Signature · 1 line
1.7.5.4
#6 lore raw
In reply to Liming An
Quoted 8 lines · Liming An

The following changes since commit 12b4543ac9f54c0db0ee4a7ee546a71946a051f8:

classes/rootfs_*: fix splitting package dependency strings (2012-05-13 20:09:56 +0100)

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

Quoted 6 lines

Liming An (3):
Hob: apply a line length to consistantly across 'base image'
descriptions
Hob: add '--select a machine--' and '--select a base image--' to GUI Hob:add function about clicked a row to load image file for 'my
images' page

I took patches 1 and 3, I did not take the second item above. Please resend with the change Dongxiao suggested.

Cheers,

Richard