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/templates/PreferenceWindow.glade | 193 ++++++++++++++------------- portato/gui/windows/preference.py | 19 +++ 2 files changed, 116 insertions(+), 96 deletions(-) (limited to 'portato') diff --git a/portato/gui/templates/PreferenceWindow.glade b/portato/gui/templates/PreferenceWindow.glade index 29621b5..97d66fb 100644 --- a/portato/gui/templates/PreferenceWindow.glade +++ b/portato/gui/templates/PreferenceWindow.glade @@ -1,6 +1,6 @@ - + 5 @@ -9,6 +9,7 @@ GTK_WIN_POS_CENTER_ON_PARENT True True + True @@ -272,190 +273,190 @@ - - True - 0 - 5 - <u><i>Masking Keywords</i></u> - True - True - - - 7 - 8 - 5 - - - - + True - 0 - 5 - <u><i>Testing Keywords</i></u> - True - True - 4 - 5 - 5 + 1 + 2 + 3 + 4 - + True 0 - 5 - <u><i>Use-Flags</i></u> - True + File name to use, if package.use is a directory: True - 1 - 2 - 6 + 3 + 4 - + True - - - True - 0 - GTK_SHADOW_OUT - - - True - 0 - <u>You may use the following placeholders:</u> - -<i>$(pkg)</i>: package name -<i>$(cat)</i>: category -<i>$(cat-1)/$(cat-2)</i>: first/second part of the category -<i>$(version)</i> : version of the package - True - - - - - - label_item - - - - + Add only exact version to package.use + 0 + True 2 + 2 + 3 - + True - Add only exact version to package.mask/package.unmask + Add only exact version to package.keywords 0 True 2 - 8 - 9 + 5 + 6 - + True 0 - File name to use, if package.mask/package.unmask is a directory: + File name to use, if package.keywords is a directory: True - 9 - 10 + 6 + 7 - + True 1 2 - 9 - 10 + 6 + 7 - + True 1 2 - 6 - 7 + 9 + 10 - + True 0 - File name to use, if package.keywords is a directory: + File name to use, if package.mask/package.unmask is a directory: True - 6 - 7 + 9 + 10 - + True - Add only exact version to package.keywords + Add only exact version to package.mask/package.unmask 0 True 2 - 5 - 6 + 8 + 9 - + True - Add only exact version to package.use - 0 - True + + + True + 0 + GTK_SHADOW_OUT + + + True + 0 + <u>You may use the following placeholders:</u> + +<i>$(pkg)</i>: package name +<i>$(cat)</i>: category +<i>$(cat-1)/$(cat-2)</i>: first/second part of the category +<i>$(version)</i> : version of the package + True + + + + + + label_item + + + + 2 - 2 - 3 - + True 0 - File name to use, if package.use is a directory: + 5 + <u><i>Use-Flags</i></u> + True True - 3 - 4 + 1 + 2 + 6 - + True + 0 + 5 + <u><i>Testing Keywords</i></u> + True + True - 1 - 2 - 3 - 4 + 4 + 5 + 5 + + + + + True + 0 + 5 + <u><i>Masking Keywords</i></u> + True + True + + + 7 + 8 + 5 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