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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 10 16:54:55 EDT 2011


Author: mmetz
Date: 2011-08-10 13:54:55 -0700 (Wed, 10 Aug 2011)
New Revision: 47542

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI file selector: distinguish between file to open and file to save

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-08-10 19:48:31 UTC (rev 47541)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-08-10 20:54:55 UTC (rev 47542)
@@ -1254,12 +1254,16 @@
                         p['wxId'].append(None)
                 # file selector
                 elif p.get('prompt','') !=  'color' and p.get('element', '') ==  'file':
+                    if p.get('age', 'new_file') == 'new_file':
+                        fmode = wx.SAVE
+                    else:
+                        fmode = wx.OPEN
                     fbb = filebrowse.FileBrowseButton(parent = which_panel, id = wx.ID_ANY, fileMask = '*',
                                                       size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
                                                       dialogTitle = _('Choose %s') % \
                                                           p.get('description',_('File')),
                                                       buttonText = _('Browse'),
-                                                      startDirectory = os.getcwd(), fileMode = 0,
+                                                      startDirectory = os.getcwd(), fileMode = fmode,
                                                       changeCallback = self.OnSetValue)
                     value = self._getValue(p)
                     if value:



More information about the grass-commit mailing list