summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 00:59:22 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 00:59:22 +0200
commit484cef45413af0eadcc8f312a0df66de83ff4ba9 (patch)
treec374f9a272a5702c5f31316858810133e4a44ec3 /portato
parent5f9e42aa2ecac5c718496c95bc631830b92ae4ef (diff)
downloadportato-484cef45413af0eadcc8f312a0df66de83ff4ba9.tar.gz
portato-484cef45413af0eadcc8f312a0df66de83ff4ba9.tar.bz2
portato-484cef45413af0eadcc8f312a0df66de83ff4ba9.zip
Porthole like display in the cat list
Diffstat (limited to '')
-rw-r--r--portato/gui/windows/main.py43
1 files changed, 39 insertions, 4 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 4eac88b..5444f81 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -19,6 +19,7 @@ import gobject
# other
import os.path
import itertools as itt
+from collections import defaultdict
# our backend stuff
from ...backend import flags, system # must be the first to avoid circular deps
@@ -774,7 +775,11 @@ class MainWindow (Window):
Builds the category list.
"""
- store = gtk.ListStore(str)
+ if False:
+ store = gtk.ListStore(str)
+ else:
+ store = gtk.TreeStore(str)
+
self.fill_cat_store(store)
self.catList.set_model(store)
@@ -799,8 +804,27 @@ class MainWindow (Window):
cats = self.db.get_categories(installed = not self.showAll)
- for p in cats:
- store.append([p])
+ if False:
+ for p in cats:
+ store.append([p])
+ else:
+ splitCats = defaultdict(list)
+ for c in cats:
+ try:
+ pre, post = c.split("-", 1)
+ except ValueError: # no "-" in cat name -- do not split
+ debug("Category '%s' can't be split up. Should be no harm.", c)
+ splitCats["not-split"].append(c)
+ else:
+ splitCats[pre].append(post)
+
+ for sc in splitCats:
+ if sc == "not-split":
+ it = None # append not splitted stuff to root
+ else:
+ it = store.append(None, [sc])
+ for cat in splitCats[sc]:
+ store.append(it, [cat])
# sort them alphabetically
store.set_sort_column_id(0, gtk.SORT_ASCENDING)
@@ -1183,7 +1207,18 @@ class MainWindow (Window):
# get the selected category
store, it = selection.get_selected()
if it:
- self.selCatName = store.get_value(it, 0)
+ if False:
+ self.selCatName = store.get_value(it, 0)
+ else:
+ parent = store.iter_parent(it)
+ if parent is None:
+ if store.iter_has_child(it): # this is a split up selector -> do nothing
+ return True
+ else:
+ self.selCatName = store.get_value(it, 0) # this is a non-split up top
+ else:
+ self.selCatName = ("%s-%s" % (store.get_value(parent, 0), store.get_value(it, 0)))
+
self.fill_pkg_store(name = self.selCatName)
return True
me values as the ones that were used before. The advantage of doing this is to make it easier to use some distro-specific layout. When this is desirable, these variables can be overridden to what is appropriate at package build time. 2012-09-06Add dependencies to README.Jason A. Donenfeld1-0/+8 2012-09-06Change debian name.Jason A. Donenfeld5-5/+4 2012-09-06Use more normal sleep variant.1.1.1Jason A. Donenfeld1-1/+1 2012-09-06Use --noreport instead of head -n -2 for tree so that it works on mac.Jason A. Donenfeld1-1/+1 Reported-by: Theo Belaire <tbelaire@uwaterloo.ca> 2012-09-05Be sure to explicitly state that install is a phony target.Jason A. Donenfeld1-0/+2 2012-09-05Bump debian version horribly.1.1Jason A. Donenfeld2-2/+2 2012-09-04No echo mode.Jason A. Donenfeld2-16/+42 Add a --no-echo flag to the insert operation so that the password isn't echoed when entering it. This requires the user to echo the password twice for confirmation. Reported-by: Dominic Lüchinger <d.luechinger@snowgarden.ch> 2012-09-04Properly quote the path too.Jason A. Donenfeld1-1/+1 2012-09-04Allow passwords having spaces to go unbroken to the clipboard.Bernardo Freitas Paulo da Costa1-1/+1 This also prevents showing the second <word> of the password in the prompt. 2012-09-04Separate out the massive git example.Jason A. Donenfeld1-10/+14 2012-09-04Prepare for debianification.1.0Jason A. Donenfeld9-4/+60 2012-09-03Fix readme typo.Jason A. Donenfeld1-1/+1 2012-09-03Show program name properly in error message.Jason A. Donenfeld1-1/+1 2012-09-03Move examples into manpage.Jason A. Donenfeld4-93/+224 2012-09-03Make into a real project.Jason A. Donenfeld8-5/+173 2012-09-03Support pass gitJason A. Donenfeld2-1/+15 2012-08-31Add remove synonyms.Jason A. Donenfeld1-2/+2 2012-08-31Use basename in usage.Jason A. Donenfeld1-2/+1 2012-08-19now using gpg_id as a varMatthew Ramirez1-2/+2 2012-08-07Forty five seconds.Jason A. Donenfeld1-1/+1 2012-08-06Deal with klipper and new lines.Jason A. Donenfeld1-3/+19 2012-08-06Update examples.Jason A. Donenfeld1-7/+7 2012-08-06Update readme.Jason A. Donenfeld1-11/+13 2012-08-06Be slicker and more like git.Jason A. Donenfeld1-114/+173