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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 13 09:38:29 EST 2010


Author: martinl
Date: 2010-02-13 09:38:29 -0500 (Sat, 13 Feb 2010)
New Revision: 40980

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI/location wizard: fix proj parsing
(nerge r40979 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-02-13 14:26:15 UTC (rev 40979)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-02-13 14:38:29 UTC (rev 40980)
@@ -1539,35 +1539,39 @@
     def OnPageChanging(self, event):
         if event.GetDirection() and not self.customstring:
             event.Veto()
-        else:
-            # check for datum tranforms            
+        elif not event.GetDirection() and not self.customstring:
+            return
+        else: # check for datum tranforms            
             ret, out, err = gcmd.RunCommand('g.proj',
-                                  read = True, getErrorMsg = True,
-                                  proj4 = self.customstring, 
-                                  datumtrans = '-1')
+                                            read = True, getErrorMsg = True,
+                                            proj4 = self.customstring, 
+                                            datumtrans = '-1')
             if ret != 0:
-                wx.MessageBox(err, 'g.proj error: check PROJ4 parameter string')
+                wx.MessageBox(parent = self,
+                              message = err,
+                              caption = _("Error"),
+                              style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
                 event.Veto()
                 return
             
-            if out != '':
+            if out:
                 dtrans = ''
                 # open a dialog to select datum transform number
                 dlg = SelectTransformDialog(self.parent.parent, transforms=out)
                 
                 if dlg.ShowModal() == wx.ID_OK:
                     dtrans = dlg.GetTransform()
-                    if dtrans == '':
+                    if len(dtrans) == 0:
                         dlg.Destroy()
                         event.Veto()
-                        return 'Datum transform is required.'
+                        return _('Datum transform is required.')
                 else:
                     dlg.Destroy()
                     event.Veto()
-                    return 'Datum transform is required.'
+                    return _('Datum transform is required.')
                 
                 self.parent.datumtrans = dtrans
-                
+        
         self.GetNext().SetPrev(self)
             
     def GetProjstring(self, event):



More information about the grass-commit mailing list