[GRASS-SVN] r38934 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 31 15:10:29 EDT 2009


Author: martinl
Date: 2009-08-31 15:10:23 -0400 (Mon, 31 Aug 2009)
New Revision: 38934

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI: vector attributes editable only if vector map is in the current
mapset
     (merge from trunk, r38932)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py	2009-08-31 16:54:10 UTC (rev 38933)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm.py	2009-08-31 19:10:23 UTC (rev 38934)
@@ -1,4 +1,4 @@
-"""
+"""!
 @package dbm.py
 
 @brief GRASS Attribute Table Manager
@@ -50,6 +50,8 @@
 import wx.lib.flatnotebook as FN
 import wx.lib.scrolledpanel as scrolled
 
+import grass.script as grass
+
 import sqlbuilder
 import grassenv
 import gcmd
@@ -462,7 +464,14 @@
         self.parent    = parent # GMFrame
         self.treeItem  = item   # item in layer tree
         self.cmdLog    = log    # self.parent.goutput
-        
+                
+        # vector attributes can be changed only if vector map is in
+        # the current mapset
+        if grass.find_file(element = 'vector', name = vectmap)['mapset'] == grass.gisenv()['MAPSET']:
+            editable = True
+        else:
+            editable = False
+                
         wx.Frame.__init__(self, parent, id, title, style=style)
         
         # icon
@@ -529,9 +538,11 @@
         self.browsePage.SetTabAreaColour(globalvar.FNPageColor)
 
         self.manageTablePage = FN.FlatNotebook(self.panel, id=wx.ID_ANY,
-                                          style=dbmStyle)
+                                               style=dbmStyle)
         #self.notebook.AddPage(self.manageTablePage, caption=_("Manage tables"))
         self.notebook.AddPage(self.manageTablePage, text=_("Manage tables")) # FN
+        if not editable:
+            self.notebook.GetPage(self.notebook.GetPageCount()-1).Enable(False)
         self.manageTablePage.SetTabAreaColour(globalvar.FNPageColor)
 
         self.manageLayerPage = FN.FlatNotebook(self.panel, id=wx.ID_ANY,
@@ -539,6 +550,8 @@
         #self.notebook.AddPage(self.manageLayerPage, caption=_("Manage layers"))
         self.notebook.AddPage(self.manageLayerPage, text=_("Manage layers")) # FN
         self.manageLayerPage.SetTabAreaColour(globalvar.FNPageColor)
+        if not editable:
+            self.notebook.GetPage(self.notebook.GetPageCount()-1).Enable(False)
         
         self.__createBrowsePage()
         self.__createManageTablePage()



More information about the grass-commit mailing list