[GRASS-SVN] r72436 - in grass/branches/releasebranch_7_4/gui/wxpython: core gui_core lmgr mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 20 12:07:29 PDT 2018


Author: martinl
Date: 2018-03-20 12:07:28 -0700 (Tue, 20 Mar 2018)
New Revision: 72436

Modified:
   grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py
   grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py
   grass/branches/releasebranch_7_4/gui/wxpython/lmgr/frame.py
   grass/branches/releasebranch_7_4/gui/wxpython/mapdisp/main.py
Log:
wxGUI: set up default map display properties when new display is open
       add settings to show comp. region extent, see #3519
       (merge r72379, r72381 from trunk)


Modified: grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py
===================================================================
--- grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py	2018-03-20 19:03:07 UTC (rev 72435)
+++ grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py	2018-03-20 19:07:28 UTC (rev 72436)
@@ -188,6 +188,9 @@
                 'autoZooming': {
                     'enabled': False
                 },
+                'showCompExtent': {
+                    'enabled': False
+                },
                 'statusbarMode': {
                     'selection': 0
                 },

Modified: grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py	2018-03-20 19:03:07 UTC (rev 72435)
+++ grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py	2018-03-20 19:07:28 UTC (rev 72436)
@@ -973,6 +973,22 @@
                       pos=(row, 0), span=(1, 2))
 
         #
+        # show computation extent
+        #
+        row += 1
+        showCompExtent = wx.CheckBox(parent=panel, id=wx.ID_ANY, label=_(
+            "Show computational region extent"), name="IsChecked")
+        showCompExtent.SetValue(
+            self.settings.Get(
+                group='display',
+                key='showCompExtent',
+                subkey='enabled'))
+        self.winId['display:showCompExtent:enabled'] = showCompExtent.GetId()
+
+        gridSizer.Add(showCompExtent,
+                      pos=(row, 0), span=(1, 2))
+        
+        #
         # mouse wheel zoom
         #
         row += 1

Modified: grass/branches/releasebranch_7_4/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_4/gui/wxpython/lmgr/frame.py	2018-03-20 19:03:07 UTC (rev 72435)
+++ grass/branches/releasebranch_7_4/gui/wxpython/lmgr/frame.py	2018-03-20 19:07:28 UTC (rev 72436)
@@ -2094,6 +2094,18 @@
             except:
                 pass
 
+        # set default properties
+        mapdisplay.SetProperties(render=UserSettings.Get(
+            group='display', key='autoRendering', subkey='enabled'),
+                                 mode=UserSettings.Get(
+            group='display', key='statusbarMode', subkey='selection'),
+                                 alignExtent=UserSettings.Get(
+            group='display', key='alignExtent', subkey='enabled'),
+                                 constrainRes=UserSettings.Get(
+            group='display', key='compResolution', subkey='enabled'),
+                                 showCompExtent=UserSettings.Get(
+            group='display', key='showCompExtent', subkey='enabled'))
+
         self.displayIndex += 1
 
         return self.GetMapDisplay()

Modified: grass/branches/releasebranch_7_4/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/branches/releasebranch_7_4/gui/wxpython/mapdisp/main.py	2018-03-20 19:03:07 UTC (rev 72435)
+++ grass/branches/releasebranch_7_4/gui/wxpython/mapdisp/main.py	2018-03-20 19:07:28 UTC (rev 72436)
@@ -533,6 +533,18 @@
 
         self.mapFrm.GetMapWindow().SetAlwaysRenderEnabled(False)
 
+        # set default properties
+        self.mapFrm.SetProperties(render=UserSettings.Get(
+            group='display', key='autoRendering', subkey='enabled'),
+                                 mode=UserSettings.Get(
+            group='display', key='statusbarMode', subkey='selection'),
+                                 alignExtent=UserSettings.Get(
+            group='display', key='alignExtent', subkey='enabled'),
+                                 constrainRes=UserSettings.Get(
+            group='display', key='compResolution', subkey='enabled'),
+                                 showCompExtent=UserSettings.Get(
+            group='display', key='showCompExtent', subkey='enabled'))
+
         self.Map.saveToFile.connect(lambda cmd: self.mapFrm.DOutFile(cmd))
         self.Map.dToRast.connect(lambda cmd: self.mapFrm.DToRast(cmd))
         self.Map.query.connect(



More information about the grass-commit mailing list