Explorar o código

wxGUI/modeler: add support for directory data type
(merge https://trac.osgeo.org/grass/changeset/67248 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67249 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa %!s(int64=9) %!d(string=hai) anos
pai
achega
28c74603f0
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 2 1
      gui/wxpython/gmodeler/frame.py
  2. 3 1
      gui/wxpython/gmodeler/model.py

+ 2 - 1
gui/wxpython/gmodeler/frame.py

@@ -1457,7 +1457,8 @@ class VariablePanel(wx.Panel):
                                          _("vector"),
                                          _("region"),
                                          _("mapset"),
-                                         _("file")])
+                                         _("file"),
+                                         _("dir")])
         self.type.SetSelection(2) # string
         self.value = wx.TextCtrl(parent = self, id = wx.ID_ANY)
         self.desc = wx.TextCtrl(parent = self, id = wx.ID_ANY)

+ 3 - 1
gui/wxpython/gmodeler/model.py

@@ -769,7 +769,7 @@ class Model(object):
                                     'idx'    : idx }
             for name, values in self.variables.iteritems():
                 gtype = values.get('type', 'string')
-                if gtype in ('raster', 'vector', 'mapset', 'file', 'region'):
+                if gtype in ('raster', 'vector', 'mapset', 'file', 'region', 'dir'):
                     gisprompt = True
                     prompt = gtype
                     if gtype == 'raster':
@@ -2283,6 +2283,8 @@ class WritePythonFile:
             return 'G_OPT_M_MAPSET'
         elif string == 'file':
             return 'G_OPT_F_INPUT'
+        elif string == 'dir':
+            return 'G_OPT_M_DIR'
         elif string == 'region':
             return 'G_OPT_M_REGION'