From c5b56f88132d45481137645b03ac0d3321fb9ce4 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 24 Nov 2008 21:11:08 +0100 Subject: Allow session stuff being stored in the config --- portato/gui/windows/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'portato/gui/windows') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index d2949e7..ee723b5 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1171,6 +1171,22 @@ class MainWindow (Window): for p in queue.get_plugins(): self.session.add_handler(([(p.name.replace(" ","_"), "plugins")], load_plugin(p), save_plugin(p))) + # the other things + def load_cfg ((name, cat)): + def load (v): + self.cfg.set_session(name, cat, v) + + def save (): + v = self.cfg.get_session(name, cat) + if v is None: + return "" + else: + return v + + self.session.add_handler(([(name, cat)], load, save)) + + map(load_cfg, [("prefheight", "window"), ("prefwidth", "window")]) + # now we have the handlers -> load self.session.load(defaults_only) -- cgit v1.2.3-70-g09d2