diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2013-01-31 13:50:16 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-31 12:46:20 +0000 |
commit | c30ef8886d5597fb2b21fb101d4485a280ba73d4 (patch) | |
tree | 6a44af49fb0e4619b6895ef049b093c77be43ce3 /bitbake/lib/bb/ui | |
parent | b2ab771447d8d66c1ec43b7d509c1dcfa2e6cec2 (diff) | |
download | poky-c30ef8886d5597fb2b21fb101d4485a280ba73d4.tar.gz |
bitbake: hob: eliminate the "by recipe" grouping in the packages table
We have agreed to change how we show the packages. Now they are not grouped by
recipe. Until now, it was implemented using TreeStore and I've changed it to
extend a ListStore. I have modified all the function in according to this.
[YOCTO #2180]
(Bitbake rev: 311e7ba8b2c88fbf6f16b6ffb1400226b155ddd4)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 272 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 22 |
2 files changed, 112 insertions, 182 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index 85c4f51070..06c90d38f7 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py | |||
@@ -27,14 +27,15 @@ from bb.ui.crumbs.hobpages import HobPage | |||
27 | # | 27 | # |
28 | # PackageListModel | 28 | # PackageListModel |
29 | # | 29 | # |
30 | class PackageListModel(gtk.TreeStore): | 30 | class PackageListModel(gtk.ListStore): |
31 | """ | 31 | """ |
32 | This class defines an gtk.TreeStore subclass which will convert the output | 32 | This class defines an gtk.ListStore subclass which will convert the output |
33 | of the bb.event.TargetsTreeGenerated event into a gtk.TreeStore whilst also | 33 | of the bb.event.TargetsTreeGenerated event into a gtk.ListStore whilst also |
34 | providing convenience functions to access gtk.TreeModel subclasses which | 34 | providing convenience functions to access gtk.TreeModel subclasses which |
35 | provide filtered views of the data. | 35 | provide filtered views of the data. |
36 | """ | 36 | """ |
37 | (COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_BINB, COL_INC, COL_FADE_INC, COL_FONT) = range(13) | 37 | |
38 | (COL_NAME, COL_VER, COL_REV, COL_RNM, COL_SEC, COL_SUM, COL_RDEP, COL_RPROV, COL_SIZE, COL_RCP, COL_BINB, COL_INC, COL_FADE_INC, COL_FONT) = range(14) | ||
38 | 39 | ||
39 | __gsignals__ = { | 40 | __gsignals__ = { |
40 | "package-selection-changed" : (gobject.SIGNAL_RUN_LAST, | 41 | "package-selection-changed" : (gobject.SIGNAL_RUN_LAST, |
@@ -45,15 +46,9 @@ class PackageListModel(gtk.TreeStore): | |||
45 | __toolchain_required_packages__ = ["packagegroup-core-standalone-sdk-target", "packagegroup-core-standalone-sdk-target-dbg"] | 46 | __toolchain_required_packages__ = ["packagegroup-core-standalone-sdk-target", "packagegroup-core-standalone-sdk-target-dbg"] |
46 | 47 | ||
47 | def __init__(self): | 48 | def __init__(self): |
48 | |||
49 | self.contents = None | ||
50 | self.images = None | ||
51 | self.pkgs_size = 0 | ||
52 | self.pn_path = {} | ||
53 | self.pkg_path = {} | ||
54 | self.rprov_pkg = {} | 49 | self.rprov_pkg = {} |
55 | 50 | gtk.ListStore.__init__ (self, | |
56 | gtk.TreeStore.__init__ (self, | 51 | gobject.TYPE_STRING, |
57 | gobject.TYPE_STRING, | 52 | gobject.TYPE_STRING, |
58 | gobject.TYPE_STRING, | 53 | gobject.TYPE_STRING, |
59 | gobject.TYPE_STRING, | 54 | gobject.TYPE_STRING, |
@@ -68,21 +63,20 @@ class PackageListModel(gtk.TreeStore): | |||
68 | gobject.TYPE_BOOLEAN, | 63 | gobject.TYPE_BOOLEAN, |
69 | gobject.TYPE_STRING) | 64 | gobject.TYPE_STRING) |
70 | 65 | ||
71 | |||
72 | """ | 66 | """ |
73 | Find the model path for the item_name | 67 | Find the model path for the item_name |
74 | Returns the path in the model or None | 68 | Returns the path in the model or None |
75 | """ | 69 | """ |
76 | def find_path_for_item(self, item_name): | 70 | def find_path_for_item(self, item_name): |
77 | pkg = item_name | 71 | pkg = item_name |
78 | if item_name not in self.pkg_path.keys(): | 72 | if item_name not in self.pn_path.keys(): |
79 | if item_name not in self.rprov_pkg.keys(): | 73 | if item_name not in self.rprov_pkg.keys(): |
80 | return None | 74 | return None |
81 | pkg = self.rprov_pkg[item_name] | 75 | pkg = self.rprov_pkg[item_name] |
82 | if pkg not in self.pkg_path.keys(): | 76 | if pkg not in self.pn_path.keys(): |
83 | return None | 77 | return None |
84 | 78 | ||
85 | return self.pkg_path[pkg] | 79 | return self.pn_path[pkg] |
86 | 80 | ||
87 | def find_item_for_path(self, item_path): | 81 | def find_item_for_path(self, item_path): |
88 | return self[item_path][self.COL_NAME] | 82 | return self[item_path][self.COL_NAME] |
@@ -106,10 +100,20 @@ class PackageListModel(gtk.TreeStore): | |||
106 | model.set_visible_func(self.tree_model_filter, filter) | 100 | model.set_visible_func(self.tree_model_filter, filter) |
107 | 101 | ||
108 | sort = gtk.TreeModelSort(model) | 102 | sort = gtk.TreeModelSort(model) |
109 | sort.set_sort_column_id(PackageListModel.COL_NAME, gtk.SORT_ASCENDING) | 103 | sort.set_sort_column_id(RecipeListModel.COL_NAME, gtk.SORT_ASCENDING) |
110 | sort.set_default_sort_func(None) | 104 | sort.set_default_sort_func(None) |
111 | return sort | 105 | return sort |
112 | 106 | ||
107 | def exclude_item_sort_func(self, model, iter1, iter2): | ||
108 | val1 = model.get_value(iter1, RecipeListModel.COL_FADE_INC) | ||
109 | val2 = model.get_value(iter2, RecipeListModel.COL_INC) | ||
110 | return ((val1 == True) and (val2 == False)) | ||
111 | |||
112 | def include_item_sort_func(self, model, iter1, iter2): | ||
113 | val1 = model.get_value(iter1, RecipeListModel.COL_INC) | ||
114 | val2 = model.get_value(iter2, RecipeListModel.COL_INC) | ||
115 | return ((val1 == False) and (val2 == True)) | ||
116 | |||
113 | def convert_vpath_to_path(self, view_model, view_path): | 117 | def convert_vpath_to_path(self, view_model, view_path): |
114 | # view_model is the model sorted | 118 | # view_model is the model sorted |
115 | # get the path of the model filtered | 119 | # get the path of the model filtered |
@@ -121,16 +125,13 @@ class PackageListModel(gtk.TreeStore): | |||
121 | return path | 125 | return path |
122 | 126 | ||
123 | def convert_path_to_vpath(self, view_model, path): | 127 | def convert_path_to_vpath(self, view_model, path): |
124 | name = self.find_item_for_path(path) | ||
125 | it = view_model.get_iter_first() | 128 | it = view_model.get_iter_first() |
126 | while it: | 129 | while it: |
127 | child_it = view_model.iter_children(it) | 130 | name = self.find_item_for_path(path) |
128 | while child_it: | 131 | view_name = view_model.get_value(it, RecipeListModel.COL_NAME) |
129 | view_name = view_model.get_value(child_it, self.COL_NAME) | 132 | if view_name == name: |
130 | if view_name == name: | 133 | view_path = view_model.get_path(it) |
131 | view_path = view_model.get_path(child_it) | 134 | return view_path |
132 | return view_path | ||
133 | child_it = view_model.iter_next(child_it) | ||
134 | it = view_model.iter_next(it) | 135 | it = view_model.iter_next(it) |
135 | return None | 136 | return None |
136 | 137 | ||
@@ -139,11 +140,8 @@ class PackageListModel(gtk.TreeStore): | |||
139 | bb.event.PackageInfo event and populates the package list. | 140 | bb.event.PackageInfo event and populates the package list. |
140 | """ | 141 | """ |
141 | def populate(self, pkginfolist): | 142 | def populate(self, pkginfolist): |
143 | # First clear the model, in case repopulating | ||
142 | self.clear() | 144 | self.clear() |
143 | self.pkgs_size = 0 | ||
144 | self.pn_path = {} | ||
145 | self.pkg_path = {} | ||
146 | self.rprov_pkg = {} | ||
147 | 145 | ||
148 | def getpkgvalue(pkgdict, key, pkgname, defaultval = None): | 146 | def getpkgvalue(pkgdict, key, pkgname, defaultval = None): |
149 | value = pkgdict.get('%s_%s' % (key, pkgname), None) | 147 | value = pkgdict.get('%s_%s' % (key, pkgname), None) |
@@ -155,15 +153,6 @@ class PackageListModel(gtk.TreeStore): | |||
155 | pn = pkginfo['PN'] | 153 | pn = pkginfo['PN'] |
156 | pv = pkginfo['PV'] | 154 | pv = pkginfo['PV'] |
157 | pr = pkginfo['PR'] | 155 | pr = pkginfo['PR'] |
158 | if pn in self.pn_path.keys(): | ||
159 | pniter = self.get_iter(self.pn_path[pn]) | ||
160 | else: | ||
161 | pniter = self.append(None) | ||
162 | self.set(pniter, self.COL_NAME, pn + '-' + pv + '-' + pr, | ||
163 | self.COL_INC, False) | ||
164 | self.pn_path[pn] = self.get_path(pniter) | ||
165 | |||
166 | # PKG is always present | ||
167 | pkg = pkginfo['PKG'] | 156 | pkg = pkginfo['PKG'] |
168 | pkgv = getpkgvalue(pkginfo, 'PKGV', pkg) | 157 | pkgv = getpkgvalue(pkginfo, 'PKGV', pkg) |
169 | pkgr = getpkgvalue(pkginfo, 'PKGR', pkg) | 158 | pkgr = getpkgvalue(pkginfo, 'PKGR', pkg) |
@@ -180,6 +169,8 @@ class PackageListModel(gtk.TreeStore): | |||
180 | for i in rprov.split(): | 169 | for i in rprov.split(): |
181 | self.rprov_pkg[i] = pkg | 170 | self.rprov_pkg[i] = pkg |
182 | 171 | ||
172 | recipe = pn + '-' + pv + '-' + pr | ||
173 | |||
183 | allow_empty = getpkgvalue(pkginfo, 'ALLOW_EMPTY', pkg, "") | 174 | allow_empty = getpkgvalue(pkginfo, 'ALLOW_EMPTY', pkg, "") |
184 | 175 | ||
185 | if pkgsize == "0" and not allow_empty: | 176 | if pkgsize == "0" and not allow_empty: |
@@ -188,20 +179,21 @@ class PackageListModel(gtk.TreeStore): | |||
188 | # pkgsize is in KB | 179 | # pkgsize is in KB |
189 | size = HobPage._size_to_string(HobPage._string_to_size(pkgsize + ' KB')) | 180 | size = HobPage._size_to_string(HobPage._string_to_size(pkgsize + ' KB')) |
190 | 181 | ||
191 | it = self.append(pniter) | 182 | self.set(self.append(), self.COL_NAME, pkg, self.COL_VER, pkgv, |
192 | self.pkg_path[pkg] = self.get_path(it) | ||
193 | self.set(it, self.COL_NAME, pkg, self.COL_VER, pkgv, | ||
194 | self.COL_REV, pkgr, self.COL_RNM, pkg_rename, | 183 | self.COL_REV, pkgr, self.COL_RNM, pkg_rename, |
195 | self.COL_SEC, section, self.COL_SUM, summary, | 184 | self.COL_SEC, section, self.COL_SUM, summary, |
196 | self.COL_RDEP, rdep + ' ' + rrec, | 185 | self.COL_RDEP, rdep + ' ' + rrec, |
197 | self.COL_RPROV, rprov, self.COL_SIZE, size, | 186 | self.COL_RPROV, rprov, self.COL_SIZE, size, |
198 | self.COL_BINB, "", self.COL_INC, False, self.COL_FONT, '10') | 187 | self.COL_RCP, recipe, self.COL_BINB, "", |
188 | self.COL_INC, False, self.COL_FONT, '10') | ||
199 | 189 | ||
200 | """ | 190 | self.pn_path = {} |
201 | Check whether the item at item_path is included or not | 191 | it = self.get_iter_first() |
202 | """ | 192 | while it: |
203 | def path_included(self, item_path): | 193 | pn = self.get_value(it, self.COL_NAME) |
204 | return self[item_path][self.COL_INC] | 194 | path = self.get_path(it) |
195 | self.pn_path[pn] = path | ||
196 | it = self.iter_next(it) | ||
205 | 197 | ||
206 | """ | 198 | """ |
207 | Update the model, send out the notification. | 199 | Update the model, send out the notification. |
@@ -210,48 +202,32 @@ class PackageListModel(gtk.TreeStore): | |||
210 | self.emit("package-selection-changed") | 202 | self.emit("package-selection-changed") |
211 | 203 | ||
212 | """ | 204 | """ |
213 | Mark a certain package as selected. | 205 | Check whether the item at item_path is included or not |
214 | All its dependencies are marked as selected. | 206 | """ |
215 | The recipe provides the package is marked as selected. | 207 | def path_included(self, item_path): |
216 | If user explicitly selects a recipe, all its providing packages are selected | 208 | return self[item_path][self.COL_INC] |
209 | |||
210 | """ | ||
211 | Add this item, and any of its dependencies, to the image contents | ||
217 | """ | 212 | """ |
218 | def include_item(self, item_path, binb=""): | 213 | def include_item(self, item_path, binb=""): |
219 | if self.path_included(item_path): | 214 | if self.path_included(item_path): |
220 | return | 215 | return |
221 | 216 | ||
222 | item_name = self[item_path][self.COL_NAME] | 217 | item_name = self[item_path][self.COL_NAME] |
223 | item_rdep = self[item_path][self.COL_RDEP] | 218 | item_deps = self[item_path][self.COL_RDEP] |
224 | 219 | ||
225 | self[item_path][self.COL_INC] = True | 220 | self[item_path][self.COL_INC] = True |
226 | 221 | ||
227 | it = self.get_iter(item_path) | ||
228 | |||
229 | # If user explicitly selects a recipe, all its providing packages are selected. | ||
230 | if not self[item_path][self.COL_VER] and binb == "User Selected": | ||
231 | child_it = self.iter_children(it) | ||
232 | while child_it: | ||
233 | child_path = self.get_path(child_it) | ||
234 | child_included = self.path_included(child_path) | ||
235 | if not child_included: | ||
236 | self.include_item(child_path, binb="User Selected") | ||
237 | child_it = self.iter_next(child_it) | ||
238 | return | ||
239 | |||
240 | # The recipe provides the package is also marked as selected | ||
241 | parent_it = self.iter_parent(it) | ||
242 | if parent_it: | ||
243 | parent_path = self.get_path(parent_it) | ||
244 | self[parent_path][self.COL_INC] = True | ||
245 | |||
246 | item_bin = self[item_path][self.COL_BINB].split(', ') | 222 | item_bin = self[item_path][self.COL_BINB].split(', ') |
247 | if binb and not binb in item_bin: | 223 | if binb and not binb in item_bin: |
248 | item_bin.append(binb) | 224 | item_bin.append(binb) |
249 | self[item_path][self.COL_BINB] = ', '.join(item_bin).lstrip(', ') | 225 | self[item_path][self.COL_BINB] = ', '.join(item_bin).lstrip(', ') |
250 | 226 | ||
251 | if item_rdep: | 227 | if item_deps: |
252 | # Ensure all of the items deps are included and, where appropriate, | 228 | # Ensure all of the items deps are included and, where appropriate, |
253 | # add this item to their COL_BINB | 229 | # add this item to their COL_BINB |
254 | for dep in item_rdep.split(" "): | 230 | for dep in item_deps.split(" "): |
255 | if dep.startswith('('): | 231 | if dep.startswith('('): |
256 | continue | 232 | continue |
257 | # If the contents model doesn't already contain dep, add it | 233 | # If the contents model doesn't already contain dep, add it |
@@ -270,12 +246,6 @@ class PackageListModel(gtk.TreeStore): | |||
270 | elif not dep_included: | 246 | elif not dep_included: |
271 | self.include_item(dep_path, binb=item_name) | 247 | self.include_item(dep_path, binb=item_name) |
272 | 248 | ||
273 | """ | ||
274 | Mark a certain package as de-selected. | ||
275 | All other packages that depends on this package are marked as de-selected. | ||
276 | If none of the packages provided by the recipe, the recipe should be marked as de-selected. | ||
277 | If user explicitly de-select a recipe, all its providing packages are de-selected. | ||
278 | """ | ||
279 | def exclude_item(self, item_path): | 249 | def exclude_item(self, item_path): |
280 | if not self.path_included(item_path): | 250 | if not self.path_included(item_path): |
281 | return | 251 | return |
@@ -283,37 +253,9 @@ class PackageListModel(gtk.TreeStore): | |||
283 | self[item_path][self.COL_INC] = False | 253 | self[item_path][self.COL_INC] = False |
284 | 254 | ||
285 | item_name = self[item_path][self.COL_NAME] | 255 | item_name = self[item_path][self.COL_NAME] |
286 | item_rdep = self[item_path][self.COL_RDEP] | 256 | item_deps = self[item_path][self.COL_RDEP] |
287 | it = self.get_iter(item_path) | 257 | if item_deps: |
288 | 258 | for dep in item_deps.split(" "): | |
289 | # If user explicitly de-select a recipe, all its providing packages are de-selected. | ||
290 | if not self[item_path][self.COL_VER]: | ||
291 | child_it = self.iter_children(it) | ||
292 | while child_it: | ||
293 | child_path = self.get_path(child_it) | ||
294 | child_included = self[child_path][self.COL_INC] | ||
295 | if child_included: | ||
296 | self.exclude_item(child_path) | ||
297 | child_it = self.iter_next(child_it) | ||
298 | return | ||
299 | |||
300 | # If none of the packages provided by the recipe, the recipe should be marked as de-selected. | ||
301 | parent_it = self.iter_parent(it) | ||
302 | peer_iter = self.iter_children(parent_it) | ||
303 | enabled = 0 | ||
304 | while peer_iter: | ||
305 | peer_path = self.get_path(peer_iter) | ||
306 | if self[peer_path][self.COL_INC]: | ||
307 | enabled = 1 | ||
308 | break | ||
309 | peer_iter = self.iter_next(peer_iter) | ||
310 | if not enabled: | ||
311 | parent_path = self.get_path(parent_it) | ||
312 | self[parent_path][self.COL_INC] = False | ||
313 | |||
314 | # All packages that depends on this package are de-selected. | ||
315 | if item_rdep: | ||
316 | for dep in item_rdep.split(" "): | ||
317 | if dep.startswith('('): | 259 | if dep.startswith('('): |
318 | continue | 260 | continue |
319 | dep_path = self.find_path_for_item(dep) | 261 | dep_path = self.find_path_for_item(dep) |
@@ -333,51 +275,40 @@ class PackageListModel(gtk.TreeStore): | |||
333 | self.exclude_item(binb_path) | 275 | self.exclude_item(binb_path) |
334 | 276 | ||
335 | """ | 277 | """ |
336 | Package model may be incomplete, therefore when calling the | 278 | Empty self.contents by setting the include of each entry to None |
337 | set_selected_packages(), some packages will not be set included. | ||
338 | Return the un-set packages list. | ||
339 | """ | 279 | """ |
340 | def set_selected_packages(self, packagelist, user_selected=False): | 280 | def reset(self): |
341 | left = [] | 281 | it = self.get_iter_first() |
342 | binb = 'User Selected' if user_selected else '' | 282 | while it: |
343 | for pn in packagelist: | 283 | self.set(it, |
344 | if pn in self.pkg_path.keys(): | 284 | self.COL_INC, False, |
345 | path = self.pkg_path[pn] | 285 | self.COL_BINB, "") |
346 | self.include_item(item_path=path, binb=binb) | 286 | it = self.iter_next(it) |
347 | else: | ||
348 | left.append(pn) | ||
349 | 287 | ||
350 | self.selection_change_notification() | 288 | self.selection_change_notification() |
351 | return left | ||
352 | 289 | ||
353 | def get_user_selected_packages(self): | 290 | def get_selected_packages(self): |
354 | packagelist = [] | 291 | packagelist = [] |
355 | 292 | ||
356 | it = self.get_iter_first() | 293 | it = self.get_iter_first() |
357 | while it: | 294 | while it: |
358 | child_it = self.iter_children(it) | 295 | if self.get_value(it, self.COL_INC): |
359 | while child_it: | 296 | name = self.get_value(it, self.COL_NAME) |
360 | if self.get_value(child_it, self.COL_INC): | 297 | packagelist.append(name) |
361 | binb = self.get_value(child_it, self.COL_BINB) | ||
362 | if binb == "User Selected": | ||
363 | name = self.get_value(child_it, self.COL_NAME) | ||
364 | packagelist.append(name) | ||
365 | child_it = self.iter_next(child_it) | ||
366 | it = self.iter_next(it) | 298 | it = self.iter_next(it) |
367 | 299 | ||
368 | return packagelist | 300 | return packagelist |
369 | 301 | ||
370 | def get_selected_packages(self): | 302 | def get_user_selected_packages(self): |
371 | packagelist = [] | 303 | packagelist = [] |
372 | 304 | ||
373 | it = self.get_iter_first() | 305 | it = self.get_iter_first() |
374 | while it: | 306 | while it: |
375 | child_it = self.iter_children(it) | 307 | if self.get_value(it, self.COL_INC): |
376 | while child_it: | 308 | binb = self.get_value(it, self.COL_BINB) |
377 | if self.get_value(child_it, self.COL_INC): | 309 | if binb == "User Selected": |
378 | name = self.get_value(child_it, self.COL_NAME) | 310 | name = self.get_value(it, self.COL_NAME) |
379 | packagelist.append(name) | 311 | packagelist.append(name) |
380 | child_it = self.iter_next(child_it) | ||
381 | it = self.iter_next(it) | 312 | it = self.iter_next(it) |
382 | 313 | ||
383 | return packagelist | 314 | return packagelist |
@@ -388,16 +319,31 @@ class PackageListModel(gtk.TreeStore): | |||
388 | it = self.get_iter_first() | 319 | it = self.get_iter_first() |
389 | while it: | 320 | while it: |
390 | if self.get_value(it, self.COL_INC): | 321 | if self.get_value(it, self.COL_INC): |
391 | child_it = self.iter_children(it) | 322 | name = self.get_value(it, self.COL_NAME) |
392 | while child_it: | 323 | if name.endswith("-dev") or name.endswith("-dbg"): |
393 | name = self.get_value(child_it, self.COL_NAME) | 324 | packagelist.append(name) |
394 | inc = self.get_value(child_it, self.COL_INC) | ||
395 | if inc or name.endswith("-dev") or name.endswith("-dbg"): | ||
396 | packagelist.append(name) | ||
397 | child_it = self.iter_next(child_it) | ||
398 | it = self.iter_next(it) | 325 | it = self.iter_next(it) |
399 | 326 | ||
400 | return list(set(packagelist + self.__toolchain_required_packages__)); | 327 | return list(set(packagelist + self.__toolchain_required_packages__)); |
328 | |||
329 | """ | ||
330 | Package model may be incomplete, therefore when calling the | ||
331 | set_selected_packages(), some packages will not be set included. | ||
332 | Return the un-set packages list. | ||
333 | """ | ||
334 | def set_selected_packages(self, packagelist, user_selected=False): | ||
335 | left = [] | ||
336 | binb = 'User Selected' if user_selected else '' | ||
337 | for pn in packagelist: | ||
338 | if pn in self.pn_path.keys(): | ||
339 | path = self.pn_path[pn] | ||
340 | self.include_item(item_path=path, binb=binb) | ||
341 | else: | ||
342 | left.append(pn) | ||
343 | |||
344 | self.selection_change_notification() | ||
345 | return left | ||
346 | |||
401 | """ | 347 | """ |
402 | Return the selected package size, unit is B. | 348 | Return the selected package size, unit is B. |
403 | """ | 349 | """ |
@@ -405,38 +351,17 @@ class PackageListModel(gtk.TreeStore): | |||
405 | packages_size = 0 | 351 | packages_size = 0 |
406 | it = self.get_iter_first() | 352 | it = self.get_iter_first() |
407 | while it: | 353 | while it: |
408 | child_it = self.iter_children(it) | 354 | if self.get_value(it, self.COL_INC): |
409 | while child_it: | 355 | str_size = self.get_value(it, self.COL_SIZE) |
410 | if self.get_value(child_it, self.COL_INC): | 356 | if not str_size: |
411 | str_size = self.get_value(child_it, self.COL_SIZE) | 357 | continue |
412 | if not str_size: | ||
413 | continue | ||
414 | 358 | ||
415 | packages_size += HobPage._string_to_size(str_size) | 359 | packages_size += HobPage._string_to_size(str_size) |
416 | 360 | ||
417 | child_it = self.iter_next(child_it) | ||
418 | it = self.iter_next(it) | 361 | it = self.iter_next(it) |
419 | return packages_size | 362 | return packages_size |
420 | 363 | ||
421 | """ | 364 | """ |
422 | Empty self.contents by setting the include of each entry to None | ||
423 | """ | ||
424 | def reset(self): | ||
425 | self.pkgs_size = 0 | ||
426 | it = self.get_iter_first() | ||
427 | while it: | ||
428 | self.set(it, self.COL_INC, False) | ||
429 | child_it = self.iter_children(it) | ||
430 | while child_it: | ||
431 | self.set(child_it, | ||
432 | self.COL_INC, False, | ||
433 | self.COL_BINB, "") | ||
434 | child_it = self.iter_next(child_it) | ||
435 | it = self.iter_next(it) | ||
436 | |||
437 | self.selection_change_notification() | ||
438 | |||
439 | """ | ||
440 | Resync the state of included items to a backup column before performing the fadeout visible effect | 365 | Resync the state of included items to a backup column before performing the fadeout visible effect |
441 | """ | 366 | """ |
442 | def resync_fadeout_column(self, model_first_iter=None): | 367 | def resync_fadeout_column(self, model_first_iter=None): |
@@ -444,9 +369,6 @@ class PackageListModel(gtk.TreeStore): | |||
444 | while it: | 369 | while it: |
445 | active = self.get_value(it, self.COL_INC) | 370 | active = self.get_value(it, self.COL_INC) |
446 | self.set(it, self.COL_FADE_INC, active) | 371 | self.set(it, self.COL_FADE_INC, active) |
447 | if self.iter_has_child(it): | ||
448 | self.resync_fadeout_column(self.iter_children(it)) | ||
449 | |||
450 | it = self.iter_next(it) | 372 | it = self.iter_next(it) |
451 | 373 | ||
452 | # | 374 | # |
@@ -533,7 +455,7 @@ class RecipeListModel(gtk.ListStore): | |||
533 | 455 | ||
534 | """ | 456 | """ |
535 | Create, if required, and return a filtered gtk.TreeModelSort | 457 | Create, if required, and return a filtered gtk.TreeModelSort |
536 | containing only the items which are items specified by filter | 458 | containing only the items specified by filter |
537 | """ | 459 | """ |
538 | def tree_model(self, filter, excluded_items_ahead=False, included_items_ahead=True): | 460 | def tree_model(self, filter, excluded_items_ahead=False, included_items_ahead=True): |
539 | model = self.filter_new() | 461 | model = self.filter_new() |
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py index b879cc55db..4544543c4b 100755 --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py | |||
@@ -52,6 +52,13 @@ class PackageSelectionPage (HobPage): | |||
52 | 'col_max' : 300, | 52 | 'col_max' : 300, |
53 | 'expand' : 'True' | 53 | 'expand' : 'True' |
54 | }, { | 54 | }, { |
55 | 'col_name' : 'Recipe', | ||
56 | 'col_id' : PackageListModel.COL_RCP, | ||
57 | 'col_style': 'text', | ||
58 | 'col_min' : 100, | ||
59 | 'col_max' : 250, | ||
60 | 'expand' : 'True' | ||
61 | }, { | ||
55 | 'col_name' : 'Brought in by (+others)', | 62 | 'col_name' : 'Brought in by (+others)', |
56 | 'col_id' : PackageListModel.COL_BINB, | 63 | 'col_id' : PackageListModel.COL_BINB, |
57 | 'col_style': 'binb', | 64 | 'col_style': 'binb', |
@@ -84,6 +91,13 @@ class PackageSelectionPage (HobPage): | |||
84 | 'col_max' : 500, | 91 | 'col_max' : 500, |
85 | 'expand' : 'True' | 92 | 'expand' : 'True' |
86 | }, { | 93 | }, { |
94 | 'col_name' : 'Recipe', | ||
95 | 'col_id' : PackageListModel.COL_RCP, | ||
96 | 'col_style': 'text', | ||
97 | 'col_min' : 100, | ||
98 | 'col_max' : 250, | ||
99 | 'expand' : 'True' | ||
100 | }, { | ||
87 | 'col_name' : 'Included', | 101 | 'col_name' : 'Included', |
88 | 'col_id' : PackageListModel.COL_INC, | 102 | 'col_id' : PackageListModel.COL_INC, |
89 | 'col_style': 'check toggle', | 103 | 'col_style': 'check toggle', |
@@ -99,7 +113,7 @@ class PackageSelectionPage (HobPage): | |||
99 | def __init__(self, builder): | 113 | def __init__(self, builder): |
100 | super(PackageSelectionPage, self).__init__(builder, "Edit packages") | 114 | super(PackageSelectionPage, self).__init__(builder, "Edit packages") |
101 | 115 | ||
102 | # set invisiable members | 116 | # set invisible members |
103 | self.recipe_model = self.builder.recipe_model | 117 | self.recipe_model = self.builder.recipe_model |
104 | self.package_model = self.builder.package_model | 118 | self.package_model = self.builder.package_model |
105 | 119 | ||
@@ -196,13 +210,7 @@ class PackageSelectionPage (HobPage): | |||
196 | else: | 210 | else: |
197 | self.builder.show_configuration() | 211 | self.builder.show_configuration() |
198 | 212 | ||
199 | def _expand_all(self): | ||
200 | for tab in self.tables: | ||
201 | tab.table_tree.expand_all() | ||
202 | |||
203 | def refresh_selection(self): | 213 | def refresh_selection(self): |
204 | self._expand_all() | ||
205 | |||
206 | self.builder.configuration.selected_packages = self.package_model.get_selected_packages() | 214 | self.builder.configuration.selected_packages = self.package_model.get_selected_packages() |
207 | self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages() | 215 | self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages() |
208 | selected_packages_num = len(self.builder.configuration.selected_packages) | 216 | selected_packages_num = len(self.builder.configuration.selected_packages) |