[GRASS-SVN] r51891 - grass/branches/releasebranch_6_4/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 30 07:42:27 PDT 2012


Author: martinl
Date: 2012-05-30 07:42:26 -0700 (Wed, 30 May 2012)
New Revision: 51891

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


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2012-05-30 14:38:07 UTC (rev 51890)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2012-05-30 14:42:26 UTC (rev 51891)
@@ -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.
@@ -668,15 +668,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