summaryrefslogtreecommitdiff
path: root/portato/gui/gtk/wrapper.py
diff options
context:
space:
mode:
authorNecoro <>2008-01-18 21:19:42 +0000
committerNecoro <>2008-01-18 21:19:42 +0000
commit6a9034fb7a161e441934969553ffff63e49348ee (patch)
treec128d3c23dc9d54dfaabc40e8fd4c35a815dbe92 /portato/gui/gtk/wrapper.py
parente49c33d6114ddc8051c349aa325872bd7840289b (diff)
downloadportato-6a9034fb7a161e441934969553ffff63e49348ee.tar.gz
portato-6a9034fb7a161e441934969553ffff63e49348ee.tar.bz2
portato-6a9034fb7a161e441934969553ffff63e49348ee.zip
r664@Devoty: necoro | 2008-01-18 21:40:29 +0100
First support for 'delete on demand' r665@Devoty: necoro | 2008-01-18 22:18:05 +0100 Finished the 'on demand removal'
Diffstat (limited to 'portato/gui/gtk/wrapper.py')
-rw-r--r--portato/gui/gtk/wrapper.py27
1 files changed, 19 insertions, 8 deletions
diff --git a/portato/gui/gtk/wrapper.py b/portato/gui/gtk/wrapper.py
index e601f5d..007970c 100644
--- a/portato/gui/gtk/wrapper.py
+++ b/portato/gui/gtk/wrapper.py
@@ -60,31 +60,42 @@ class GtkTree (Tree):
useChange.sort()
string += "<i>%s</i>" % " ".join(useChange)
- return [cpv, string]
+ return [cpv, string, False]
+
+ def set_in_progress (self, it, to = True):
+ iter = self.first_iter(it)
+ if to:
+ self.tree.set_value(iter, 1, "<b>%s</b>" % _("(In Progress)"))
+ else:
+ self.tree.set_value(iter, 1, "")
+
+ self.tree.set_value(iter, 2, to)
- def set_in_progress (self, it):
- iter = self.tree.get_iter_from_string(self.tree.get_string_from_iter(it).split(":")[0])
- self.tree.set_value(iter, 1, "<b>%s</b>" % _("(In Progress)"))
+ def is_in_progress (self, it):
+ return self.tree.get_value(it, 2)
def get_emerge_it (self):
if self.emergeIt is None:
- self.emergeIt = self.append(None, ["<b>%s</b>" % _("Install"), ""])
+ self.emergeIt = self.append(None, ["<b>%s</b>" % _("Install"), "", False])
return self.emergeIt
def get_unmerge_it (self):
if self.unmergeIt is None:
- self.unmergeIt = self.append(None, ["<b>%s</b>" % _("Uninstall"), ""])
+ self.unmergeIt = self.append(None, ["<b>%s</b>" % _("Uninstall"), "", False])
return self.unmergeIt
def get_update_it (self):
if self.updateIt is None:
- self.updateIt = self.append(None, ["<b>%s</b>" % _("Update"), ""])
+ self.updateIt = self.append(None, ["<b>%s</b>" % _("Update"), "", False])
return self.updateIt
+ def first_iter (self, it):
+ return self.tree.get_iter_from_string(self.tree.get_string_from_iter(it).split(":")[0])
+
def is_in (self, it, in_it):
- return in_it and self.tree.get_string_from_iter(it).split(":")[0] == self.tree.get_string_from_iter(in_it)
+ return in_it and self.iter_equal(self.first_iter(it), in_it)
def is_in_emerge (self, it):
return self.is_in(it, self.emergeIt)