summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py9
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobwidget.py7
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py48
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py37
4 files changed, 41 insertions, 60 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 3de9e5bb56..10b7c55251 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -521,17 +521,24 @@ class RecipeListModel(gtk.ListStore):
521 val2 = model.get_value(iter2, RecipeListModel.COL_INC) 521 val2 = model.get_value(iter2, RecipeListModel.COL_INC)
522 return ((val1 == True) and (val2 == False)) 522 return ((val1 == True) and (val2 == False))
523 523
524 def include_item_sort_func(self, model, iter1, iter2):
525 val1 = model.get_value(iter1, RecipeListModel.COL_INC)
526 val2 = model.get_value(iter2, RecipeListModel.COL_INC)
527 return ((val1 == False) and (val2 == True))
528
524 """ 529 """
525 Create, if required, and return a filtered gtk.TreeModelSort 530 Create, if required, and return a filtered gtk.TreeModelSort
526 containing only the items which are items specified by filter 531 containing only the items which are items specified by filter
527 """ 532 """
528 def tree_model(self, filter, excluded_items_ahead=False): 533 def tree_model(self, filter, excluded_items_ahead=False, included_items_ahead=True):
529 model = self.filter_new() 534 model = self.filter_new()
530 model.set_visible_func(self.tree_model_filter, filter) 535 model.set_visible_func(self.tree_model_filter, filter)
531 536
532 sort = gtk.TreeModelSort(model) 537 sort = gtk.TreeModelSort(model)
533 if excluded_items_ahead: 538 if excluded_items_ahead:
534 sort.set_default_sort_func(self.exclude_item_sort_func) 539 sort.set_default_sort_func(self.exclude_item_sort_func)
540 elif included_items_ahead:
541 sort.set_default_sort_func(self.include_item_sort_func)
535 else: 542 else:
536 sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING) 543 sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING)
537 sort.set_default_sort_func(None) 544 sort.set_default_sort_func(None)
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index 3ab30a6fce..28dc375da5 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -153,7 +153,12 @@ class HobViewTable (gtk.VBox):
153 # Just display the first item 153 # Just display the first item
154 if binb: 154 if binb:
155 bin = binb.split(', ') 155 bin = binb.split(', ')
156 cell.set_property('text', bin[0]) 156 total_no = len(bin)
157 if total_no > 1 and bin[0] == "User Selected":
158 present_binb = bin[1] + ' (+' + str(total_no) + ')'
159 else:
160 present_binb = bin[0] + ' (+' + str(total_no) + ')'
161 cell.set_property('text', present_binb)
157 else: 162 else:
158 cell.set_property('text', "") 163 cell.set_property('text', "")
159 return True 164 return True
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 9eec0e0043..c73697bb33 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -34,39 +34,34 @@ class PackageSelectionPage (HobPage):
34 34
35 pages = [ 35 pages = [
36 { 36 {
37 'name' : 'Included', 37 'name' : 'Included packages',
38 'tooltip' : 'The packages currently included for your image', 38 'tooltip' : 'The packages currently included for your image',
39 'filter' : { PackageListModel.COL_INC : [True] }, 39 'filter' : { PackageListModel.COL_INC : [True] },
40 'columns' : [{ 40 'columns' : [{
41 'col_name' : 'Package name', 41 'col_name' : 'Package name',
42 'col_id' : PackageListModel.COL_NAME, 42 'col_id' : PackageListModel.COL_NAME,
43 'col_t_id' : PackageListModel.COL_FONT,
44 'col_style': 'text', 43 'col_style': 'text',
45 'col_min' : 100, 44 'col_min' : 100,
46 'col_max' : 300, 45 'col_max' : 300,
47 'expand' : 'True' 46 'expand' : 'True'
48 }, { 47 }, {
49 'col_name' : 'Brought in by',
50 'col_id' : PackageListModel.COL_BINB,
51 'col_t_id' : PackageListModel.COL_FONT,
52 'col_style': 'binb',
53 'col_min' : 100,
54 'col_max' : 350,
55 'expand' : 'True'
56 }, {
57 'col_name' : 'Size', 48 'col_name' : 'Size',
58 'col_id' : PackageListModel.COL_SIZE, 49 'col_id' : PackageListModel.COL_SIZE,
59 'col_t_id' : PackageListModel.COL_FONT,
60 'col_style': 'text', 50 'col_style': 'text',
61 'col_min' : 100, 51 'col_min' : 100,
62 'col_max' : 300, 52 'col_max' : 300,
63 'expand' : 'True' 53 'expand' : 'True'
64 }, { 54 }, {
55 'col_name' : 'Brought in by',
56 'col_id' : PackageListModel.COL_BINB,
57 'col_style': 'binb',
58 'col_min' : 100,
59 'col_max' : 350,
60 'expand' : 'True'
61 }, {
65 'col_name' : 'Included', 62 'col_name' : 'Included',
66 'col_id' : PackageListModel.COL_INC, 63 'col_id' : PackageListModel.COL_INC,
67 'col_t_id' : PackageListModel.COL_FONT,
68 'col_style': 'check toggle', 64 'col_style': 'check toggle',
69 'col_group': 'tree store group',
70 'col_min' : 100, 65 'col_min' : 100,
71 'col_max' : 100 66 'col_max' : 100
72 }] 67 }]
@@ -77,7 +72,6 @@ class PackageSelectionPage (HobPage):
77 'columns' : [{ 72 'columns' : [{
78 'col_name' : 'Package name', 73 'col_name' : 'Package name',
79 'col_id' : PackageListModel.COL_NAME, 74 'col_id' : PackageListModel.COL_NAME,
80 'col_t_id' : PackageListModel.COL_FONT,
81 'col_style': 'text', 75 'col_style': 'text',
82 'col_min' : 100, 76 'col_min' : 100,
83 'col_max' : 400, 77 'col_max' : 400,
@@ -85,7 +79,6 @@ class PackageSelectionPage (HobPage):
85 }, { 79 }, {
86 'col_name' : 'Size', 80 'col_name' : 'Size',
87 'col_id' : PackageListModel.COL_SIZE, 81 'col_id' : PackageListModel.COL_SIZE,
88 'col_t_id' : PackageListModel.COL_FONT,
89 'col_style': 'text', 82 'col_style': 'text',
90 'col_min' : 100, 83 'col_min' : 100,
91 'col_max' : 500, 84 'col_max' : 500,
@@ -94,7 +87,6 @@ class PackageSelectionPage (HobPage):
94 'col_name' : 'Included', 87 'col_name' : 'Included',
95 'col_id' : PackageListModel.COL_INC, 88 'col_id' : PackageListModel.COL_INC,
96 'col_style': 'check toggle', 89 'col_style': 'check toggle',
97 'col_group': 'tree store group',
98 'col_min' : 100, 90 'col_min' : 100,
99 'col_max' : 100 91 'col_max' : 100
100 }] 92 }]
@@ -133,8 +125,7 @@ class PackageSelectionPage (HobPage):
133 filter = page['filter'] 125 filter = page['filter']
134 tab.set_model(self.package_model.tree_model(filter)) 126 tab.set_model(self.package_model.tree_model(filter))
135 tab.connect("toggled", self.table_toggled_cb, page['name']) 127 tab.connect("toggled", self.table_toggled_cb, page['name'])
136 tab.connect_group_selection(self.table_selected_cb) 128 if page['name'] == "Included packages":
137 if page['name'] == "Included":
138 tab.connect("button-release-event", self.button_click_cb) 129 tab.connect("button-release-event", self.button_click_cb)
139 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) 130 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
140 self.ins.append_page(tab, page['name'], page['tooltip']) 131 self.ins.append_page(tab, page['name'], page['tooltip'])
@@ -228,13 +219,13 @@ class PackageSelectionPage (HobPage):
228 219
229 self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" % 220 self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" %
230 (selected_packages_num, selected_packages_size_str, image_total_size_str)) 221 (selected_packages_num, selected_packages_size_str, image_total_size_str))
231 self.ins.show_indicator_icon("Included", selected_packages_num) 222 self.ins.show_indicator_icon("Included packages", selected_packages_num)
232 223
233 def toggle_item_idle_cb(self, path, view_tree, cell, pagename): 224 def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
234 if not self.package_model.path_included(path): 225 if not self.package_model.path_included(path):
235 self.package_model.include_item(item_path=path, binb="User Selected") 226 self.package_model.include_item(item_path=path, binb="User Selected")
236 else: 227 else:
237 if pagename == "Included": 228 if pagename == "Included packages":
238 self.pre_fadeout_checkout_include(view_tree) 229 self.pre_fadeout_checkout_include(view_tree)
239 self.package_model.exclude_item(item_path=path) 230 self.package_model.exclude_item(item_path=path)
240 self.render_fadeout(view_tree, cell) 231 self.render_fadeout(view_tree, cell)
@@ -291,21 +282,6 @@ class PackageSelectionPage (HobPage):
291 tree.set_model(self.package_model.tree_model(self.pages[0]['filter'])) 282 tree.set_model(self.package_model.tree_model(self.pages[0]['filter']))
292 tree.expand_all() 283 tree.expand_all()
293 284
294 def foreach_cell_change_font(self, model, path, iter, paths=None):
295 # Changed the font for a group cells
296 if path and iter and path[0] == paths[0]:
297 self.package_model.set(iter, self.package_model.COL_FONT, "bold")
298 else:
299 if iter and model.iter_parent(iter) == None:
300 self.package_model.set(iter, self.package_model.COL_FONT, '11')
301 else:
302 self.package_model.set(iter, self.package_model.COL_FONT, '10')
303
304 def table_selected_cb(self, selection):
305 model, paths = selection.get_selected_rows()
306 if paths:
307 child_path = self.package_model.convert_vpath_to_path(model, paths[0])
308 self.package_model.foreach(self.foreach_cell_change_font, child_path)
309
310 def set_packages_curr_tab(self, curr_page): 285 def set_packages_curr_tab(self, curr_page):
311 self.ins.set_current_page(curr_page) 286 self.ins.set_current_page(curr_page)
287
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index 18690077f5..693a449bcf 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -33,7 +33,7 @@ from bb.ui.crumbs.hobpages import HobPage
33class RecipeSelectionPage (HobPage): 33class RecipeSelectionPage (HobPage):
34 pages = [ 34 pages = [
35 { 35 {
36 'name' : 'Included', 36 'name' : 'Included recipes',
37 'tooltip' : 'The recipes currently included for your image', 37 'tooltip' : 'The recipes currently included for your image',
38 'filter' : { RecipeListModel.COL_INC : [True], 38 'filter' : { RecipeListModel.COL_INC : [True],
39 RecipeListModel.COL_TYPE : ['recipe', 'task'] }, 39 RecipeListModel.COL_TYPE : ['recipe', 'task'] },
@@ -45,13 +45,6 @@ class RecipeSelectionPage (HobPage):
45 'col_max' : 400, 45 'col_max' : 400,
46 'expand' : 'True' 46 'expand' : 'True'
47 }, { 47 }, {
48 'col_name' : 'Brought in by',
49 'col_id' : RecipeListModel.COL_BINB,
50 'col_style': 'binb',
51 'col_min' : 100,
52 'col_max' : 500,
53 'expand' : 'True'
54 }, {
55 'col_name' : 'Group', 48 'col_name' : 'Group',
56 'col_id' : RecipeListModel.COL_GROUP, 49 'col_id' : RecipeListModel.COL_GROUP,
57 'col_style': 'text', 50 'col_style': 'text',
@@ -59,6 +52,13 @@ class RecipeSelectionPage (HobPage):
59 'col_max' : 300, 52 'col_max' : 300,
60 'expand' : 'True' 53 'expand' : 'True'
61 }, { 54 }, {
55 'col_name' : 'Brought in by',
56 'col_id' : RecipeListModel.COL_BINB,
57 'col_style': 'binb',
58 'col_min' : 100,
59 'col_max' : 500,
60 'expand' : 'True'
61 }, {
62 'col_name' : 'Included', 62 'col_name' : 'Included',
63 'col_id' : RecipeListModel.COL_INC, 63 'col_id' : RecipeListModel.COL_INC,
64 'col_style': 'check toggle', 64 'col_style': 'check toggle',
@@ -77,15 +77,15 @@ class RecipeSelectionPage (HobPage):
77 'col_max' : 400, 77 'col_max' : 400,
78 'expand' : 'True' 78 'expand' : 'True'
79 }, { 79 }, {
80 'col_name' : 'License', 80 'col_name' : 'Group',
81 'col_id' : RecipeListModel.COL_LIC, 81 'col_id' : RecipeListModel.COL_GROUP,
82 'col_style': 'text', 82 'col_style': 'text',
83 'col_min' : 100, 83 'col_min' : 100,
84 'col_max' : 400, 84 'col_max' : 400,
85 'expand' : 'True' 85 'expand' : 'True'
86 }, { 86 }, {
87 'col_name' : 'Group', 87 'col_name' : 'License',
88 'col_id' : RecipeListModel.COL_GROUP, 88 'col_id' : RecipeListModel.COL_LIC,
89 'col_style': 'text', 89 'col_style': 'text',
90 'col_min' : 100, 90 'col_min' : 100,
91 'col_max' : 400, 91 'col_max' : 400,
@@ -109,13 +109,6 @@ class RecipeSelectionPage (HobPage):
109 'col_max' : 400, 109 'col_max' : 400,
110 'expand' : 'True' 110 'expand' : 'True'
111 }, { 111 }, {
112 'col_name' : 'Description',
113 'col_id' : RecipeListModel.COL_DESC,
114 'col_style': 'text',
115 'col_min' : 100,
116 'col_max' : 400,
117 'expand' : 'True'
118 }, {
119 'col_name' : 'Included', 112 'col_name' : 'Included',
120 'col_id' : RecipeListModel.COL_INC, 113 'col_id' : RecipeListModel.COL_INC,
121 'col_style': 'check toggle', 114 'col_style': 'check toggle',
@@ -156,7 +149,7 @@ class RecipeSelectionPage (HobPage):
156 filter = page['filter'] 149 filter = page['filter']
157 tab.set_model(self.recipe_model.tree_model(filter)) 150 tab.set_model(self.recipe_model.tree_model(filter))
158 tab.connect("toggled", self.table_toggled_cb, page['name']) 151 tab.connect("toggled", self.table_toggled_cb, page['name'])
159 if page['name'] == "Included": 152 if page['name'] == "Included recipes":
160 tab.connect("button-release-event", self.button_click_cb) 153 tab.connect("button-release-event", self.button_click_cb)
161 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include) 154 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
162 self.ins.append_page(tab, page['name'], page['tooltip']) 155 self.ins.append_page(tab, page['name'], page['tooltip'])
@@ -205,13 +198,13 @@ class RecipeSelectionPage (HobPage):
205 def refresh_selection(self): 198 def refresh_selection(self):
206 self.builder.configuration.selected_image = self.recipe_model.get_selected_image() 199 self.builder.configuration.selected_image = self.recipe_model.get_selected_image()
207 _, self.builder.configuration.selected_recipes = self.recipe_model.get_selected_recipes() 200 _, self.builder.configuration.selected_recipes = self.recipe_model.get_selected_recipes()
208 self.ins.show_indicator_icon("Included", len(self.builder.configuration.selected_recipes)) 201 self.ins.show_indicator_icon("Included recipes", len(self.builder.configuration.selected_recipes))
209 202
210 def toggle_item_idle_cb(self, path, view_tree, cell, pagename): 203 def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
211 if not self.recipe_model.path_included(path): 204 if not self.recipe_model.path_included(path):
212 self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False) 205 self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False)
213 else: 206 else:
214 if pagename == "Included": 207 if pagename == "Included recipes":
215 self.pre_fadeout_checkout_include(view_tree) 208 self.pre_fadeout_checkout_include(view_tree)
216 self.recipe_model.exclude_item(item_path=path) 209 self.recipe_model.exclude_item(item_path=path)
217 self.render_fadeout(view_tree, cell) 210 self.render_fadeout(view_tree, cell)