[GRASS-SVN] r49879 - grass/trunk/gui/wxpython/lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 23 05:50:43 EST 2011
Author: martinl
Date: 2011-12-23 02:50:43 -0800 (Fri, 23 Dec 2011)
New Revision: 49879
Modified:
grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI/LM: fix OnLocationWizard
(merge r49878 from devbr6)
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2011-12-23 10:47:21 UTC (rev 49878)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2011-12-23 10:50:43 UTC (rev 49879)
@@ -310,28 +310,32 @@
"""!Launch location wizard"""
from location_wizard.wizard import LocationWizard
- gisdbase = grass.gisenv()['GISDBASE']
gWizard = LocationWizard(parent = self,
- grassdatabase = gisdbase)
+ grassdatabase = grass.gisenv()['GISDBASE'])
+ location = gWizard.location
- if gWizard.location != None:
+ if location != None:
dlg = wx.MessageDialog(parent = self,
message = _('Location <%s> created.\n\n'
'Do you want to switch to the '
- 'new location?') % gWizard.location,
+ 'new location?') % location,
caption=_("Switch to new location?"),
style = wx.YES_NO | wx.NO_DEFAULT |
wx.ICON_QUESTION | wx.CENTRE)
ret = dlg.ShowModal()
+ dlg.Destroy()
if ret == wx.ID_YES:
- RunCommand("g.gisenv",
- set = "LOCATION_NAME=%s" % gWizard.location)
- RunCommand("g.gisenv",
- set = "MAPSET=PERMANENT")
-
- dlg.Destroy()
-
+ if RunCommand('g.mapset', parent = self,
+ location = location,
+ mapset = 'PERMANENT') != 0:
+ return
+
+ GMessage(parent = self,
+ message = _("Current location is <%(loc)s>.\n"
+ "Current mapset is <%(mapset)s>.") % \
+ { 'loc' : location, 'mapset' : 'PERMANENT' })
+
def OnSettingsChanged(self, event):
"""!Here can be functions which have to be called after EVT_SETTINGS_CHANGED.
Now only set copying of selected text to clipboard (in goutput).
More information about the grass-commit
mailing list