[GRASS-SVN] r72437 - in grass/branches/releasebranch_7_4/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 20 12:09:33 PDT 2018


Author: martinl
Date: 2018-03-20 12:09:33 -0700 (Tue, 20 Mar 2018)
New Revision: 72437

Modified:
   grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py
   grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py
Log:
wxGUI/preferences: add new option for random colors (vector) (merge r72387 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:07:28 UTC (rev 72436)
+++ grass/branches/releasebranch_7_4/gui/wxpython/core/settings.py	2018-03-20 19:09:33 UTC (rev 72437)
@@ -318,6 +318,9 @@
                         'enabled': True
                     },
                 },
+                'randomColors': {
+                    'enabled': False,
+                },
             },
             #
             # vdigit
@@ -1289,4 +1292,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/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:07:28 UTC (rev 72436)
+++ grass/branches/releasebranch_7_4/gui/wxpython/gui_core/preferences.py	2018-03-20 19:09:33 UTC (rev 72437)
@@ -1424,6 +1424,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