[GRASS-SVN] r54697 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 18 03:14:55 PST 2013


Author: martinl
Date: 2013-01-18 03:14:55 -0800 (Fri, 18 Jan 2013)
New Revision: 54697

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI/forms: fix usage element vs prompt


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2013-01-18 11:06:15 UTC (rev 54696)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2013-01-18 11:14:55 UTC (rev 54697)
@@ -1137,12 +1137,12 @@
                                               'dbtable',
                                               'dbcolumn',
                                               'layer',
-                                              'layer_all',
                                               'location',
                                               'mapset',
                                               'dbase',
-                                              'coords') and \
-                                              p.get('element', '') not in ('file', 'dir'):
+                                              'coords',
+                                              'file',
+                                              'dir'):
                     multiple = p.get('multiple', False)
                     if p.get('age', '') == 'new':
                         mapsets = [grass.gisenv()['MAPSET'],]
@@ -1273,7 +1273,6 @@
                                 'dbtable',
                                 'dbcolumn',
                                 'layer',
-                                'layer_all',
                                 'location',
                                 'mapset',
                                 'dbase'):
@@ -1284,8 +1283,8 @@
                     else:
                         value = self._getValue(p)
                         
-                        if prompt in ('layer', 'layer_all'):
-                            if prompt == 'layer_all':
+                        if prompt == 'layer':
+                            if p.get('element', 'layer') == 'layer_all':
                                 all = True
                             else:
                                 all = False
@@ -1401,7 +1400,7 @@
                     else:
                         p['wxId'].append(None)
                 # file selector
-                elif p.get('prompt','') !=  'color' and p.get('element', '') == 'file':
+                elif p.get('prompt','') !=  'color' and p.get('prompt', '') == 'file':
                     if p.get('age', 'new') == 'new':
                         fmode = wx.SAVE
                     else:
@@ -1433,7 +1432,7 @@
                     # we have to target the button here
                     p['wxId'] = [ fbb.GetChildren()[1].GetId() ]
                     if p.get('age', 'new') == 'old' and \
-                            p.get('prompt', 'input') == 'input' and \
+                            p.get('prompt', '') == 'file' and \
                             UserSettings.Get(group = 'cmd', key = 'interactiveInput', subkey = 'enabled'):
                         # widget for interactive input
                         ifbb = wx.TextCtrl(parent = which_panel, id = wx.ID_ANY,
@@ -1470,7 +1469,7 @@
                         p['wxId'].append(btnSave.GetId())
                 
                 # directory selector
-                elif p.get('prompt','') != 'color' and p.get('element', '') == 'dir':
+                elif p.get('prompt','') != 'color' and p.get('prompt', '') == 'dir':
                     fbb = filebrowse.DirBrowseButton(parent = which_panel, id = wx.ID_ANY,
                                                      size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
                                                      dialogTitle = _('Choose %s') % \
@@ -1579,7 +1578,7 @@
                 name = p.get('name', '')
                 if name in ('map', 'input'):
                     pMap = p
-            elif prompt in ('layer', 'layer_all'):
+            elif prompt == 'layer':
                 pLayer.append(p)
             elif prompt == 'dbcolumn':
                 pColumn.append(p)



More information about the grass-commit mailing list