[GRASS-SVN] r67776 - in grass/trunk/gui/wxpython: core gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 7 14:18:41 PST 2016


Author: martinl
Date: 2016-02-07 14:18:41 -0800 (Sun, 07 Feb 2016)
New Revision: 67776

Modified:
   grass/trunk/gui/wxpython/core/settings.py
   grass/trunk/gui/wxpython/gmodeler/frame.py
   grass/trunk/gui/wxpython/gmodeler/model.py
   grass/trunk/gui/wxpython/gmodeler/preferences.py
Log:
wxGUI/gmodeler: add support for dbtables

Modified: grass/trunk/gui/wxpython/core/settings.py
===================================================================
--- grass/trunk/gui/wxpython/core/settings.py	2016-02-07 22:15:20 UTC (rev 67775)
+++ grass/trunk/gui/wxpython/core/settings.py	2016-02-07 22:18:41 UTC (rev 67776)
@@ -768,6 +768,7 @@
                         'raster'   : (215, 215, 248, 255), # light blue
                         'raster3d' : (215, 248, 215, 255), # light green
                         'vector'   : (248, 215, 215, 255), # light red
+                        'dbtable'  : (255, 253, 194, 255), # light yellow
                         },
                     'size' : {
                         'width' : 175,
@@ -776,7 +777,7 @@
                     },
                 'loop' : {
                     'color' : {
-                        'valid'   :  (234, 226, 154, 255), # light yellow
+                        'valid'   :  (234, 226, 154, 255), # dark yellow
                         },
                     'size' : {
                         'width' : 175,

Modified: grass/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py	2016-02-07 22:15:20 UTC (rev 67775)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py	2016-02-07 22:18:41 UTC (rev 67776)
@@ -789,7 +789,7 @@
             x = width/2 - 200 + self._randomShift()
             y = height/2 + self._randomShift()
             for p in params['params']:
-                if p.get('prompt', '') in ('raster', 'vector', 'raster_3d') and \
+                if p.get('prompt', '') in ('raster', 'vector', 'raster_3d', 'dbtable') and \
                         (p.get('value', None) or \
                              (p.get('age', 'old') != 'old' and p.get('required', 'no') == 'yes')):
                     data = layer.FindData(p.get('name', ''))

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2016-02-07 22:15:20 UTC (rev 67775)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2016-02-07 22:18:41 UTC (rev 67776)
@@ -18,7 +18,7 @@
  - model::WritePythonFile
  - model::ModelParamDialog
 
-(C) 2010-2014 by the GRASS Development Team
+(C) 2010-2016 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -1376,6 +1376,9 @@
         elif self.prompt == 'vector':
             color = UserSettings.Get(group = 'modeler', key = 'data',
                                      subkey = ('color', 'vector'))
+        elif self.prompt == 'dbtable':
+            color = UserSettings.Get(group = 'modeler', key = 'data',
+                                     subkey = ('color', 'dbtable'))
         else:
             color = UserSettings.Get(group = 'modeler', key = 'action',
                                      subkey = ('color', 'invalid'))

Modified: grass/trunk/gui/wxpython/gmodeler/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/preferences.py	2016-02-07 22:15:20 UTC (rev 67775)
+++ grass/trunk/gui/wxpython/gmodeler/preferences.py	2016-02-07 22:18:41 UTC (rev 67776)
@@ -261,7 +261,24 @@
                       flag = wx.ALIGN_RIGHT |
                       wx.ALIGN_CENTER_VERTICAL,
                       pos = (row, 1))
+
+        row += 1
+        gridSizer.Add(item = wx.StaticText(parent = panel, id = wx.ID_ANY,
+                                         label = _("Table:")),
+                      flag = wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos = (row, 0))
+        tColor = csel.ColourSelect(parent = panel, id = wx.ID_ANY,
+                                   colour = self.settings.Get(group='modeler', key='data', subkey=('color', 'dbtable')),
+                                   size = globalvar.DIALOG_COLOR_SIZE)
+        tColor.SetName('GetColour')
+        self.winId['modeler:data:color:dbtable'] = tColor.GetId()
         
+        gridSizer.Add(item = tColor,
+                      flag = wx.ALIGN_RIGHT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos = (row, 1))
+
         gridSizer.AddGrowableCol(0)
         sizer.Add(item = gridSizer, proportion = 1, flag = wx.ALL | wx.EXPAND, border = 5)
         border.Add(item = sizer, proportion = 0, flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)



More information about the grass-commit mailing list