[GRASS-SVN] r42495 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 7 09:18:58 EDT 2010


Author: martinl
Date: 2010-06-07 09:18:55 -0400 (Mon, 07 Jun 2010)
New Revision: 42495

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/dialog: use correct values for dbdriver/dbname/dbcolumn


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-06-07 12:55:47 UTC (rev 42494)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-06-07 13:18:55 UTC (rev 42495)
@@ -1450,14 +1450,20 @@
                                     border = 5)
 
                         elif p.get('prompt', '') == 'dbdriver':
-                            win = gselect.DriverSelect(parent=which_panel,
-                                                       choices=p['values'],
-                                                       value=p['default'])
+                            value = p.get('value', '')
+                            if not value:
+                                value = p.get('default', '')
+                            win = gselect.DriverSelect(parent = which_panel,
+                                                       choices = p.get('values', []),
+                                                       value = value)
                             win.Bind(wx.EVT_COMBOBOX, self.OnUpdateSelection)
                             win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
                         elif p.get('prompt', '') == 'dbname':
-                            win = gselect.DatabaseSelect(parent=which_panel,
-                                                         value=p['default'])
+                            value = p.get('value', '')
+                            if not value:
+                                value = p.get('default', '')
+                            win = gselect.DatabaseSelect(parent = which_panel,
+                                                         value = value)
                             win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
                             win.Bind(wx.EVT_TEXT, self.OnSetValue)
                         elif p.get('prompt', '') == 'dbtable':
@@ -1470,8 +1476,11 @@
                                                   size=globalvar.DIALOG_TEXTCTRL_SIZE)
                                 win.Bind(wx.EVT_TEXT, self.OnSetValue)
                         elif p.get('prompt', '') == 'dbcolumn':
+                            value = p.get('value', '')
+                            if not value:
+                                value = p.get('default', '')
                             win = gselect.ColumnSelect(parent = which_panel,
-                                                       value = p.get('default', ''),
+                                                       value = value,
                                                        param = p)
                             win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)
                             win.Bind(wx.EVT_TEXT,     self.OnSetValue)



More information about the grass-commit mailing list