Преглед на файлове

g.gui.gmodeler: use '*.gxm' as a filemask

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54103 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa преди 12 години
родител
ревизия
0574587ea3
променени са 2 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. 3 1
      gui/wxpython/gmodeler/g.gui.gmodeler.py
  2. 8 2
      gui/wxpython/gui_core/forms.py

+ 3 - 1
gui/wxpython/gmodeler/g.gui.gmodeler.py

@@ -27,8 +27,10 @@
 #%end
 #%end
 #%option G_OPT_F_INPUT
 #%option G_OPT_F_INPUT
 #% key: file
 #% 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
 #% required: no
+#% guisection: Model
 #%end
 #%end
 
 
 import os
 import os

+ 8 - 2
gui/wxpython/gui_core/forms.py

@@ -1363,10 +1363,16 @@ class CmdPanel(wx.Panel):
                         fmode = wx.SAVE
                         fmode = wx.SAVE
                     else:
                     else:
                         fmode = wx.OPEN
                         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 = '',
                                                       size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
                                                       dialogTitle = _('Choose %s') % \
                                                       dialogTitle = _('Choose %s') % \
-                                                          p.get('description',_('File')),
+                                                          p.get('description', _('file')).lower(),
                                                       buttonText = _('Browse'),
                                                       buttonText = _('Browse'),
                                                       startDirectory = os.getcwd(), fileMode = fmode,
                                                       startDirectory = os.getcwd(), fileMode = fmode,
                                                       changeCallback = self.OnSetValue)
                                                       changeCallback = self.OnSetValue)