[GRASS-SVN] r30937 - grass/branches/releasebranch_6_3/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 11 08:21:14 EDT 2008


Author: martinl
Date: 2008-04-11 08:21:14 -0400 (Fri, 11 Apr 2008)
New Revision: 30937

Modified:
   grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI (location_wizard): set region settings bugfix, do not use 'g.mapset' here (which creates gislock) + minor fix (backported from trunk)

Modified: grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/location_wizard.py	2008-04-11 12:16:12 UTC (rev 30936)
+++ grass/branches/releasebranch_6_3/gui/wxpython/gui_modules/location_wizard.py	2008-04-11 12:21:14 UTC (rev 30937)
@@ -1219,7 +1219,7 @@
         # self.DoLayout()
 
     def OnEnterPage(self, event):
-        if self.epsgcode:
+        if not self.epsgcode:
             # disable 'next' button by default
             wx.FindWindowById(wx.ID_FORWARD).Enable(False)
         else:
@@ -2062,11 +2062,14 @@
                 envval[key] = val
             self.currlocation = envval['LOCATION_NAME'].strip("';")
             self.currmapset = envval['MAPSET'].strip("';")
-            if self.currlocation == self.location and self.currmapset == 'PERMANENT':
-                pass
-            else:
-                cmdlist = ['g.mapset', 'location=%s' % self.location, 'mapset=PERMANENT']
-                gcmd.Command(cmdlist)
+            if self.currlocation != self.location or self.currmapset != 'PERMANENT':
+                # cmdlist = ['g.mapset', 'location=%s' % self.location, 'mapset=PERMANENT']
+                # gcmd.Command(cmdlist
+                gcmd.Command(["g.gisenv",
+                              "set=LOCATION_NAME=%s" % self.location])
+                gcmd.Command(["g.gisenv",
+                              "set=MAPSET=PERMANENT"])
+
         else:
             dlg = wx.MessageBox(parent=self,
                                 message=_('Invalid location selected.'),



More information about the grass-commit mailing list