Browse Source

bugfix https://trac.osgeo.org/grass/ticket/1066
sort formats


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42240 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 15 years ago
parent
commit
0553029f63
2 changed files with 12 additions and 3 deletions
  1. 8 2
      gui/wxpython/gui_modules/gselect.py
  2. 4 1
      gui/wxpython/gui_modules/utils.py

+ 8 - 2
gui/wxpython/gui_modules/gselect.py

@@ -871,7 +871,7 @@ class FormatSelect(wx.Choice):
             'VTP .bt (Binary Terrain) 1.3 Format' : 'bt',
             'FARSITE v.4 Landscape File (.lcp)' : 'lcp',
             'Swedish Grid RIK (.rik)' : 'rik',
-            'USGS Optional ASCII DEM (and CDED)' : '.dem',
+            'USGS Optional ASCII DEM (and CDED)' : 'dem',
             'Northwood Numeric Grid Format .grd/.tab' : '',
             'Northwood Classified Grid Format .grc/.tab' : '',
             'ARC Digitized Raster Graphics' : 'arc',
@@ -917,6 +917,7 @@ class GdalSelect(wx.Panel):
         @param ogr    use OGR selector instead of GDAL
         """
         self.parent = parent
+        self.ogr    = ogr
         wx.Panel.__init__(self, parent = panel, id = wx.ID_ANY)
         
         self.inputBox = wx.StaticBox(parent = self, id=wx.ID_ANY,
@@ -1118,7 +1119,12 @@ class GdalSelect(wx.Panel):
         
         self.dsnText.SetLabel(self.input[self.dsnType][0])
         self.format.SetItems(self.input[self.dsnType][2])
-        self.format.SetSelection(0)
+        if sel in (self.sourceMap['file'],
+                   self.sourceMap['dir']):
+            if not self.ogr:
+                self.format.SetStringSelection('GeoTIFF')
+            else:
+                self.format.SetStringSelection('ESRI Shapefile')
         
         self.dsnSizer.Layout()
         

+ 4 - 1
gui/wxpython/gui_modules/utils.py

@@ -691,7 +691,10 @@ def _parseFormats(output):
             formats['protocol'].append(format)
         else:
             formats['file'].append(format)
-
+    
+    for items in formats.itervalues():
+        items.sort()
+    
     return formats
 
 formats = None