[GRASS-SVN] r36450 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 22 17:13:38 EDT 2009
Author: martinl
Date: 2009-03-22 17:13:38 -0400 (Sun, 22 Mar 2009)
New Revision: 36450
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: select first mapset in module dialog (needed for MSW)
(merge from relbr64, r36446)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2009-03-22 21:10:39 UTC (rev 36449)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2009-03-22 21:13:38 UTC (rev 36450)
@@ -43,7 +43,6 @@
argument multiple=True. Multiple selections are separated by commas.
"""
wx.combo.ComboCtrl.__init__(self, parent=parent, id=id, size=size)
-
self.GetChildren()[0].SetName("Select")
self.GetChildren()[0].type = type
@@ -222,9 +221,13 @@
else:
filesdict = grass.list_grouped(elementdict[element])
+ first_dir = None
for dir in mapsets:
- dir_node = self.AddItem('Mapset: '+dir)
- self.seltree.SetItemTextColour(dir_node,wx.Colour(50,50,200))
+ dir_node = self.AddItem('Mapset: ' + dir)
+ if not first_dir:
+ first_dir = dir_node
+
+ self.seltree.SetItemTextColour(dir_node, wx.Colour(50, 50, 200))
try:
elem_list = filesdict[dir]
elem_list.sort(key=str.lower)
@@ -260,7 +263,11 @@
self.seltree.Collapse(dir_node)
else:
self.seltree.Expand(dir_node)
-
+
+ if first_dir:
+ # select first mapset (MSW hack)
+ self.seltree.SelectItem(first_dir)
+
# helpers
def FindItem(self, parentItem, text):
item, cookie = self.seltree.GetFirstChild(parentItem)
More information about the grass-commit
mailing list