summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-05-22 12:52:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-22 16:25:10 +0100
commitda34a8db498a4a332e807f20feee961a99aad004 (patch)
treecc2cb8b633c37595adbbf2c0d01a548f4196ccd6
parent25182cd84956ff233f9e364dfe777b18944d0ae8 (diff)
downloadpoky-da34a8db498a4a332e807f20feee961a99aad004.tar.gz
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 <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py24
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py40
2 files changed, 30 insertions, 34 deletions
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):
150 sort_model = self.package_model.tree_model(filter, initial=True) 150 sort_model = self.package_model.tree_model(filter, initial=True)
151 tab.set_model(sort_model) 151 tab.set_model(sort_model)
152 tab.connect("toggled", self.table_toggled_cb, name) 152 tab.connect("toggled", self.table_toggled_cb, name)
153 if name == "Included packages": 153 tab.connect("button-release-event", self.button_click_cb)
154 tab.connect("button-release-event", self.button_click_cb) 154 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter)
155 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
156 if name == "All packages":
157 tab.connect("button-release-event", self.button_click_cb)
158 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
159 self.ins.append_page(tab, page['name'], page['tooltip']) 155 self.ins.append_page(tab, page['name'], page['tooltip'])
160 self.tables.append(tab) 156 self.tables.append(tab)
161 157
@@ -290,12 +286,9 @@ class PackageSelectionPage (HobPage):
290 if not self.package_model.path_included(path): 286 if not self.package_model.path_included(path):
291 self.package_model.include_item(item_path=path, binb="User Selected") 287 self.package_model.include_item(item_path=path, binb="User Selected")
292 else: 288 else:
293 if pagename == "Included packages": 289 self.pre_fadeout_checkout_include(view_tree)
294 self.pre_fadeout_checkout_include(view_tree) 290 self.package_model.exclude_item(item_path=path)
295 self.package_model.exclude_item(item_path=path) 291 self.render_fadeout(view_tree, cell)
296 self.render_fadeout(view_tree, cell)
297 else:
298 self.package_model.exclude_item(item_path=path)
299 292
300 self.refresh_selection() 293 self.refresh_selection()
301 if not self.builder.customized: 294 if not self.builder.customized:
@@ -305,6 +298,9 @@ class PackageSelectionPage (HobPage):
305 self.builder.rcppkglist_populated() 298 self.builder.rcppkglist_populated()
306 299
307 self.builder.window_sensitive(True) 300 self.builder.window_sensitive(True)
301 view_model = view_tree.get_model()
302 vpath = self.package_model.convert_path_to_vpath(view_model, path)
303 view_tree.set_cursor(vpath)
308 304
309 def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename): 305 def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename):
310 # Click to include a package 306 # Click to include a package
@@ -344,8 +340,8 @@ class PackageSelectionPage (HobPage):
344 340
345 cell.fadeout(tree, 1000, to_render_cells) 341 cell.fadeout(tree, 1000, to_render_cells)
346 342
347 def after_fadeout_checkin_include(self, table, ctrl, cell, tree): 343 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter):
348 tree.set_model(self.package_model.tree_model(self.pages[0]['filter'])) 344 tree.set_model(self.package_model.tree_model(filter))
349 tree.expand_all() 345 tree.expand_all()
350 346
351 def set_packages_curr_tab(self, curr_page): 347 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):
162 sort_model = self.recipe_model.tree_model(filter, initial=True) 162 sort_model = self.recipe_model.tree_model(filter, initial=True)
163 tab.set_model(sort_model) 163 tab.set_model(sort_model)
164 tab.connect("toggled", self.table_toggled_cb, name) 164 tab.connect("toggled", self.table_toggled_cb, name)
165 if name == "Included recipes": 165 tab.connect("button-release-event", self.button_click_cb)
166 tab.connect("button-release-event", self.button_click_cb) 166 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter)
167 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
168 if name == "Package Groups":
169 tab.connect("button-release-event", self.button_click_cb)
170 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
171 if name == "All recipes":
172 tab.connect("button-release-event", self.button_click_cb)
173 tab.connect("cell-fadeinout-stopped", self.button_click_cb)
174 self.ins.append_page(tab, page['name'], page['tooltip']) 167 self.ins.append_page(tab, page['name'], page['tooltip'])
175 self.tables.append(tab) 168 self.tables.append(tab)
176 169
@@ -270,12 +263,9 @@ class RecipeSelectionPage (HobPage):
270 if not self.recipe_model.path_included(path): 263 if not self.recipe_model.path_included(path):
271 self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False) 264 self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False)
272 else: 265 else:
273 if pagename == "Included recipes": 266 self.pre_fadeout_checkout_include(view_tree, pagename)
274 self.pre_fadeout_checkout_include(view_tree) 267 self.recipe_model.exclude_item(item_path=path)
275 self.recipe_model.exclude_item(item_path=path) 268 self.render_fadeout(view_tree, cell)
276 self.render_fadeout(view_tree, cell)
277 else:
278 self.recipe_model.exclude_item(item_path=path)
279 269
280 self.refresh_selection() 270 self.refresh_selection()
281 if not self.builder.customized: 271 if not self.builder.customized:
@@ -285,6 +275,10 @@ class RecipeSelectionPage (HobPage):
285 275
286 self.builder.window_sensitive(True) 276 self.builder.window_sensitive(True)
287 277
278 view_model = view_tree.get_model()
279 vpath = self.recipe_model.convert_path_to_vpath(view_model, path)
280 view_tree.set_cursor(vpath)
281
288 def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename): 282 def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename):
289 # Click to include a recipe 283 # Click to include a recipe
290 self.builder.window_sensitive(False) 284 self.builder.window_sensitive(False)
@@ -292,7 +286,7 @@ class RecipeSelectionPage (HobPage):
292 path = self.recipe_model.convert_vpath_to_path(view_model, view_path) 286 path = self.recipe_model.convert_vpath_to_path(view_model, view_path)
293 glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename) 287 glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename)
294 288
295 def pre_fadeout_checkout_include(self, tree): 289 def pre_fadeout_checkout_include(self, tree, pagename):
296 #resync the included items to a backup fade include column 290 #resync the included items to a backup fade include column
297 it = self.recipe_model.get_iter_first() 291 it = self.recipe_model.get_iter_first()
298 while it: 292 while it:
@@ -301,8 +295,14 @@ class RecipeSelectionPage (HobPage):
301 it = self.recipe_model.iter_next(it) 295 it = self.recipe_model.iter_next(it)
302 # Check out a model which base on the column COL_FADE_INC, 296 # Check out a model which base on the column COL_FADE_INC,
303 # it's save the prev state of column COL_INC before do exclude_item 297 # it's save the prev state of column COL_INC before do exclude_item
304 filter = { RecipeListModel.COL_FADE_INC : [True], 298 filter = { RecipeListModel.COL_FADE_INC:[True] }
305 RecipeListModel.COL_TYPE : ['recipe', 'packagegroup'] } 299 if pagename == "Included recipes":
300 filter[RecipeListModel.COL_TYPE] = ['recipe', 'packagegroup']
301 elif pagename == "All recipes":
302 filter[RecipeListModel.COL_TYPE] = ['recipe']
303 else:
304 filter[RecipeListModel.COL_TYPE] = ['packagegroup']
305
306 new_model = self.recipe_model.tree_model(filter, excluded_items_ahead=True) 306 new_model = self.recipe_model.tree_model(filter, excluded_items_ahead=True)
307 tree.set_model(new_model) 307 tree.set_model(new_model)
308 308
@@ -322,8 +322,8 @@ class RecipeSelectionPage (HobPage):
322 322
323 cell.fadeout(tree, 1000, to_render_cells) 323 cell.fadeout(tree, 1000, to_render_cells)
324 324
325 def after_fadeout_checkin_include(self, table, ctrl, cell, tree): 325 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter):
326 tree.set_model(self.recipe_model.tree_model(self.pages[0]['filter'])) 326 tree.set_model(self.recipe_model.tree_model(filter))
327 327
328 def set_recipe_curr_tab(self, curr_page): 328 def set_recipe_curr_tab(self, curr_page):
329 self.ins.set_current_page(curr_page) 329 self.ins.set_current_page(curr_page)