diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-20 13:01:27 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-20 13:01:27 +0200 |
commit | 261b162f4512609fb8fabd23f44e6ddc0536d43b (patch) | |
tree | 381c68b9879f981866c60104862ba0dc4df441f9 /portato/gui/windows/preference.py | |
parent | 8c016e8ace989e3e1d0dadd7e54e61849341168f (diff) | |
download | portato-261b162f4512609fb8fabd23f44e6ddc0536d43b.tar.gz portato-261b162f4512609fb8fabd23f44e6ddc0536d43b.tar.bz2 portato-261b162f4512609fb8fabd23f44e6ddc0536d43b.zip |
More declarative handling of the database types
Diffstat (limited to 'portato/gui/windows/preference.py')
-rw-r--r-- | portato/gui/windows/preference.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index 2b6974e..dd2a892 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -168,14 +168,12 @@ class PreferenceWindow (AbstractDialog): self.databaseCombo = self.tree.get_widget("databaseCombo") model = gtk.ListStore(str, str, str) - ctr = 0 active = 0 - for k, name, desc in db.types: - if k == dbtype: + for ctr, (key, t) in enumerate(db.types.iteritems()): + if key == dbtype: active = ctr - model.append([name, desc, k]) - ctr += 1 + model.append([t.name, t.descr, key]) self.databaseCombo.set_model(model) self.databaseCombo.set_active(active) |