[GRASS-SVN] r51889 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 30 07:15:26 PDT 2012


Author: martinl
Date: 2012-05-30 07:15:25 -0700 (Wed, 30 May 2012)
New Revision: 51889

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI/welcome screen: improve OnBrowse() handler, set defaultPath to $HOME if no GISBASE is set


Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2012-05-30 13:25:01 UTC (rev 51888)
+++ grass/trunk/gui/wxpython/gis_set.py	2012-05-30 14:15:25 UTC (rev 51889)
@@ -11,7 +11,7 @@
  - gis_set::GListBox
  - gis_set::StartUp
 
-(C) 2006-2011 by the GRASS Development Team
+(C) 2006-2012 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -666,15 +666,19 @@
 
     def OnBrowse(self, event):
         """'Browse' button clicked"""
-        grassdata = None
-
-        dlg = wx.DirDialog(self, _("Choose GIS Data Directory:"),
-                           style = wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
+        if not event:
+            defaultPath = os.getenv('HOME')
+        else:
+            defaultPath = ""
+        
+        dlg = wx.DirDialog(parent = self, message = _("Choose GIS Data Directory"),
+                           defaultPath = defaultPath, style = wx.DD_DEFAULT_STYLE)
+        
         if dlg.ShowModal() ==  wx.ID_OK:
             self.gisdbase = dlg.GetPath()
             self.tgisdbase.SetValue(self.gisdbase)
             self.OnSetDatabase(event)
-
+        
         dlg.Destroy()
 
     def OnCreateMapset(self,event):



More information about the grass-commit mailing list