From 2d7c67c144221b98fb9fa6618953c58e9e190477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 24 Nov 2008 21:11:42 +0100 Subject: Save pref window dimensions in session --- portato/gui/windows/preference.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'portato/gui/windows/preference.py') diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index 57425a0..fe1947b 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -81,6 +81,21 @@ class PreferenceWindow (AbstractDialog): # our config self.cfg = cfg + # the size + height = self.cfg.get_session("prefheight", "window") + if height is None: + height = int(gtk.gdk.screen_height() * 0.8) # see 4/5 * screen_height as maximum + else: + height = int(height) + + width = self.cfg.get_session("prefwidth", "window") + if width is None: + width = -1 # default + else: + width = int(width) + + self.window.resize(width, height) + # the setter functions self.console_fn = console_fn self.linkbtn_fn = linkbtn_fn @@ -216,3 +231,7 @@ class PreferenceWindow (AbstractDialog): store = self.setList.get_model() store[path][0] = not store[path][0] return True + + def cb_size_changed (self, widget, event, *args): + self.cfg.set_session("prefheight", "window", event.height) + self.cfg.set_session("prefwidth", "window", event.width) -- cgit v1.2.3