summaryrefslogtreecommitdiff
path: root/portato/gui/windows/main.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 01:57:02 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-08 01:57:02 +0200
commit64aae5f99b69042f0e23398c71bcdb1fec78fce9 (patch)
tree54497e4e5c1db6cd37298de2c4ec655a50bc14a7 /portato/gui/windows/main.py
parent4b9873e84d0fdbab128ce974edcf4cf2169e9b89 (diff)
downloadportato-64aae5f99b69042f0e23398c71bcdb1fec78fce9.tar.gz
portato-64aae5f99b69042f0e23398c71bcdb1fec78fce9.tar.bz2
portato-64aae5f99b69042f0e23398c71bcdb1fec78fce9.zip
Make the new behavior configurable
Diffstat (limited to '')
-rw-r--r--portato/gui/windows/main.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 1cda7bd..8a2f170 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -775,10 +775,7 @@ class MainWindow (Window):
Builds the category list.
"""
- if False:
- store = gtk.ListStore(str)
- else:
- store = gtk.TreeStore(str)
+ store = gtk.TreeStore(str)
self.fill_cat_store(store)
@@ -804,9 +801,9 @@ class MainWindow (Window):
cats = self.db.get_categories(installed = not self.showAll)
- if False:
+ if not self.cfg.get_boolean("collapseCats", "GUI"):
for p in cats:
- store.append([p])
+ store.append(None, [p])
else:
splitCats = defaultdict(list)
for c in cats:
@@ -1038,7 +1035,9 @@ class MainWindow (Window):
pos = path
break
- if pos == "0" and isinstance(list.get_model(), gtk.TreeStore): # try the new split up
+ if self.cfg.get_boolean("collapseCats", "GUI") and \
+ 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
@@ -1225,7 +1224,7 @@ class MainWindow (Window):
# get the selected category
store, it = selection.get_selected()
if it:
- if False:
+ if not self.cfg.get_boolean("collapseCats", "GUI"):
self.selCatName = store.get_value(it, 0)
else:
parent = store.iter_parent(it)
@@ -1532,7 +1531,7 @@ class MainWindow (Window):
"""
User wants to open preferences.
"""
- PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos)
+ PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos, self.fill_cat_store)
return True
def cb_about_clicked (self, *args):