summaryrefslogtreecommitdiffstats
path: root/lib/bb/ui
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-18 14:43:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-23 09:59:50 -0700
commitcf79424592a81378de5edad11cf6c4f427c94bcc (patch)
tree31bf8cc25b4267ae41edcdd5917dced1c0c51053 /lib/bb/ui
parente176dcf637da2d0105a4361a46d5df5238e3b8ce (diff)
downloadbitbake-cf79424592a81378de5edad11cf6c4f427c94bcc.tar.gz
bb/ui/crumbs/tasklistmodel: track the PN for each entry in the model
Now that we've switched to packages in the model, rather than PN, it makes sense to add an extra field to store the PN of the package. This patch includes a convenience method to retrieve a list of selected PN's. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'lib/bb/ui')
-rw-r--r--lib/bb/ui/crumbs/tasklistmodel.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index d2f49d164..392158113 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -89,7 +89,7 @@ class TaskListModel(gtk.ListStore):
providing convenience functions to access gtk.TreeModel subclasses which
provide filtered views of the data.
"""
- (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_PATH) = range(10)
+ (COL_NAME, COL_DESC, COL_LIC, COL_GROUP, COL_DEPS, COL_BINB, COL_TYPE, COL_INC, COL_IMG, COL_PATH, COL_PN) = range(11)
__gsignals__ = {
"tasklist-populated" : (gobject.SIGNAL_RUN_LAST,
@@ -122,6 +122,7 @@ class TaskListModel(gtk.ListStore):
gobject.TYPE_STRING,
gobject.TYPE_BOOLEAN,
gobject.TYPE_BOOLEAN,
+ gobject.TYPE_STRING,
gobject.TYPE_STRING)
"""
@@ -265,7 +266,8 @@ class TaskListModel(gtk.ListStore):
self.COL_LIC, lic, self.COL_GROUP, group,
self.COL_DEPS, " ".join(packages[p]), self.COL_BINB, "",
self.COL_TYPE, atype, self.COL_INC, False,
- self.COL_IMG, False, self.COL_PATH, filename)
+ self.COL_IMG, False, self.COL_PATH, filename,
+ self.COL_PN, item)
self.emit("tasklist-populated")
@@ -527,6 +529,20 @@ class TaskListModel(gtk.ListStore):
it = self.contents.iter_next(it)
return userpkgs, allpkgs
+ """
+ Return a squished (uniquified) list of the PN's of all selected items
+ """
+ def get_selected_pn(self):
+ pns = []
+
+ it = self.contents.get_iter_first()
+ while it:
+ if self.contents.get_value(it, self.COL_BINB):
+ pns.append(self.contents.get_value(it, self.COL_PN))
+ it = self.contents.iter_next(it)
+
+ return self.squish(pns)
+
def image_contents_removed(self):
it = self.get_iter_first()
while it: