[GRASS-SVN] r51937 - grass/trunk/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 2 08:54:16 PDT 2012


Author: martinl
Date: 2012-06-02 08:54:16 -0700 (Sat, 02 Jun 2012)
New Revision: 51937

Modified:
   grass/trunk/gui/wxpython/dbmgr/manager.py
   grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
Log:
wxGUI/dbmgr: apply query when closing SQL builder


Modified: grass/trunk/gui/wxpython/dbmgr/manager.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/manager.py	2012-06-02 15:43:56 UTC (rev 51936)
+++ grass/trunk/gui/wxpython/dbmgr/manager.py	2012-06-02 15:54:16 UTC (rev 51937)
@@ -2037,7 +2037,7 @@
             self.builder = SQLFrame(parent = self, id = wx.ID_ANY,
                                     title = _("SQL Builder"),
                                     vectmap = self.vectorName,
-                                    evtheader = self.OnBuilderEvt)
+                                    evtHandler = self.OnBuilderEvt)
             self.builder.Show()
         else:
             self.builder.Raise()
@@ -2046,6 +2046,10 @@
         if event == 'apply':
             sqlstr = self.builder.GetSQLStatement()
             self.FindWindowById(self.layerPage[self.layer]['statement']).SetValue(sqlstr)
+            # apply query
+            self.listOfSQLStatements.append(sqlstr)
+            self.OnApplySqlStatement(None)
+            # close builder on apply
             if self.builder.CloseOnApply():
                 self.builder = None
         elif event == 'close':

Modified: grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py	2012-06-02 15:43:56 UTC (rev 51936)
+++ grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py	2012-06-02 15:54:16 UTC (rev 51937)
@@ -37,7 +37,7 @@
 class SQLFrame(wx.Frame):
     """!SQL Frame class"""
     def __init__(self, parent, title, vectmap, id = wx.ID_ANY,
-                 layer = 1, qtype = "select", evtheader = None):
+                 layer = 1, qtype = "select", evtHandler = None):
         
         wx.Frame.__init__(self, parent, id, title)
         
@@ -45,7 +45,7 @@
                              wx.BITMAP_TYPE_ICO))
         
         self.parent = parent
-        self.evtHeader = evtheader
+        self.evtHandler = evtHandler
 
         #
         # variables
@@ -401,9 +401,9 @@
         
     def OnApply(self, event):
         """Apply button pressed"""
-        if self.evtHeader:
-            self.evtHeader(event = 'apply')
-
+        if self.evtHandler:
+            self.evtHandler(event = 'apply')
+        
         if self.close_onapply.IsChecked():
             self.Destroy()
             
@@ -435,8 +435,8 @@
     
     def OnClose(self, event):
         """!Close button pressed"""
-        if self.evtHeader:
-            self.evtHeader(event = 'close')
+        if self.evtHandler:
+            self.evtHandler(event = 'close')
         
         self.Destroy()
         



More information about the grass-commit mailing list