Преглед изворни кода

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 пре 15 година
родитељ
комит
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?
         self.location = None 
         success = False
+        
+        # location created in different GIS database?
+        self.altdb = False
 
         #
         # run wizard...
@@ -1731,19 +1734,21 @@ class LocationWizard(wx.Object):
             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 @@ class LocationWizard(wx.Object):
                               { '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()