From 9adf01d7be1c2fedfb71975619af60e8af2fe3f2 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Fri, 22 Jul 2011 21:47:00 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py') diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index fa79e0c7a2..2f45350c32 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py @@ -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"]) -- cgit v1.2.3-54-g00ecf