[GRASS-SVN] r36446 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 22 15:19:06 EDT 2009


Author: martinl
Date: 2009-03-22 15:19:06 -0400 (Sun, 22 Mar 2009)
New Revision: 36446

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: select first mapset in module dialog (needed for MSW)
 


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-03-21 09:19:54 UTC (rev 36445)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-03-22 19:19:06 UTC (rev 36446)
@@ -42,7 +42,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
         
@@ -221,9 +220,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)
@@ -259,7 +262,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