[GRASS-SVN] r44612 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 15 18:21:34 EST 2010


Author: martinl
Date: 2010-12-15 15:21:34 -0800 (Wed, 15 Dec 2010)
New Revision: 44612

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
#1100 (Trim mapset name from maps list in wxGUI)
(merge r44610 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2010-12-15 23:20:09 UTC (rev 44611)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2010-12-15 23:21:34 UTC (rev 44612)
@@ -319,9 +319,9 @@
                         
                         if self.filterElements:
                             if self.filterElements(fullqElem):
-                                self.AddItem(fullqElem, parent=dir_node)
+                                self.AddItem(elem, parent=dir_node)
                         else:
-                            self.AddItem(fullqElem, parent=dir_node)
+                            self.AddItem(elem, parent=dir_node)
             except:
                 continue
 
@@ -376,7 +376,8 @@
         return item
 
     def OnMotion(self, evt):
-        # have the selection follow the mouse, like in a real combobox
+        """!Have the selection follow the mouse, like in a real combobox
+        """
         item, flags = self.seltree.HitTest(evt.GetPosition())
         if item and flags & wx.TREE_HITTEST_ONITEMLABEL:
             self.seltree.SelectItem(item)
@@ -384,22 +385,25 @@
         evt.Skip()
 
     def OnLeftDown(self, evt):
-        # do the combobox selection
+        """!Do the combobox selection
+        """
         item, flags = self.seltree.HitTest(evt.GetPosition())
         if item and flags & wx.TREE_HITTEST_ONITEMLABEL:
             self.curitem = item
-
+            
             if self.seltree.GetRootItem() == self.seltree.GetItemParent(item):
                 self.value = [] # cannot select mapset item
             else:
+                mapsetItem = self.seltree.GetItemParent(item)
+                fullName = self.seltree.GetItemText(item) + '@' + self.seltree.GetItemText(mapsetItem).split(' ', 1)[1]
                 if self.multiple is True:
                     # text item should be unique
-                    self.value.append(self.seltree.GetItemText(item))
+                    self.value.append(fullName)
                 else:
-                    self.value = [self.seltree.GetItemText(item), ]
-
+                    self.value = [fullName, ]
+            
             self.Dismiss()
-
+        
         evt.Skip()
 
     def SetData(self, **kargs):



More information about the grass-commit mailing list