[GRASS-SVN] r59938 - in grass/branches/releasebranch_7_0/gui/wxpython: gui_core vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 24 07:11:03 PDT 2014


Author: martinl
Date: 2014-04-24 07:11:03 -0700 (Thu, 24 Apr 2014)
New Revision: 59938

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/vdigit/toolbars.py
Log:
wxGUI/vdigit: fix vdigit toolbar for simple features editing (work in progress)
              (merge r59910 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py	2014-04-24 14:09:51 UTC (rev 59937)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py	2014-04-24 14:11:03 UTC (rev 59938)
@@ -402,8 +402,9 @@
     if showType:
         cmd[1]['type'] = dlg.GetFeatureType()
         
+    curMapset = grass.gisenv()['MAPSET']
     if isNative:
-        listOfVectors = grass.list_grouped('vect')[grass.gisenv()['MAPSET']]
+        listOfVectors = grass.list_grouped('vect')[curMapset]
     else:
         listOfVectors = RunCommand('v.external',
                                    quiet = True,
@@ -438,7 +439,8 @@
         dlg.Destroy()
         return None
     
-    if not isNative:
+    if not isNative and \
+            not grass.find_file(outmap, element = 'vector', mapset = curMapset)['fullname']:
         # create link for OGR layers
         RunCommand('v.external',
                    overwrite = overwrite,

Modified: grass/branches/releasebranch_7_0/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vdigit/toolbars.py	2014-04-24 14:09:51 UTC (rev 59937)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vdigit/toolbars.py	2014-04-24 14:11:03 UTC (rev 59938)
@@ -365,9 +365,9 @@
         menuItems = []
         if not self.tools or 'addArea' in self.tools:
             menuItems.append((self.icons["addArea"], self.OnAddArea))
-        if not self.tools or 'addBoundary' in self.tools:
+        if not self.fType and not self.tools or 'addBoundary' in self.tools:
             menuItems.append((self.icons["addBoundary"], self.OnAddBoundary))
-        if not self.tools or 'addCentroid' in self.tools:
+        if not self.fType and not self.tools or 'addCentroid' in self.tools:
             menuItems.append((self.icons["addCentroid"],  self.OnAddCentroid))
         
         self._onMenu(menuItems)
@@ -865,27 +865,25 @@
             return False
         
         # check feature type (only for OGR layers)
-        fType = self.digit.GetFeatureType()
+        self.fType = self.digit.GetFeatureType()
         self.EnableAll()
         self.EnableUndo(False)
         self.EnableRedo(False)
         
-        if fType == 'point':
-            for tool in (self.addLine, self.addBoundary, self.addCentroid,
-                         self.addArea, self.moveVertex, self.addVertex,
+        if self.fType == 'point':
+            for tool in (self.addLine, self.addArea, self.moveVertex, self.addVertex,
                          self.removeVertex, self.editLine):
                 self.EnableTool(tool, False)
-        elif fType == 'linestring':
-            for tool in (self.addPoint, self.addBoundary, self.addCentroid,
-                         self.addArea):
+        elif self.fType == 'linestring':
+            for tool in (self.addPoint, self.addArea):
                 self.EnableTool(tool, False)
-        elif fType == 'polygon':
-            for tool in (self.addPoint, self.addLine, self.addBoundary, self.addCentroid):
+        elif self.fType == 'polygon':
+            for tool in (self.addPoint, self.addLine):
                 self.EnableTool(tool, False)
-        elif fType:
+        elif self.fType:
             GError(parent = self,
                    message = _("Unsupported feature type '%(type)s'. Unable to edit "
-                               "OGR layer <%(layer)s>.") % { 'type' : fType,
+                               "OGR layer <%(layer)s>.") % { 'type' : self.fType,
                                                              'layer' : mapLayer.GetName() })
             self.digit.CloseMap()
             self.mapLayer = None



More information about the grass-commit mailing list