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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 4 10:32:11 EDT 2011


Author: martinl
Date: 2011-04-04 07:32:11 -0700 (Mon, 04 Apr 2011)
New Revision: 45847

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI/import: add *.* to filemask (see #1307)
(merge r45846 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2011-04-04 14:24:10 UTC (rev 45846)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2011-04-04 14:32:11 UTC (rev 45847)
@@ -1074,9 +1074,11 @@
         
         # dsn widgets
         if not ogr:
-            filemask = 'GeoTIFF (%s)|%s' % (self._getExtPattern('tif'), self._getExtPattern('tif'))
+            filemask = 'GeoTIFF (%s)|%s|%s (*.*)|*.*' % \
+                (self._getExtPattern('tif'), self._getExtPattern('tif'), _('All files'))
         else:
-            filemask = 'ESRI Shapefile (%s)|%s' % (self._getExtPattern('shp'), self._getExtPattern('shp'))
+            filemask = 'ESRI Shapefile (%s)|%s|%s (*.*)|*.*' % \
+                (self._getExtPattern('shp'), self._getExtPattern('shp'), _('All files'))
         
         dsnFile = filebrowse.FileBrowseButton(parent=self, id=wx.ID_ANY, 
                                               size=globalvar.DIALOG_GSELECT_SIZE, labelText = '',
@@ -1306,9 +1308,10 @@
                 ext = self.format.GetExtension(format)
                 if not ext:
                     raise KeyError
-                format += ' (%s)|%s' % (self._getExtPattern(ext), self._getExtPattern(ext))
+                format += ' (%s)|%s|%s (*.*)|*.*' % \
+                    (self._getExtPattern(ext), self._getExtPattern(ext), _('All files'))
             except KeyError:
-                format += ' (*.*)|*.*'
+                format += '%s (*.*)|*.*' % _('All files')
             
             win = filebrowse.FileBrowseButton(parent=self, id=wx.ID_ANY, 
                                               size=globalvar.DIALOG_GSELECT_SIZE, labelText='',
@@ -1340,9 +1343,9 @@
             win.Show()
             
             if not self.ogr:
-                self.format.SetStringSelection('GeoTIFF')
+                self.OnSetFormat(event = None, format = 'GeoTIFF')
             else:
-                self.format.SetStringSelection('ESRI Shapefile')
+                self.OnSetFormat(event = None, format = 'ESRI Shapefile')
         elif sel == self.sourceMap['pro']:
             win = self.input[self.dsnType][1]
             self.dsnSizer.Add(item=self.input[self.dsnType][1],
@@ -1430,7 +1433,7 @@
         
     def OnSetFormat(self, event, format = None):
         """!Format changed"""
-        if self.dsnType not in ['file', 'db']:
+        if self.dsnType not in ['file', 'dir', 'db']:
             return
         
         win = self.input[self.dsnType][1]
@@ -1451,9 +1454,10 @@
                 ext = self.format.GetExtension(format)
                 if not ext:
                     raise KeyError
-                format += ' (%s)|%s' % (self._getExtPattern(ext), self._getExtPattern(ext))
+                format += ' (%s)|%s|%s (*.*)|*.*' % \
+                    (self._getExtPattern(ext), self._getExtPattern(ext), _('All files'))
             except KeyError:
-                format += ' (*.*)|*.*'
+                format += '%s (*.*)|*.*' % _('All files')
             
             win = filebrowse.FileBrowseButton(parent=self, id=wx.ID_ANY, 
                                               size=globalvar.DIALOG_GSELECT_SIZE, labelText='',
@@ -1462,6 +1466,8 @@
                                               startDirectory=os.getcwd(),
                                               changeCallback=self.OnSetDsn,
                                               fileMask = format)
+        elif self.dsnType == 'dir':
+            pass
         else: # database
             if format == 'SQLite' or format == 'Rasterlite':
                 win = self.input['db-win']['file']



More information about the grass-commit mailing list