summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui')
-rw-r--r--portato/gui/windows/main.py41
1 files changed, 35 insertions, 6 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 0a217ea..7ce66b8 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -338,11 +338,16 @@ class PackageTable:
self.useList.set_enable_tree_lines(True)
def build_version_list (self):
- store = gtk.ListStore(gtk.gdk.Pixbuf, str)
+ store = gtk.ListStore(gtk.gdk.Pixbuf, str, str)
# build view
self.versionList.set_model(store)
+
col = gtk.TreeViewColumn(_("Versions"))
+ col.set_property("expand", True)
+
+ self.slotcol = gtk.TreeViewColumn(_("Slot"))
+ self.slotcol.set_property("expand", True)
# adding the pixbuf
cell = gtk.CellRendererPixbuf()
@@ -354,21 +359,42 @@ class PackageTable:
col.pack_start(cell, True)
col.add_attribute(cell, "text", 1)
+ # adding the slot
+ cell = gtk.CellRendererText()
+ self.slotcol.pack_start(cell, True)
+ self.slotcol.add_attribute(cell, "text", 2)
+
self.versionList.append_column(col)
+ self.versionList.append_column(self.slotcol)
def fill_version_list (self):
store = self.versionList.get_model()
+
+ # this is here for performance reasons
+ # to not query the package with info, we do not need
+ if self.main.cfg.get_boolean("showSlots", "GUI"):
+ def get_slot(pkg):
+ return pkg.get_package_settings("SLOT")
+
+ self.slotcol.set_visible(True)
+
+ else:
+ def get_slot(*args):
+ return ""
+
+ self.slotcol.set_visible(False)
# append versions
- for vers, inst in ((x.get_version(), x.is_installed()) for x in self.packages):
+ for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in self.packages):
if inst:
icon = self.main.instPixbuf
else:
icon = None
- store.append([icon, vers])
+
+ store.append([icon, vers, slot])
- sel = self.versionList.get_selection()
+ pos = ((0,)) # default
# activate the first one
try:
@@ -379,10 +405,13 @@ class PackageTable:
best_version = system.find_best_match(self.packages[0].get_cp(), only_installed = (self.instPackages != [])).get_version()
for i in range(len(self.packages)):
if self.packages[i].get_version() == best_version:
- sel.select_path((i,))
+ pos = (i,)
break
except AttributeError: # no package found
- sel.select_path((0,))
+ pass
+
+ self.versionList.get_selection().select_path(pos)
+ self.versionList.scroll_to_cell(pos)
def actual_package (self):
"""Returns the actual selected package.
lates/portato.glade?h=0.14&id=986bced5ceb8922273cf2e3c1ddd8457363a8ccf&follow=1'>changed design / added linknecoro5-86/+188 2007-07-24made the resume_loop-plugin change titles toonecoro5-7/+22 2007-07-21added logviewersnecoro7-215/+429 2007-07-21updated howtonecoro1-14/+24 2007-07-20new Plugin Schemenecoro1-5/+4 2007-07-20new Plugin Schemenecoro1-1/+1 2007-07-20new Plugin Schemenecoro9-162/+214 2007-07-13fixesnecoro4-27/+37 2007-07-13new fancier log outputnecoro14-127/+116 2007-07-11added SIGSTOP/SIGCONT support; SIGTERM now works ;)necoro8-208/+275 2007-07-09bug in shutdown pluginnecoro2-5/+12 2007-07-09added resume_loop pluginnecoro1-1/+1 2007-07-09added resume_loop pluginnecoro10-22/+162 2007-07-07some more documentationnecoro6-4/+108 2007-07-07Some documentation worknecoro7-18/+129