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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 25 13:43:08 PST 2012


Author: martinl
Date: 2012-12-25 13:43:07 -0800 (Tue, 25 Dec 2012)
New Revision: 54403

Modified:
   grass/trunk/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI: fix ElementDialog (disable OK button only when no element is defined)


Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-12-25 17:29:19 UTC (rev 54402)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-12-25 21:43:07 UTC (rev 54403)
@@ -78,7 +78,6 @@
         self.btnCancel = wx.Button(parent = self.panel, id = wx.ID_CANCEL)
         self.btnOK     = wx.Button(parent = self.panel, id = wx.ID_OK)
         self.btnOK.SetDefault()
-        self.btnOK.Enable(False)
         
         if self.etype:
             self.typeSelect = ElementSelect(parent = self.panel,
@@ -92,7 +91,9 @@
     def PostInit(self):
         self.element.SetFocus()
         self.element.Bind(wx.EVT_TEXT, self.OnElement)
-        
+        if not self.element.GetValue():
+            self.btnOK.Disable()
+            
     def OnType(self, event):
         """!Select element type"""
         if not self.etype:



More information about the grass-commit mailing list