Просмотр исходного кода

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).

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39359 15284696-431f-4ddb-bdfa-cd5b030d7da7
Michael Barton 16 лет назад
Родитель
Сommit
03a57f3500
1 измененных файлов с 20 добавлено и 13 удалено
  1. 20 13
      gui/wxpython/gui_modules/location_wizard.py

+ 20 - 13
gui/wxpython/gui_modules/location_wizard.py

@@ -1722,6 +1722,9 @@ class LocationWizard(wx.Object):
         # new location created?
         # new location created?
         self.location = None 
         self.location = None 
         success = False
         success = False
+        
+        # location created in different GIS database?
+        self.altdb = False
 
 
         #
         #
         # run wizard...
         # run wizard...
@@ -1731,19 +1734,21 @@ class LocationWizard(wx.Object):
             if len(msg) < 1:
             if len(msg) < 1:
                 self.wizard.Destroy()
                 self.wizard.Destroy()
                 self.location = self.startpage.location
                 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
             else: # -> error
                 self.wizard.Destroy()
                 self.wizard.Destroy()
                 wx.MessageBox(parent=self.parent,
                 wx.MessageBox(parent=self.parent,
@@ -1876,6 +1881,8 @@ class LocationWizard(wx.Object):
                               { 'loc' : location, 'dir' : database},
                               { 'loc' : location, 'dir' : database},
                           caption=_("New GIS data directory"), 
                           caption=_("New GIS data directory"), 
                           style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
                           style=wx.OK | wx.ICON_INFORMATION | wx.CENTRE)
+            # location created in alternate GISDbase
+            self.altdb = True
             
             
         if coordsys == "xy":
         if coordsys == "xy":
             msg = self.XYCreate()
             msg = self.XYCreate()