[GRASS-SVN] r40979 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 13 09:26:16 EST 2010


Author: martinl
Date: 2010-02-13 09:26:15 -0500 (Sat, 13 Feb 2010)
New Revision: 40979

Modified:
   grass/trunk/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI/location wizard: fix proj parsing


Modified: grass/trunk/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2010-02-13 12:53:57 UTC (rev 40978)
+++ grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2010-02-13 14:26:15 UTC (rev 40979)
@@ -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