summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-05-22 12:52:35 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-22 16:25:11 +0100
commit3216f00f86624a935008e7fbca0af55307318c91 (patch)
tree154fc2761b76a60e27c4a5b5fac03739cf8f80eb
parentda34a8db498a4a332e807f20feee961a99aad004 (diff)
downloadpoky-3216f00f86624a935008e7fbca0af55307318c91.tar.gz
bitbake: hob: Table sorting criteria should not change after deselecting recipes/packages
After a recipe/package is deselected, the table is sorted as before the fadeout animation. [YOCTO #4453] (Bitbake rev: d4968eac539f777367ab1243a1049117cb261176) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py20
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py8
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py6
3 files changed, 27 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 887be791dc..7f7d82f86b 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -63,6 +63,7 @@ class PackageListModel(gtk.ListStore):
63 gobject.TYPE_BOOLEAN, 63 gobject.TYPE_BOOLEAN,
64 gobject.TYPE_STRING, 64 gobject.TYPE_STRING,
65 gobject.TYPE_STRING) 65 gobject.TYPE_STRING)
66 self.sort_column_id, self.sort_order = PackageListModel.COL_NAME, gtk.SORT_ASCENDING
66 67
67 """ 68 """
68 Find the model path for the item_name 69 Find the model path for the item_name
@@ -109,11 +110,11 @@ class PackageListModel(gtk.ListStore):
109 model.set_visible_func(self.tree_model_filter, filter) 110 model.set_visible_func(self.tree_model_filter, filter)
110 111
111 sort = gtk.TreeModelSort(model) 112 sort = gtk.TreeModelSort(model)
113 sort.connect ('sort-column-changed', self.sort_column_changed_cb)
112 if initial: 114 if initial:
113 sort.set_sort_column_id(PackageListModel.COL_NAME, gtk.SORT_ASCENDING) 115 sort.set_sort_column_id(PackageListModel.COL_NAME, gtk.SORT_ASCENDING)
114 sort.set_default_sort_func(None) 116 sort.set_default_sort_func(None)
115 117 elif excluded_items_ahead:
116 if excluded_items_ahead:
117 sort.set_default_sort_func(self.exclude_item_sort_func, search_data) 118 sort.set_default_sort_func(self.exclude_item_sort_func, search_data)
118 elif included_items_ahead: 119 elif included_items_ahead:
119 sort.set_default_sort_func(self.include_item_sort_func, search_data) 120 sort.set_default_sort_func(self.include_item_sort_func, search_data)
@@ -121,7 +122,7 @@ class PackageListModel(gtk.ListStore):
121 if search_data and search_data!='Search recipes by name' and search_data!='Search package groups by name': 122 if search_data and search_data!='Search recipes by name' and search_data!='Search package groups by name':
122 sort.set_default_sort_func(self.sort_func, search_data) 123 sort.set_default_sort_func(self.sort_func, search_data)
123 else: 124 else:
124 sort.set_sort_column_id(PackageListModel.COL_NAME, gtk.SORT_ASCENDING) 125 sort.set_sort_column_id(self.sort_column_id, self.sort_order)
125 sort.set_default_sort_func(None) 126 sort.set_default_sort_func(None)
126 127
127 sort.set_sort_func(PackageListModel.COL_INC, self.sort_column, PackageListModel.COL_INC) 128 sort.set_sort_func(PackageListModel.COL_INC, self.sort_column, PackageListModel.COL_INC)
@@ -130,6 +131,9 @@ class PackageListModel(gtk.ListStore):
130 sort.set_sort_func(PackageListModel.COL_RCP, self.sort_column, PackageListModel.COL_RCP) 131 sort.set_sort_func(PackageListModel.COL_RCP, self.sort_column, PackageListModel.COL_RCP)
131 return sort 132 return sort
132 133
134 def sort_column_changed_cb (self, data):
135 self.sort_column_id, self.sort_order = data.get_sort_column_id ()
136
133 def sort_column(self, model, row1, row2, col): 137 def sort_column(self, model, row1, row2, col):
134 value1 = model.get_value(row1, col) 138 value1 = model.get_value(row1, col)
135 value2 = model.get_value(row2, col) 139 value2 = model.get_value(row2, col)
@@ -501,6 +505,7 @@ class RecipeListModel(gtk.ListStore):
501 gobject.TYPE_STRING, 505 gobject.TYPE_STRING,
502 gobject.TYPE_STRING, 506 gobject.TYPE_STRING,
503 gobject.TYPE_STRING) 507 gobject.TYPE_STRING)
508 self.sort_column_id, self.sort_order = RecipeListModel.COL_NAME, gtk.SORT_ASCENDING
504 509
505 """ 510 """
506 Find the model path for the item_name 511 Find the model path for the item_name
@@ -586,11 +591,11 @@ class RecipeListModel(gtk.ListStore):
586 model.set_visible_func(self.tree_model_filter, filter) 591 model.set_visible_func(self.tree_model_filter, filter)
587 592
588 sort = gtk.TreeModelSort(model) 593 sort = gtk.TreeModelSort(model)
594 sort.connect ('sort-column-changed', self.sort_column_changed_cb)
589 if initial: 595 if initial:
590 sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING) 596 sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING)
591 sort.set_default_sort_func(None) 597 sort.set_default_sort_func(None)
592 598 elif excluded_items_ahead:
593 if excluded_items_ahead:
594 sort.set_default_sort_func(self.exclude_item_sort_func, search_data) 599 sort.set_default_sort_func(self.exclude_item_sort_func, search_data)
595 elif included_items_ahead: 600 elif included_items_ahead:
596 sort.set_default_sort_func(self.include_item_sort_func, search_data) 601 sort.set_default_sort_func(self.include_item_sort_func, search_data)
@@ -598,7 +603,7 @@ class RecipeListModel(gtk.ListStore):
598 if search_data and search_data!='Search recipes by name' and search_data!='Search package groups by name': 603 if search_data and search_data!='Search recipes by name' and search_data!='Search package groups by name':
599 sort.set_default_sort_func(self.sort_func, search_data) 604 sort.set_default_sort_func(self.sort_func, search_data)
600 else: 605 else:
601 sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING) 606 sort.set_sort_column_id(self.sort_column_id, self.sort_order)
602 sort.set_default_sort_func(None) 607 sort.set_default_sort_func(None)
603 608
604 sort.set_sort_func(RecipeListModel.COL_INC, self.sort_column, RecipeListModel.COL_INC) 609 sort.set_sort_func(RecipeListModel.COL_INC, self.sort_column, RecipeListModel.COL_INC)
@@ -607,6 +612,9 @@ class RecipeListModel(gtk.ListStore):
607 sort.set_sort_func(RecipeListModel.COL_LIC, self.sort_column, RecipeListModel.COL_LIC) 612 sort.set_sort_func(RecipeListModel.COL_LIC, self.sort_column, RecipeListModel.COL_LIC)
608 return sort 613 return sort
609 614
615 def sort_column_changed_cb (self, data):
616 self.sort_column_id, self.sort_order = data.get_sort_column_id ()
617
610 def sort_column(self, model, row1, row2, col): 618 def sort_column(self, model, row1, row2, col):
611 value1 = model.get_value(row1, col) 619 value1 = model.get_value(row1, col)
612 value2 = model.get_value(row2, col) 620 value2 = model.get_value(row2, col)
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index b4cd47f9da..70caa48e79 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -310,11 +310,15 @@ class PackageSelectionPage (HobPage):
310 glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename) 310 glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename)
311 311
312 def pre_fadeout_checkout_include(self, tree): 312 def pre_fadeout_checkout_include(self, tree):
313 #after the fadeout the table will be sorted as before
314 self.sort_column_id = self.package_model.sort_column_id
315 self.sort_order = self.package_model.sort_order
316
313 self.package_model.resync_fadeout_column(self.package_model.get_iter_first()) 317 self.package_model.resync_fadeout_column(self.package_model.get_iter_first())
314 # Check out a model which base on the column COL_FADE_INC, 318 # Check out a model which base on the column COL_FADE_INC,
315 # it's save the prev state of column COL_INC before do exclude_item 319 # it's save the prev state of column COL_INC before do exclude_item
316 filter = { PackageListModel.COL_FADE_INC : [True]} 320 filter = { PackageListModel.COL_FADE_INC : [True]}
317 new_model = self.package_model.tree_model(filter) 321 new_model = self.package_model.tree_model(filter, excluded_items_ahead=True)
318 tree.set_model(new_model) 322 tree.set_model(new_model)
319 tree.expand_all() 323 tree.expand_all()
320 324
@@ -341,6 +345,8 @@ class PackageSelectionPage (HobPage):
341 cell.fadeout(tree, 1000, to_render_cells) 345 cell.fadeout(tree, 1000, to_render_cells)
342 346
343 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter): 347 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter):
348 self.package_model.sort_column_id = self.sort_column_id
349 self.package_model.sort_order = self.sort_order
344 tree.set_model(self.package_model.tree_model(filter)) 350 tree.set_model(self.package_model.tree_model(filter))
345 tree.expand_all() 351 tree.expand_all()
346 352
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index ffe310aa81..58db43f706 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -287,6 +287,10 @@ class RecipeSelectionPage (HobPage):
287 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)
288 288
289 def pre_fadeout_checkout_include(self, tree, pagename): 289 def pre_fadeout_checkout_include(self, tree, pagename):
290 #after the fadeout the table will be sorted as before
291 self.sort_column_id = self.recipe_model.sort_column_id
292 self.sort_order = self.recipe_model.sort_order
293
290 #resync the included items to a backup fade include column 294 #resync the included items to a backup fade include column
291 it = self.recipe_model.get_iter_first() 295 it = self.recipe_model.get_iter_first()
292 while it: 296 while it:
@@ -323,6 +327,8 @@ class RecipeSelectionPage (HobPage):
323 cell.fadeout(tree, 1000, to_render_cells) 327 cell.fadeout(tree, 1000, to_render_cells)
324 328
325 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter): 329 def after_fadeout_checkin_include(self, table, ctrl, cell, tree, filter):
330 self.recipe_model.sort_column_id = self.sort_column_id
331 self.recipe_model.sort_order = self.sort_order
326 tree.set_model(self.recipe_model.tree_model(filter)) 332 tree.set_model(self.recipe_model.tree_model(filter))
327 333
328 def set_recipe_curr_tab(self, curr_page): 334 def set_recipe_curr_tab(self, curr_page):