[GRASS-SVN] r54103 - in grass/trunk/gui/wxpython: gmodeler gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 30 01:22:47 PST 2012
Author: martinl
Date: 2012-11-30 01:22:47 -0800 (Fri, 30 Nov 2012)
New Revision: 54103
Modified:
grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
grass/trunk/gui/wxpython/gui_core/forms.py
Log:
g.gui.gmodeler: use '*.gxm' as a filemask
Modified: grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2012-11-30 09:08:22 UTC (rev 54102)
+++ grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2012-11-30 09:22:47 UTC (rev 54103)
@@ -27,8 +27,10 @@
#%end
#%option G_OPT_F_INPUT
#% key: file
-#% description: Name of model file to be loaded (*.gxm)
+#% description: Name of model file to be loaded
+#% key_desc: name.gxm
#% required: no
+#% guisection: Model
#%end
import os
Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py 2012-11-30 09:08:22 UTC (rev 54102)
+++ grass/trunk/gui/wxpython/gui_core/forms.py 2012-11-30 09:22:47 UTC (rev 54103)
@@ -1363,10 +1363,16 @@
fmode = wx.SAVE
else:
fmode = wx.OPEN
- fbb = filebrowse.FileBrowseButton(parent = which_panel, id = wx.ID_ANY, fileMask = '*',
+ # check wildcard
+ fExt = os.path.splitext(p.get('key_desc', ['*.*'])[0])[1]
+ if not fExt:
+ fMask = '*.*'
+ else:
+ fMask = '*' + fExt
+ fbb = filebrowse.FileBrowseButton(parent = which_panel, id = wx.ID_ANY, fileMask = fMask,
size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
dialogTitle = _('Choose %s') % \
- p.get('description',_('File')),
+ p.get('description', _('file')).lower(),
buttonText = _('Browse'),
startDirectory = os.getcwd(), fileMode = fmode,
changeCallback = self.OnSetValue)
More information about the grass-commit
mailing list