[GRASS-SVN] r46708 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 15 03:22:52 EDT 2011


Author: mmetz
Date: 2011-06-15 00:22:52 -0700 (Wed, 15 Jun 2011)
New Revision: 46708

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
Log:
fix window positioning, do not stray away too far from standards

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2011-06-14 12:30:25 UTC (rev 46707)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2011-06-15 07:22:52 UTC (rev 46708)
@@ -82,10 +82,10 @@
                 # use default window layout (layer manager, displays, ...)
                 'defWindowPos' : {
                     'enabled' : True,
-                    'dim' : '%d,0,%d,%d,0,0,%d,%d' % \
-                        (globalvar.MAP_WINDOW_SIZE[0] + 5,
-                         globalvar.GM_WINDOW_SIZE[0],
+                    'dim' : '0,0,%d,%d,%d,0,%d,%d' % \
+                        (globalvar.GM_WINDOW_SIZE[0],
                          globalvar.GM_WINDOW_SIZE[1],
+                         globalvar.GM_WINDOW_SIZE[0],
                          globalvar.MAP_WINDOW_SIZE[0],
                          globalvar.MAP_WINDOW_SIZE[1])
                     },
@@ -1069,6 +1069,26 @@
             else:
                 self.settings.Set(group, value, key, subkey)
         
+        #
+        # update default window dimension
+        #
+        if self.settings.Get(group = 'general', key = 'defWindowPos', subkey = 'enabled') is True:
+            dim = ''
+            # layer manager
+            pos = self.parent.GetPosition()
+            size = self.parent.GetSize()
+            dim = '%d,%d,%d,%d' % (pos[0], pos[1], size[0], size[1])
+            # opened displays
+            for page in range(0, self.parent.gm_cb.GetPageCount()):
+                pos = self.parent.gm_cb.GetPage(page).maptree.mapdisplay.GetPosition()
+                size = self.parent.gm_cb.GetPage(page).maptree.mapdisplay.GetSize()
+
+                dim += ',%d,%d,%d,%d' % (pos[0], pos[1], size[0], size[1])
+
+            self.settings.Set(group = 'general', key = 'defWindowPos', subkey = 'dim', value = dim)
+        else:
+            self.settings.Set(group = 'general', key = 'defWindowPos', subkey = 'dim', value = '')
+
         return True
 
 class PreferencesDialog(PreferencesBaseDialog):
@@ -2075,33 +2095,7 @@
         dlg.Destroy()
 
         event.Skip()
-        
-    def _updateSettings(self):
-        """!Update user settings"""
-        PreferencesBaseDialog._updateSettings(self)
-        
-        #
-        # update default window dimension
-        #
-        if self.settings.Get(group = 'general', key = 'defWindowPos', subkey = 'enabled') is True:
-            dim = ''
-            # layer manager
-            pos = self.parent.GetPosition()
-            size = self.parent.GetSize()
-            dim = '%d,%d,%d,%d' % (pos[0], pos[1], size[0], size[1])
-            # opened displays
-            for page in range(0, self.parent.gm_cb.GetPageCount()):
-                pos = self.parent.gm_cb.GetPage(page).maptree.mapdisplay.GetPosition()
-                size = self.parent.gm_cb.GetPage(page).maptree.mapdisplay.GetSize()
 
-                dim += ',%d,%d,%d,%d' % (pos[0], pos[1], size[0], size[1])
-
-            self.settings.Set(group = 'general', key = 'defWindowPos', subkey = 'dim', value = dim)
-        else:
-            self.settings.Set(group = 'general', key = 'defWindowPos', subkey = 'dim', value = '')
-
-        return True
-
 class DefaultFontDialog(wx.Dialog):
     """
     Opens a file selection dialog to select default font



More information about the grass-commit mailing list