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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 31 19:07:58 EDT 2011


Author: martinl
Date: 2011-08-31 16:07:58 -0700 (Wed, 31 Aug 2011)
New Revision: 48012

Modified:
   grass/trunk/gui/wxpython/gui_modules/gselect.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: MapsetSelect() only optionally read-only


Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py	2011-08-31 22:41:31 UTC (rev 48011)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py	2011-08-31 23:07:58 UTC (rev 48012)
@@ -905,9 +905,12 @@
 class MapsetSelect(wx.ComboBox):
     """!Widget for selecting GRASS mapset"""
     def __init__(self, parent, id = wx.ID_ANY, size = globalvar.DIALOG_COMBOBOX_SIZE, 
-                 gisdbase = None, location = None, setItems = True, **kwargs):
+                 gisdbase = None, location = None, setItems = True, new = False, **kwargs):
+        style = 0
+        if not new:
+            style = wx.CB_READONLY
         super(MapsetSelect, self).__init__(parent, id, size = size, 
-                                           style = wx.CB_READONLY, **kwargs)
+                                           style = style, **kwargs)
         
         self.SetName("MapsetSelect")
         if not gisdbase:

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-08-31 22:41:31 UTC (rev 48011)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-08-31 23:07:58 UTC (rev 48012)
@@ -1280,11 +1280,16 @@
                             win.Bind(wx.EVT_COMBOBOX,     self.OnUpdateSelection)
                             win.Bind(wx.EVT_COMBOBOX,     self.OnSetValue)
                         
-                        elif p.get('prompt', '') ==  'mapset':
+                        elif p.get('prompt', '') == 'mapset':
+                            if p.get('age', 'old') == 'old':
+                                new = False
+                            else:
+                                new = True
                             win = gselect.MapsetSelect(parent = which_panel,
-                                                       value = value)
+                                                       value = value, new = new)
                             win.Bind(wx.EVT_COMBOBOX,     self.OnUpdateSelection)
-                            win.Bind(wx.EVT_COMBOBOX,     self.OnSetValue)
+                            win.Bind(wx.EVT_COMBOBOX,     self.OnSetValue) 
+                            win.Bind(wx.EVT_TEXT,         self.OnSetValue)
                             
                         elif p.get('prompt', '') ==  'dbase':
                             win = gselect.DbaseSelect(parent = which_panel,
@@ -1761,18 +1766,13 @@
         if not found:
             return
         
-        if name in ('DriverSelect', 'TableSelect',
-                    'LocationSelect', 'MapsetSelect', 'ProjSelect'):
-            porf['value'] = me.GetStringSelection()
-        elif name ==  'GdalSelect':
+        if name ==  'GdalSelect':
             porf['value'] = event.dsn
         elif name ==  'ModelParam':
             porf['parameterized'] = me.IsChecked()
-        elif name ==  'LayerSelect':
-            porf['value'] = me.GetValue()
         else:
             porf['value'] = me.GetValue()
-        
+
         self.OnUpdateValues(event)
         
         event.Skip()



More information about the grass-commit mailing list