[GRASS-SVN] r39359 - grass/trunk/gui/wxpython/gui_modules
    svn_grass at osgeo.org 
    svn_grass at osgeo.org
       
    Wed Sep 30 13:47:24 EDT 2009
    
    
  
Author: cmbarton
Date: 2009-09-30 13:47:23 -0400 (Wed, 30 Sep 2009)
New Revision: 39359
Modified:
   grass/trunk/gui/wxpython/gui_modules/location_wizard.py
Log:
Backport from develbranch_6 r39311. If location created in GISDbase that is not the current one, the user is not offered the chance to set region extents (because this can't be done and would generate an error).
Modified: grass/trunk/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2009-09-30 17:46:37 UTC (rev 39358)
+++ grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2009-09-30 17:47:23 UTC (rev 39359)
@@ -1722,6 +1722,9 @@
         # new location created?
         self.location = None 
         success = False
+        
+        # location created in different GIS database?
+        self.altdb = False
 
         #
         # run wizard...
@@ -1731,19 +1734,21 @@
             if len(msg) < 1:
                 self.wizard.Destroy()
                 self.location = self.startpage.location
-                dlg = wx.MessageDialog(parent=self.parent,
-                                       message=_("Do you want to set the default "
-                                                 "region extents and resolution now?"),
-                                       caption=_("Location <%s> created") % self.location,
-                                       style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
-                dlg.CenterOnScreen()
-                if dlg.ShowModal() == wx.ID_YES:
-                    dlg.Destroy()
-                    defineRegion = RegionDef(self.parent, location=self.location)
-                    defineRegion.CenterOnScreen()
-                    defineRegion.Show()
-                else:
-                    dlg.Destroy()
+                
+                if self.altdb == False: 
+                    dlg = wx.MessageDialog(parent=self.parent,
+                                           message=_("Do you want to set the default "
+                                                     "region extents and resolution now?"),
+                                           caption=_("Location <%s> created") % self.location,
+                                           style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
+                    dlg.CenterOnScreen()
+                    if dlg.ShowModal() == wx.ID_YES:
+                        dlg.Destroy()
+                        defineRegion = RegionDef(self.parent, location=self.location)
+                        defineRegion.CenterOnScreen()
+                        defineRegion.Show()
+                    else:
+                        dlg.Destroy()
             else: # -> error
                 self.wizard.Destroy()
                 wx.MessageBox(parent=self.parent,
@@ -1876,6 +1881,8 @@
                               { 'loc' : location, 'dir' : database},
                           caption=_("New GIS data directory"), 
                           style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+            # location created in alternate GISDbase
+            self.altdb = True
             
         if coordsys == "xy":
             msg = self.XYCreate()
    
    
More information about the grass-commit
mailing list