[GRASS-SVN] r36090 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 25 06:05:27 EST 2009


Author: martinl
Date: 2009-02-25 06:05:26 -0500 (Wed, 25 Feb 2009)
New Revision: 36090

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: only vector map from current mapset can be modified


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2009-02-25 10:38:32 UTC (rev 36089)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2009-02-25 11:05:26 UTC (rev 36090)
@@ -1172,10 +1172,18 @@
                 self.tree.GetPyData(self.tree.layer_selected)[0]['type'] != 'vector':
             wx.MessageBox(parent=self,
                           message=_("No vector map selected for querying."),
-                          caption=_("Message"),
+                          caption=_("Vector querying"),
                           style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
-            return 
+            return
         
+        if self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetMapset() != \
+                grass.gisenv()['MAPSET']:
+            wx.MessageBox(parent=self,
+                          message=_("Only vector map from the current mapset can be modified."),
+                          caption=_("Vector querying"),
+                          style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+            return
+        
         posWindow = self.ClientToScreen((x + self.MapWindow.dialogOffset,
                                          y + self.MapWindow.dialogOffset))
 
@@ -1255,8 +1263,9 @@
         digitToolbar = self.toolbars['vdigit']
         if self.tree.layer_selected:
             layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
-            if digitToolbar and \
-                   digitToolbar.GetLayer() == layer_selected:
+            if layer_selected.GetType() != 'vector' or \
+                    (digitToolbar and \
+                         digitToolbar.GetLayer() == layer_selected):
                 modify.Enable(False)
             else:
                 if action == "modifyAttrb":



More information about the grass-commit mailing list