[GRASS-SVN] r50724 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 8 08:16:43 EST 2012


Author: martinl
Date: 2012-02-08 05:16:43 -0800 (Wed, 08 Feb 2012)
New Revision: 50724

Modified:
   grass/trunk/gui/wxpython/gui_core/dialogs.py
Log:
wGUI: MapLayersDialog - mapType should not depended on localized string


Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-02-08 11:00:09 UTC (rev 50723)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-02-08 13:16:43 UTC (rev 50724)
@@ -997,7 +997,7 @@
         
         self.addLayer = wx.Button(self, id = wx.ID_ADD)
         self.addLayer.SetToolTipString(_("Select map layers and add them to the list."))
-        gridSizer.Add(item = self.addLayer, pos = (0, 1))
+        gridSizer.Add(item = self.addLayer, pos = (0, 1), flag = wx.EXPAND)
         
         self.removeLayer = wx.Button(self, id = wx.ID_REMOVE)
         self.removeLayer.SetToolTipString(_("Remove selected layer(s) from list."))
@@ -1219,6 +1219,11 @@
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         """!Dialog for selecting map layers (raster, vector)
         
+        Valid mapType values:
+         - raster
+         - raster3d
+         - vector
+        
         @param mapType type of map (if None: raster, vector, 3d raster, if one only: selects it and disables selection)
         @param selectAll all/none maps should be selected by default
         @param fullyQualified True if dialog should return full map names by default
@@ -1292,7 +1297,12 @@
                                    choices = [_('raster'), _('3D raster'), _('vector')], size = (100,-1))
         
         if self.mapType:
-            self.layerType.SetStringSelection(self.mapType)
+            if self.mapType == 'raster':
+                self.layerType.SetSelection(0)
+            elif self.mapType == 'raster3d':
+                self.layerType.SetSelection(1)
+            elif self.mapType == 'vector':
+                self.layerType.SetSelection(2)
             self.layerType.Disable()
         else:
             self.layerType.SetSelection(0)



More information about the grass-commit mailing list