Selaa lähdekoodia

wGUI: MapLayersDialog - mapType should not depended on localized string

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50724 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 vuotta sitten
vanhempi
commit
29b45b25bd
1 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 12 2
      gui/wxpython/gui_core/dialogs.py

+ 12 - 2
gui/wxpython/gui_core/dialogs.py

@@ -997,7 +997,7 @@ class GroupDialog(wx.Dialog):
         
         
         self.addLayer = wx.Button(self, id = wx.ID_ADD)
         self.addLayer = wx.Button(self, id = wx.ID_ADD)
         self.addLayer.SetToolTipString(_("Select map layers and add them to the list."))
         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 = wx.Button(self, id = wx.ID_REMOVE)
         self.removeLayer.SetToolTipString(_("Remove selected layer(s) from list."))
         self.removeLayer.SetToolTipString(_("Remove selected layer(s) from list."))
@@ -1219,6 +1219,11 @@ class MapLayersDialog(wx.Dialog):
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         """!Dialog for selecting map layers (raster, vector)
         """!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 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 selectAll all/none maps should be selected by default
         @param fullyQualified True if dialog should return full map names by default
         @param fullyQualified True if dialog should return full map names by default
@@ -1292,7 +1297,12 @@ class MapLayersDialog(wx.Dialog):
                                    choices = [_('raster'), _('3D raster'), _('vector')], size = (100,-1))
                                    choices = [_('raster'), _('3D raster'), _('vector')], size = (100,-1))
         
         
         if self.mapType:
         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()
             self.layerType.Disable()
         else:
         else:
             self.layerType.SetSelection(0)
             self.layerType.SetSelection(0)