Pārlūkot izejas kodu

wxGUI: add settings to show comp. region extent, see https://trac.osgeo.org/grass/ticket/3519

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72381 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 7 gadi atpakaļ
vecāks
revīzija
c53617eba3

+ 3 - 0
gui/wxpython/core/settings.py

@@ -190,6 +190,9 @@ class Settings:
                 'autoZooming': {
                     'enabled': False
                 },
+                'showCompExtent': {
+                    'enabled': False
+                },
                 'statusbarMode': {
                     'selection': 0
                 },

+ 16 - 0
gui/wxpython/gui_core/preferences.py

@@ -965,6 +965,22 @@ class PreferencesDialog(PreferencesBaseDialog):
                       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

+ 6 - 4
gui/wxpython/lmgr/frame.py

@@ -2097,12 +2097,14 @@ class GMFrame(wx.Frame):
         # set default properties
         mapdisplay.SetProperties(render=UserSettings.Get(
             group='display', key='autoRendering', subkey='enabled'),
-                              mode=UserSettings.Get(
+                                 mode=UserSettings.Get(
             group='display', key='statusbarMode', subkey='selection'),
-                              alignExtent=UserSettings.Get(
+                                 alignExtent=UserSettings.Get(
             group='display', key='alignExtent', subkey='enabled'),
-                              constrainRes=UserSettings.Get(
-            group='display', key='compResolution', subkey='enabled'))
+                                 constrainRes=UserSettings.Get(
+            group='display', key='compResolution', subkey='enabled'),
+                                 showCompExtent=UserSettings.Get(
+            group='display', key='showCompExtent', subkey='enabled'))
 
         self.displayIndex += 1
 

+ 12 - 0
gui/wxpython/mapdisp/main.py

@@ -535,6 +535,18 @@ class MapApp(wx.App):
 
         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(