[GRASS-SVN] r35908 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 17 09:50:52 EST 2009


Author: martinl
Date: 2009-02-17 09:50:51 -0500 (Tue, 17 Feb 2009)
New Revision: 35908

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI/welcome screen: gray out locked mapsets


Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2009-02-17 14:32:43 UTC (rev 35907)
+++ grass/trunk/gui/wxpython/gis_set.py	2009-02-17 14:50:51 UTC (rev 35908)
@@ -587,10 +587,13 @@
         disabled = []
         idx = 0
         for mapset in self.listOfMapsets:
-            if mapset not in self.listOfMapsetsSelectable:
+            if mapset not in self.listOfMapsetsSelectable or \
+                    os.path.isfile(os.path.join(self.gisdbase,
+                                                locationName,
+                                                mapset, ".gislock")):
                 disabled.append(idx)
             idx += 1
-
+        
         self.lbmapsets.InsertItems(self.listOfMapsets, 0, disabled=disabled)
         
         return self.listOfMapsets
@@ -608,8 +611,12 @@
 
         disabled = []
         idx = 0
+        locationName = self.listOfLocations[self.lblocations.GetSelection()]
         for mapset in self.listOfMapsets:
-            if mapset not in self.listOfMapsetsSelectable:
+            if mapset not in self.listOfMapsetsSelectable or \
+                    os.path.isfile(os.path.join(self.gisdbase,
+                                                locationName,
+                                                mapset, ".gislock")):
                 disabled.append(idx)
             idx += 1
 
@@ -772,6 +779,7 @@
         for item in choices:
             index = self.InsertStringItem(sys.maxint, item)
             self.SetStringItem(index, 0, item)
+            
             if idx in disabled:
                 self.SetItemTextColour(idx, wx.Colour(150, 150, 150))
             idx += 1



More information about the grass-commit mailing list