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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 17 18:26:02 EDT 2008


Author: martinl
Date: 2008-04-17 18:26:02 -0400 (Thu, 17 Apr 2008)
New Revision: 31026

Modified:
   grass/trunk/gui/wxpython/gui_modules/location_wizard.py
Log:
wxGUI (location_wizard): FileDialog (Choose EPSG codes file) points to given path (not root directory)

Modified: grass/trunk/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2008-04-17 21:47:05 UTC (rev 31025)
+++ grass/trunk/gui/wxpython/gui_modules/location_wizard.py	2008-04-17 22:26:02 UTC (rev 31026)
@@ -1271,11 +1271,18 @@
         
     def OnBrowse(self, event):
         """Define path for EPSG code file"""
-        dlg = wx.FileDialog(self, _("Choose EPSG codes file:"),
-                            "/", "", "*.*", wx.OPEN)
+        path = os.path.dirname(self.tfile.GetValue())
+        if not path:
+            path = os.getcwd()
+
+        dlg = wx.FileDialog(parent=self, message=_("Choose EPSG codes file"),
+                            defaultDir=path, defaultFile="", wildcard="*", style=wx.OPEN)
+
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             self.tfile.SetValue(path)
+            self.OnBrowseCodes(None)
+
         dlg.Destroy()
 
         event.Skip()
@@ -1321,6 +1328,7 @@
             wx.MessageBox(parent=self,
                           message=_("Unable to read EPGS codes: %s") % e,
                           caption=_("Error"),  style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            self.epsglist.Populate([], update=True)
 
 class CustomPage(TitledPage):
     """



More information about the grass-commit mailing list