[GRASS-SVN] r30968 - grass/trunk/gui/wxpython
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Apr 13 07:53:05 EDT 2008
Author: martinl
Date: 2008-04-13 07:53:03 -0400 (Sun, 13 Apr 2008)
New Revision: 30968
Modified:
grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI (welcome screen): bugfix ('RuntimeError: maximum recursion depth exceeded'), some code cleaning
Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py 2008-04-13 11:19:13 UTC (rev 30967)
+++ grass/trunk/gui/wxpython/gis_set.py 2008-04-13 11:53:03 UTC (rev 30968)
@@ -616,34 +616,27 @@
self.FormerMapsetSelection = event.GetIndex()
event.Skip()
- def OnSetDatabase(self,event):
+ def OnSetDatabase(self, event):
"""Database set"""
self.gisdbase = self.tgisdbase.GetValue()
-
+
self.UpdateLocations(self.gisdbase)
- self.lblocations.Clear()
- self.lblocations.InsertItems(self.listOfLocations,0)
- if self.listOfLocations != []:
- self.lblocations.SetSelection(0)
- else:
- self.lblocations.SetSelection(wx.NOT_FOUND)
-
self.OnSelectLocation(None)
def OnBrowse(self, event):
"""'Browse' button clicked"""
grassdata = None
- dlg = wx.DirDialog(self, "Choose a GRASS directory:",
+ dlg = wx.DirDialog(self, _("Choose GIS Data Directory:"),
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
if dlg.ShowModal() == wx.ID_OK:
self.gisdbase = dlg.GetPath()
self.tgisdbase.SetValue(self.gisdbase)
+ self.OnSetDatabase(event)
+
dlg.Destroy()
- self.OnSetDatabase(event)
-
def OnCreateMapset(self,event):
"""Create new mapset"""
self.gisdbase = self.tgisdbase.GetValue()
@@ -772,7 +765,8 @@
self.__LoadData(choices, disabled)
def SetSelection(self, item):
- self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
+ if item != wx.NOT_FOUND:
+ self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
self.selected = item
def GetSelection(self):
More information about the grass-commit
mailing list