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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 7 12:36:37 EDT 2010


Author: martinl
Date: 2010-06-07 12:36:37 -0400 (Mon, 07 Jun 2010)
New Revision: 42497

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/dialog: use correct values for dbdriver/dbname/dbcolumn
(merge r42495 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-07 16:25:49 UTC (rev 42496)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-07 16:36:37 UTC (rev 42497)
@@ -1357,15 +1357,21 @@
                                 win.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
                                 
                         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)
                             p['wxGetValue'] = win.GetStringSelection
                             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':
@@ -1379,8 +1385,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)
                             ### p['wxGetValue'] = win.GetStringSelection
                             ### win.Bind(wx.EVT_COMBOBOX, self.OnSetValue)



More information about the grass-commit mailing list