[GRASS-SVN] r36449 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 22 17:10:39 EDT 2009


Author: martinl
Date: 2009-03-22 17:10:39 -0400 (Sun, 22 Mar 2009)
New Revision: 36449

Modified:
   grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: select first mapset in module dialog (needed for MSW)
       (merge from relbr64, r36446)


Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py	2009-03-22 20:34:01 UTC (rev 36448)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py	2009-03-22 21:10:39 UTC (rev 36449)
@@ -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