summaryrefslogtreecommitdiff
path: root/portato/gui/windows
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-11-24 21:11:42 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-11-24 21:11:42 +0100
commit2d7c67c144221b98fb9fa6618953c58e9e190477 (patch)
tree8fd09cc4e083682c62f6077d8c315c067469f64d /portato/gui/windows
parentc5b56f88132d45481137645b03ac0d3321fb9ce4 (diff)
downloadportato-2d7c67c144221b98fb9fa6618953c58e9e190477.tar.gz
portato-2d7c67c144221b98fb9fa6618953c58e9e190477.tar.bz2
portato-2d7c67c144221b98fb9fa6618953c58e9e190477.zip
Save pref window dimensions in session
Diffstat (limited to '')
-rw-r--r--portato/gui/windows/preference.py19
1 files changed, 19 insertions, 0 deletions
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)