From: Constantin Musca Date: Mon, 1 Oct 2012 11:03:22 +0000 (+0300) Subject: bitbake: hob: Fix 'User selected' tag functionality X-Git-Tag: rev_ivi_2015_02_04~15295 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31a420c426bfb7a94cb6c5688e1aee6d58b1830c;p=scm%2Fbb%2Ftizen-distro.git bitbake: hob: Fix 'User selected' tag functionality - the 'User selected' tag is only used when the user selects a package - fix hob to remember which packages are 'User selected' - if the package is already brought in by some other package, it should not appear as 'User selected' [YOCTO #3108] (Bitbake rev: 2391e9ba7034d4f90bafa5732d8efa8166f69950) Signed-off-by: Constantin Musca Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index fd555b0..6ddc5b6 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -127,6 +127,7 @@ class Configuration: self.selected_recipes = [] self.selected_packages = [] self.initial_selected_packages = [] + self.initial_user_selected_packages = [] def split_proxy(self, protocol, proxy): entry = [] @@ -576,6 +577,7 @@ class Builder(gtk.Window): self.handler.generate_packages(all_recipes, self.configuration.default_task) def restore_initial_selected_packages(self): + self.package_model.set_selected_packages(self.configuration.initial_user_selected_packages, True) self.package_model.set_selected_packages(self.configuration.initial_selected_packages) for package in self.configuration.selected_packages: if package not in self.configuration.initial_selected_packages: @@ -709,6 +711,7 @@ class Builder(gtk.Window): elif next_step == self.PACKAGE_SELECTION: self.configuration.initial_selected_packages = self.configuration.selected_packages + self.configuration.initial_user_selected_packages = self.configuration.user_selected_packages self.package_details_page.set_title("Edit packages") if self.recipe_model.get_selected_image() == self.recipe_model.__custom_image__: self.package_details_page.set_packages_curr_tab(self.package_details_page.ALL) @@ -782,7 +785,10 @@ class Builder(gtk.Window): self.recipe_model.set_selected_image(selected_image) self.recipe_model.set_selected_recipes(selected_recipes) - def update_package_model(self, selected_packages): + def update_package_model(self, selected_packages, user_selected_packages=None): + if user_selected_packages: + left = self.package_model.set_selected_packages(user_selected_packages, True) + self.configuration.user_selected_packages += left left = self.package_model.set_selected_packages(selected_packages) self.configuration.selected_packages += left @@ -924,11 +930,12 @@ class Builder(gtk.Window): selected_image = self.configuration.selected_image selected_recipes = self.configuration.selected_recipes[:] selected_packages = self.configuration.selected_packages[:] + user_selected_packages = self.configuration.user_selected_packages[:] self.image_configuration_page.update_image_combo(self.recipe_model, selected_image) self.image_configuration_page.update_image_desc() self.update_recipe_model(selected_image, selected_recipes) - self.update_package_model(selected_packages) + self.update_package_model(selected_packages, user_selected_packages) def recipelist_changed_cb(self, recipe_model): self.recipe_details_page.refresh_selection() diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index fe58adf..3885319 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py @@ -337,13 +337,13 @@ class PackageListModel(gtk.TreeStore): set_selected_packages(), some packages will not be set included. Return the un-set packages list. """ - def set_selected_packages(self, packagelist): + def set_selected_packages(self, packagelist, user_selected=False): left = [] + binb = 'User Selected' if user_selected else '' for pn in packagelist: if pn in self.pkg_path.keys(): path = self.pkg_path[pn] - self.include_item(item_path=path, - binb="User Selected") + self.include_item(item_path=path, binb=binb) else: left.append(pn) @@ -359,7 +359,7 @@ class PackageListModel(gtk.TreeStore): while child_it: if self.get_value(child_it, self.COL_INC): binb = self.get_value(child_it, self.COL_BINB) - if not binb or binb == "User Selected": + if binb == "User Selected": name = self.get_value(child_it, self.COL_NAME) packagelist.append(name) child_it = self.iter_next(child_it)