[GRASS-SVN] r58719 - grass/branches/develbranch_6/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 13 23:36:11 PST 2014


Author: neteler
Date: 2014-01-13 23:36:11 -0800 (Mon, 13 Jan 2014)
New Revision: 58719

Modified:
   grass/branches/develbranch_6/gui/wxpython/dbmgr/dialogs.py
Log:
wxGUI: fix for not closing of attribute dialog (#2162) (fwd port of r58708)

Modified: grass/branches/develbranch_6/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/dbmgr/dialogs.py	2014-01-14 01:54:19 UTC (rev 58718)
+++ grass/branches/develbranch_6/gui/wxpython/dbmgr/dialogs.py	2014-01-14 07:36:11 UTC (rev 58719)
@@ -153,7 +153,8 @@
         # bindigs
         btnReset.Bind(wx.EVT_BUTTON, self.OnReset)
         btnSubmit.Bind(wx.EVT_BUTTON, self.OnSubmit)
-        btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel)
+        btnCancel.Bind(wx.EVT_BUTTON, self.OnClose)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -298,8 +299,8 @@
                     if name != key and id != wx.NOT_FOUND:
                         self.FindWindowById(id).SetValue(str(value))
 
-    def OnCancel(self, event):
-        """!Cancel button pressed
+    def OnClose(self, event):
+        """!Closes dialog and removes query layer.
         """
         frame = self.parent.parent
         frame.dialogs['attributes'] = None
@@ -311,7 +312,7 @@
             frame.RemoveQueryLayer()
             self.parent.UpdateMap(render = True)
 
-        self.Close()
+        self.Destroy()
 
     def OnSubmit(self, event):
         """!Submit records"""
@@ -333,7 +334,7 @@
                        stdin = sql)
         
         if close and self.closeDialog.IsChecked():
-            self.OnCancel(event)
+            self.OnClose(event)
 
     def OnFeature(self, event):
         self.fid = int(event.GetString())



More information about the grass-commit mailing list