summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 01:33:35 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 01:33:35 +0200
commit4b9873e84d0fdbab128ce974edcf4cf2169e9b89 (patch)
tree3734a4eae95a8fd14698e44b270903038c0838ba /portato
parent484cef45413af0eadcc8f312a0df66de83ff4ba9 (diff)
downloadportato-4b9873e84d0fdbab128ce974edcf4cf2169e9b89.tar.gz
portato-4b9873e84d0fdbab128ce974edcf4cf2169e9b89.tar.bz2
portato-4b9873e84d0fdbab128ce974edcf4cf2169e9b89.zip
Make selection work with the other cat layout
Diffstat (limited to 'portato')
-rw-r--r--portato/gui/windows/main.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 5444f81..1cda7bd 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1036,7 +1036,25 @@ class MainWindow (Window):
for cname, path in ((x[col], x.path) for x in list.get_model()):
if cname == name:
pos = path
+ break
+
+ if pos == "0" and isinstance(list.get_model(), gtk.TreeStore): # try the new split up
+ try:
+ pre, post = name.split("-", 1)
+ except ValueError: # nothing to split
+ pass
+ else:
+ for row in list.get_model():
+ if row[col] == pre: # found first part
+ pos = row.path
+ list.expand_row(pos, False)
+ for cname, path in ((x[col], x.path) for x in row.iterchildren()):
+ if cname == post: # found second
+ pos = ":".join(map(str,path))
+ break
+ break
+ debug("Selecting path '%s'.", pos)
list.get_selection().select_path(pos)
list.scroll_to_cell(pos)