summaryrefslogtreecommitdiff
path: root/portato/gui/gtk/wrapper.py
diff options
context:
space:
mode:
authorNecoro <>2008-01-18 01:36:13 +0000
committerNecoro <>2008-01-18 01:36:13 +0000
commit53f4e6ccd74d217409ec38b506d7e7e4aeb7d738 (patch)
tree6e836c58f8a3a6b715dc9ea0aa2c300218b00e01 /portato/gui/gtk/wrapper.py
parent9fbebc55eae3efabaeeab9d2d25a3952eccba51f (diff)
downloadportato-53f4e6ccd74d217409ec38b506d7e7e4aeb7d738.tar.gz
portato-53f4e6ccd74d217409ec38b506d7e7e4aeb7d738.tar.bz2
portato-53f4e6ccd74d217409ec38b506d7e7e4aeb7d738.zip
r643@Devoty: necoro | 2008-01-16 18:55:49 +0100
Fixed small bug in PackageTable.cb_package_revert_clicked r646@Devoty: necoro | 2008-01-18 00:12:30 +0100 Make tabpositions being configurable by the user r647@Devoty: necoro | 2008-01-18 01:38:19 +0100 Renamed 'shm' to '_shm' to not hide the global one r648@Devoty: necoro | 2008-01-18 01:38:29 +0100 Renamed 'shm' to '_shm' to not hide the global one r649@Devoty: necoro | 2008-01-18 02:34:43 +0100 Added update queues; general UI improvement
Diffstat (limited to '')
-rw-r--r--portato/gui/gtk/wrapper.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/portato/gui/gtk/wrapper.py b/portato/gui/gtk/wrapper.py
index a322514..cadec6a 100644
--- a/portato/gui/gtk/wrapper.py
+++ b/portato/gui/gtk/wrapper.py
@@ -29,8 +29,9 @@ class GtkTree (Tree):
self.tree = tree
self.cpv_col = col
- self.emergeIt = self.append(None, ["Emerge", ""])
- self.unmergeIt = self.append(None, ["Unmerge", ""])
+ self.emergeIt = None
+ self.unmergeIt = None
+ self.updateIt = None
def build_append_value (self, cpv, oneshot = False, update = False, downgrade = False, version = None, useChange = []):
string = ""
@@ -60,17 +61,38 @@ class GtkTree (Tree):
return [cpv, string]
+ 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 get_emerge_it (self):
+ if self.emergeIt is None:
+ self.emergeIt = self.append(None, ["<b>%s</b>" % _("Install"), ""])
return self.emergeIt
def get_unmerge_it (self):
+ if self.unmergeIt is None:
+ self.unmergeIt = self.append(None, ["<b>%s</b>" % _("Uninstall"), ""])
+
return self.unmergeIt
+ def get_update_it (self):
+ if self.updateIt is None:
+ self.updateIt = self.append(None, ["<b>%s</b>" % _("Update"), ""])
+
+ return self.updateIt
+
+ 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)
+
def is_in_emerge (self, it):
- return self.tree.get_string_from_iter(it).split(":")[0] == self.tree.get_string_from_iter(self.emergeIt)
+ return self.is_in(it, self.emergeIt)
def is_in_unmerge (self, it):
- return self.tree.get_string_from_iter(it).split(":")[0] == self.tree.get_string_from_iter(self.unmergeIt)
+ return self.is_in(it, self.unmergeIt)
+
+ def is_in_update (self, it):
+ return self.is_in(it, self.updateIt)
def iter_has_parent (self, it):
return (self.tree.iter_parent(it) != None)
@@ -90,10 +112,18 @@ class GtkTree (Tree):
def get_value (self, it, column):
return self.tree.get_value(it, column)
+ def iter_equal (self, it, other_it):
+ return self.tree.get_string_from_iter(it) == self.tree.get_string_from_iter(other_it)
+
def append (self, parent = None, values = None):
return self.tree.append(parent, values)
def remove (self, it):
+
+ if self.emergeIt and self.iter_equal(it, self.emergeIt) : self.emergeIt = None
+ elif self.unmergeIt and self.iter_equal(it, self.unmergeIt) : self.unmergeIt = None
+ elif self.updateIt and self.iter_equal(it, self.updateIt) : self.updateIt = None
+
self.tree.remove(it)
def get_original (self):