[GRASS-SVN] r39311 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 28 00:13:31 EDT 2009


Author: cmbarton
Date: 2009-09-28 00:13:29 -0400 (Mon, 28 Sep 2009)
New Revision: 39311

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
Log:
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/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-09-28 03:58:07 UTC (rev 39310)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-09-28 04:13:29 UTC (rev 39311)
@@ -1715,6 +1715,9 @@
         # new location created?
         self.location = None 
         success = False
+        
+        # location created in different GIS database?
+        self.altdb = False
 
         #
         # run wizard...
@@ -1724,19 +1727,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,
@@ -1869,6 +1874,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