浏览代码

bugfix https://trac.osgeo.org/grass/ticket/1069

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42254 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父节点
当前提交
31b0eceeaa
共有 1 个文件被更改,包括 15 次插入4 次删除
  1. 15 4
      gui/wxpython/gis_set.py

+ 15 - 4
gui/wxpython/gis_set.py

@@ -36,6 +36,7 @@ if not os.getenv("GRASS_WXBUNDLED"):
 
 import gui_modules.goutput
 from gui_modules.ghelp import HelpWindow
+from gui_modules.gcmd  import GMessage
 
 import wx
 import wx.html
@@ -431,6 +432,12 @@ class GRASSStartup(wx.Frame):
         """
         location = utils.UnicodeString(self.listOfLocations[self.lblocations.GetSelection()])
         mapset   = utils.UnicodeString(self.listOfMapsets[self.lbmapsets.GetSelection()])
+        if mapset == 'PERMANENT':
+            GMessage(parent = self,
+                     message = _('Mapset <PERMANENT> is required for valid GRASS location.\n\n'
+                                 'This mapset cannot be renamed.'),
+                     msgType = 'info')
+            return
         
         dlg = wx.TextEntryDialog(parent=self,
                                  message=_('Current name: %s\n\nEnter new name:') % mapset,
@@ -499,13 +506,17 @@ class GRASSStartup(wx.Frame):
         dlg.Destroy()
 
     def DeleteMapset(self):
+        """!Delete selected mapset
         """
-        Delete selected mapset
-        """
-
         location = self.listOfLocations[self.lblocations.GetSelection()]
         mapset   = self.listOfMapsets[self.lbmapsets.GetSelection()]
-
+        if mapset == 'PERMANENT':
+            GMessage(parent = self,
+                     message = _('Mapset <PERMANENT> is required for valid GRASS location.\n\n'
+                                 'This mapset cannot be deleted.'),
+                     msgType = 'info')
+            return
+        
         dlg = wx.MessageDialog(parent=self, message=_("Do you want to continue with deleting mapset <%(mapset)s> "
                                                       "from location <%(location)s>?\n\n"
                                                       "ALL MAPS included in this mapset will be "