summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/hobprefs.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-22 21:47:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-25 12:54:16 +0100
commit9adf01d7be1c2fedfb71975619af60e8af2fe3f2 (patch)
tree53400442ad225eda2e3ce80544b89100014f13fc /bitbake/lib/bb/ui/crumbs/hobprefs.py
parent1f4e6d62f2002faf57c2f273707141d0192dc5cd (diff)
downloadpoky-9adf01d7be1c2fedfb71975619af60e8af2fe3f2.tar.gz
hob: rework image output type setting
The preferences UI to set the image output type only supported setting a single value whereas it's common practice, particularly for those making use of the ADT, to set multiple values. This is also the default in Poky. This reworked preferences UI dynamically generates check boxes for each available image type and sets an appropriate string representing all image types when checkboxes are toggled. Includes fixes for [YOCTO #1273] (Bitbake rev: f7f68847dd165f2ad0f39011db4ebfef3ae73f42) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hobprefs.py')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobprefs.py50
1 files changed, 30 insertions, 20 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobprefs.py b/bitbake/lib/bb/ui/crumbs/hobprefs.py
index ab2f0d87fe..1e6c78b435 100644
--- a/bitbake/lib/bb/ui/crumbs/hobprefs.py
+++ b/bitbake/lib/bb/ui/crumbs/hobprefs.py
@@ -30,11 +30,15 @@ class HobPrefs(gtk.Dialog):
30 if model: 30 if model:
31 model.clear() 31 model.clear()
32 32
33 def output_type_changed_cb(self, combo, handler): 33 def output_type_toggled_cb(self, check, handler):
34 ot = combo.get_active_text() 34 ot = check.get_label()
35 if ot != self.curr_output_type: 35 enabled = check.get_active()
36 self.curr_output_type = ot 36 if enabled:
37 handler.set_image_output_type(ot) 37 self.selected_image_types = handler.add_image_output_type(ot)
38 else:
39 self.selected_image_types = handler.remove_image_output_type(ot)
40
41 self.configurator.setLocalConfVar('IMAGE_FSTYPES', "%s" % self.selected_image_types)
38 42
39 def sdk_machine_combo_changed_cb(self, combo, handler): 43 def sdk_machine_combo_changed_cb(self, combo, handler):
40 sdk_mach = combo.get_active_text() 44 sdk_mach = combo.get_active_text()
@@ -144,7 +148,7 @@ class HobPrefs(gtk.Dialog):
144 glib.idle_add(self.handler.reload_data) 148 glib.idle_add(self.handler.reload_data)
145 149
146 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass, 150 def __init__(self, configurator, handler, curr_sdk_mach, curr_distro, pclass,
147 cpu_cnt, pmake, bbthread, image_types): 151 cpu_cnt, pmake, bbthread, selected_image_types, all_image_types):
148 """ 152 """
149 """ 153 """
150 gtk.Dialog.__init__(self, "Preferences", None, 154 gtk.Dialog.__init__(self, "Preferences", None,
@@ -162,7 +166,6 @@ class HobPrefs(gtk.Dialog):
162 self.curr_sdk_mach = curr_sdk_mach 166 self.curr_sdk_mach = curr_sdk_mach
163 self.curr_distro = curr_distro 167 self.curr_distro = curr_distro
164 self.curr_package_format = pclass 168 self.curr_package_format = pclass
165 self.curr_output_type = None
166 self.cpu_cnt = cpu_cnt 169 self.cpu_cnt = cpu_cnt
167 self.pmake = pmake 170 self.pmake = pmake
168 self.bbthread = bbthread 171 self.bbthread = bbthread
@@ -170,6 +173,7 @@ class HobPrefs(gtk.Dialog):
170 self.distro_handler_id = None 173 self.distro_handler_id = None
171 self.sdk_machine_handler_id = None 174 self.sdk_machine_handler_id = None
172 self.package_handler_id = None 175 self.package_handler_id = None
176 self.selected_image_types = selected_image_types.split(" ")
173 177
174 left = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 178 left = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
175 right = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 179 right = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
@@ -214,19 +218,25 @@ class HobPrefs(gtk.Dialog):
214 of the root filesystem and also dictates the package manager used in your image""") 218 of the root filesystem and also dictates the package manager used in your image""")
215 self.package_combo.show() 219 self.package_combo.show()
216 hbox.pack_start(self.package_combo, expand=False, fill=False, padding=6) 220 hbox.pack_start(self.package_combo, expand=False, fill=False, padding=6)
217 # Image output type selector 221 if all_image_types:
218 label = gtk.Label("Image output type:") 222 # Image output type selector
219 label.show() 223 label = gtk.Label("Image output types:")
220 hbox.pack_start(label, expand=False, fill=False, padding=6) 224 label.show()
221 output_combo = gtk.combo_box_new_text() 225 hbox.pack_start(label, expand=False, fill=False, padding=6)
222 if image_types: 226 chk_cnt = 3
223 for it in image_types.split(" "): 227 for it in all_image_types.split(" "):
224 output_combo.append_text(it) 228 chk_cnt = chk_cnt + 1
225 output_combo.connect("changed", self.output_type_changed_cb, handler) 229 if chk_cnt % 6 == 0:
226 else: 230 hbox = gtk.HBox(False, 12)
227 output_combo.set_sensitive(False) 231 hbox.show()
228 output_combo.show() 232 pbox.pack_start(hbox, expand=False, fill=False, padding=6)
229 hbox.pack_start(output_combo) 233 chk = gtk.CheckButton(it)
234 if it in self.selected_image_types:
235 chk.set_active(True)
236 chk.set_tooltip_text("Build an %s image" % it)
237 chk.connect("toggled", self.output_type_toggled_cb, handler)
238 chk.show()
239 hbox.pack_start(chk, expand=False, fill=False, padding=3)
230 # BitBake 240 # BitBake
231 label = gtk.Label() 241 label = gtk.Label()
232 label.set_markup("<b>BitBake</b>") 242 label.set_markup("<b>BitBake</b>")