[GRASS-SVN] r69580 - in grass/trunk/gui/wxpython: core vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 26 08:59:39 PDT 2016


Author: annakrat
Date: 2016-09-26 08:59:39 -0700 (Mon, 26 Sep 2016)
New Revision: 69580

Modified:
   grass/trunk/gui/wxpython/core/settings.py
   grass/trunk/gui/wxpython/vdigit/preferences.py
   grass/trunk/gui/wxpython/vdigit/wxdisplay.py
Log:
wxGUI/vdigit: solve backwards compatibility for #2848

Modified: grass/trunk/gui/wxpython/core/settings.py
===================================================================
--- grass/trunk/gui/wxpython/core/settings.py	2016-09-26 15:02:42 UTC (rev 69579)
+++ grass/trunk/gui/wxpython/core/settings.py	2016-09-26 15:59:39 UTC (rev 69580)
@@ -394,7 +394,8 @@
                 # snapping
                 'snapping': {
                     'value': 10,
-                    'units': 0
+                    'unit': 0,  # new
+                    'units': 'screen pixels'  # old for backwards comp.
                 },
                 'snapToVertex': {
                     'enabled': True

Modified: grass/trunk/gui/wxpython/vdigit/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/preferences.py	2016-09-26 15:02:42 UTC (rev 69579)
+++ grass/trunk/gui/wxpython/vdigit/preferences.py	2016-09-26 15:59:39 UTC (rev 69580)
@@ -220,7 +220,7 @@
         try:
             self.snappingUnit.SetSelection(UserSettings.Get(group='vdigit',
                                                             key="snapping",
-                                                            subkey='units'))
+                                                            subkey='unit'))
         except:
             self.snappingUnit.SetSelection(0)
         self.snappingUnit.Bind(wx.EVT_CHOICE, self.OnChangeSnappingUnits)
@@ -1003,7 +1003,7 @@
         # snapping
         UserSettings.Set(group='vdigit', key="snapping", subkey='value',
                          value=int(self.snappingValue.GetValue()))
-        UserSettings.Set(group='vdigit', key="snapping", subkey='units',
+        UserSettings.Set(group='vdigit', key="snapping", subkey='unit',
                          value=self.snappingUnit.GetSelection())
         UserSettings.Set(group='vdigit', key="snapToVertex", subkey='enabled',
                          value=self.snapVertex.IsChecked())

Modified: grass/trunk/gui/wxpython/vdigit/wxdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdisplay.py	2016-09-26 15:02:42 UTC (rev 69579)
+++ grass/trunk/gui/wxpython/vdigit/wxdisplay.py	2016-09-26 15:59:39 UTC (rev 69580)
@@ -1107,7 +1107,7 @@
             value = UserSettings.Get(group='vdigit', key=type, subkey='value')
 
         if units is None:
-            units = UserSettings.Get(group='vdigit', key=type, subkey='units')
+            units = UserSettings.Get(group='vdigit', key=type, subkey='unit')
 
         if value < 0:
             value = (self.region['nsres'] + self.region['ewres']) / 2.0



More information about the grass-commit mailing list