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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 12 10:24:07 EDT 2010


Author: martinl
Date: 2010-05-12 10:24:06 -0400 (Wed, 12 May 2010)
New Revision: 42240

Modified:
   grass/trunk/gui/wxpython/gui_modules/gselect.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
bugfix #1066
sort formats


Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py	2010-05-12 13:53:05 UTC (rev 42239)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py	2010-05-12 14:24:06 UTC (rev 42240)
@@ -871,7 +871,7 @@
             '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 @@
         @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 @@
         
         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()
         

Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2010-05-12 13:53:05 UTC (rev 42239)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2010-05-12 14:24:06 UTC (rev 42240)
@@ -691,7 +691,10 @@
             formats['protocol'].append(format)
         else:
             formats['file'].append(format)
-
+    
+    for items in formats.itervalues():
+        items.sort()
+    
     return formats
 
 formats = None



More information about the grass-commit mailing list