[GRASS-SVN] r72387 - in grass/trunk/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 18 16:18:00 PDT 2018


Author: martinl
Date: 2018-03-18 16:18:00 -0700 (Sun, 18 Mar 2018)
New Revision: 72387

Modified:
   grass/trunk/gui/wxpython/core/settings.py
   grass/trunk/gui/wxpython/gui_core/preferences.py
Log:
wxGUI/preferences: add new option for random colors (vector)

Modified: grass/trunk/gui/wxpython/core/settings.py
===================================================================
--- grass/trunk/gui/wxpython/core/settings.py	2018-03-18 21:03:29 UTC (rev 72386)
+++ grass/trunk/gui/wxpython/core/settings.py	2018-03-18 23:18:00 UTC (rev 72387)
@@ -320,6 +320,9 @@
                         'enabled': True
                     },
                 },
+                'randomColors': {
+                    'enabled': False,
+                },
             },
             #
             # vdigit
@@ -1294,4 +1297,8 @@
             types.append(ftype)
     settings.append('type=%s' % ','.join(types))
 
+    if UserSettings.Get(group='vectorLayer',
+                        key='randomColors', subkey='enabled'):
+        settings.append('-c')
+
     return settings

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2018-03-18 21:03:29 UTC (rev 72386)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2018-03-18 23:18:00 UTC (rev 72387)
@@ -1416,6 +1416,21 @@
             hlWidth, pos=(row, col + 1),
             span=(1, 2),
             flag=wx.ALIGN_RIGHT)
+        
+        # random colors
+        row +=1
+        randomColors = wx.CheckBox(parent=panel, id=wx.ID_ANY, label=_(
+            "Random colors according to category number "))
+        randomColors.SetValue(
+            self.settings.Get(
+                group='vectorLayer',
+                key='randomColors',
+                subkey='enabled'))
+        self.winId['vectorLayer:randomColors:enabled'] = randomColors.GetId()
+        gridSizer.Add(
+            randomColors, pos=(row, 0),
+            span=(1, 2),
+            flag=wx.ALIGN_LEFT)
 
         # symbol
         row = 0



More information about the grass-commit mailing list