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>
This commit is contained in:
Joshua Lock
2011-07-22 21:47:00 -07:00
committed by Richard Purdie
parent 1f4e6d62f2
commit 9adf01d7be
4 changed files with 56 additions and 26 deletions

View File

@@ -74,6 +74,8 @@ class HobHandler(gobject.GObject):
self.model = taskmodel
self.server = server
self.image_output_types = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]).split(" ")
self.command_map = {
"findConfigFilePathLocal" : ("findConfigFilePath", ["hob.local.conf"], "findConfigFilePathHobLocal"),
"findConfigFilePathHobLocal" : ("findConfigFilePath", ["bblayers.conf"], "findConfigFilePathLayers"),
@@ -258,8 +260,23 @@ class HobHandler(gobject.GObject):
self.building = None
self.emit("build-complete")
def set_image_output_type(self, output_type):
self.server.runCommand(["setVariable", "IMAGE_FSTYPES", output_type])
def set_fstypes(self, fstypes):
self.server.runCommand(["setVariable", "IMAGE_FSTYPES", fstypes])
def add_image_output_type(self, output_type):
if output_type not in self.image_output_types:
self.image_output_types.append(output_type)
fstypes = " ".join(self.image_output_types)
self.set_fstypes(fstypes)
return fstypes
def remove_image_output_type(self, output_type):
if output_type in self.image_output_types:
ind = self.image_output_types.index(output_type)
self.image_output_types.pop(ind)
fstypes = " ".join(self.image_output_types)
self.set_fstypes(fstypes)
return fstypes
def get_image_deploy_dir(self):
return self.server.runCommand(["getVariable", "DEPLOY_DIR_IMAGE"])