From da34a8db498a4a332e807f20feee961a99aad004 Mon Sep 17 00:00:00 2001 From: Cristiana Voicu Date: Wed, 22 May 2013 12:52:34 +0300 Subject: bitbake: hob: apply a fade out animation when deselecting from tables -applied a fade out mechanism for deselctiong on all the tabs of recipes and packages list page -set cursor on the package/recipe when it is included(important when the its place is changing; like when the tree si order by included tab) [YOCTO #4342] (Bitbake rev: 8bd0e0681a6a39c00accbfc0041ab248993f3877) Signed-off-by: Cristiana Voicu Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 24 ++++++-------- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 40 ++++++++++++------------ 2 files changed, 30 insertions(+), 34 deletions(-) (limited to 'bitbake/lib/bb/ui') diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py index 0cac92f026..b4cd47f9da 100755 --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py @@ -150,12 +150,8 @@ class PackageSelectionPage (HobPage): sort_model = self.package_model.tree_model(filter, initial=True) tab.set_model(sort_model) tab.connect("toggled", self.table_toggled_cb, name) - if name == "Included packages": - tab.connect("button-release-event", self.button_click_cb) - tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) - if name == "All packages": - tab.connect("button-release-event", self.button_click_cb) - tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) + tab.connect("button-release-event", self.button_click_cb) + tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter) self.ins.append_page(tab, page['name'], page['tooltip']) self.tables.append(tab) @@ -290,12 +286,9 @@ class PackageSelectionPage (HobPage): if not self.package_model.path_included(path): self.package_model.include_item(item_path=path, binb="User Selected") else: - if pagename == "Included packages": - self.pre_fadeout_checkout_include(view_tree) - self.package_model.exclude_item(item_path=path) - self.render_fadeout(view_tree, cell) - else: - self.package_model.exclude_item(item_path=path) + self.pre_fadeout_checkout_include(view_tree) + self.package_model.exclude_item(item_path=path) + self.render_fadeout(view_tree, cell) self.refresh_selection() if not self.builder.customized: @@ -305,6 +298,9 @@ class PackageSelectionPage (HobPage): self.builder.rcppkglist_populated() self.builder.window_sensitive(True) + view_model = view_tree.get_model() + vpath = self.package_model.convert_path_to_vpath(view_model, path) + view_tree.set_cursor(vpath) def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename): # Click to include a package @@ -344,8 +340,8 @@ class PackageSelectionPage (HobPage): cell.fadeout(tree, 1000, to_render_cells) - def after_fadeout_checkin_include(self, table, ctrl, cell, tree): - tree.set_model(self.package_model.tree_model(self.pages[0]['filter'])) + def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter): + tree.set_model(self.package_model.tree_model(filter)) tree.expand_all() def set_packages_curr_tab(self, curr_page): diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py index 9c138b2d66..ffe310aa81 100755 --- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py @@ -162,15 +162,8 @@ class RecipeSelectionPage (HobPage): sort_model = self.recipe_model.tree_model(filter, initial=True) tab.set_model(sort_model) tab.connect("toggled", self.table_toggled_cb, name) - if name == "Included recipes": - tab.connect("button-release-event", self.button_click_cb) - tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) - if name == "Package Groups": - tab.connect("button-release-event", self.button_click_cb) - tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) - if name == "All recipes": - tab.connect("button-release-event", self.button_click_cb) - tab.connect("cell-fadeinout-stopped", self.button_click_cb) + tab.connect("button-release-event", self.button_click_cb) + tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter) self.ins.append_page(tab, page['name'], page['tooltip']) self.tables.append(tab) @@ -270,12 +263,9 @@ class RecipeSelectionPage (HobPage): if not self.recipe_model.path_included(path): self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False) else: - if pagename == "Included recipes": - self.pre_fadeout_checkout_include(view_tree) - self.recipe_model.exclude_item(item_path=path) - self.render_fadeout(view_tree, cell) - else: - self.recipe_model.exclude_item(item_path=path) + self.pre_fadeout_checkout_include(view_tree, pagename) + self.recipe_model.exclude_item(item_path=path) + self.render_fadeout(view_tree, cell) self.refresh_selection() if not self.builder.customized: @@ -285,6 +275,10 @@ class RecipeSelectionPage (HobPage): self.builder.window_sensitive(True) + view_model = view_tree.get_model() + vpath = self.recipe_model.convert_path_to_vpath(view_model, path) + view_tree.set_cursor(vpath) + def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename): # Click to include a recipe self.builder.window_sensitive(False) @@ -292,7 +286,7 @@ class RecipeSelectionPage (HobPage): path = self.recipe_model.convert_vpath_to_path(view_model, view_path) glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename) - def pre_fadeout_checkout_include(self, tree): + def pre_fadeout_checkout_include(self, tree, pagename): #resync the included items to a backup fade include column it = self.recipe_model.get_iter_first() while it: @@ -301,8 +295,14 @@ class RecipeSelectionPage (HobPage): it = self.recipe_model.iter_next(it) # Check out a model which base on the column COL_FADE_INC, # it's save the prev state of column COL_INC before do exclude_item - filter = { RecipeListModel.COL_FADE_INC : [True], - RecipeListModel.COL_TYPE : ['recipe', 'packagegroup'] } + filter = { RecipeListModel.COL_FADE_INC:[True] } + if pagename == "Included recipes": + filter[RecipeListModel.COL_TYPE] = ['recipe', 'packagegroup'] + elif pagename == "All recipes": + filter[RecipeListModel.COL_TYPE] = ['recipe'] + else: + filter[RecipeListModel.COL_TYPE] = ['packagegroup'] + new_model = self.recipe_model.tree_model(filter, excluded_items_ahead=True) tree.set_model(new_model) @@ -322,8 +322,8 @@ class RecipeSelectionPage (HobPage): cell.fadeout(tree, 1000, to_render_cells) - def after_fadeout_checkin_include(self, table, ctrl, cell, tree): - tree.set_model(self.recipe_model.tree_model(self.pages[0]['filter'])) + def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter): + tree.set_model(self.recipe_model.tree_model(filter)) def set_recipe_curr_tab(self, curr_page): self.ins.set_current_page(curr_page) -- cgit v1.2.3-54-g00ecf