[GRASS-SVN] r59124 - grass/trunk/gui/wxpython/dbmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 23 06:37:32 PST 2014
Author: martinl
Date: 2014-02-23 06:37:32 -0800 (Sun, 23 Feb 2014)
New Revision: 59124
Modified:
grass/trunk/gui/wxpython/dbmgr/manager.py
grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
Log:
wxGUI/dbmgr: field calculator emits signal to update dbmgr
Modified: grass/trunk/gui/wxpython/dbmgr/manager.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/manager.py 2014-02-23 11:18:57 UTC (rev 59123)
+++ grass/trunk/gui/wxpython/dbmgr/manager.py 2014-02-23 14:37:32 UTC (rev 59124)
@@ -124,7 +124,7 @@
# events
self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
- self.btnReload.Bind(wx.EVT_BUTTON, self.pages['browse'].OnDataReload)
+ self.btnReload.Bind(wx.EVT_BUTTON, self.ReloadData)
self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
@@ -165,7 +165,12 @@
self.Destroy()
event.Skip()
-
+
+ def ReloadData(self):
+ """Reload data"""
+ if self.pages['browse']:
+ self.pages['browse'].OnDataReload() # TODO replace by signal
+
def OnPageChanged(self, event):
"""!On page in ATM is changed"""
try:
Modified: grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py 2014-02-23 11:18:57 UTC (rev 59123)
+++ grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py 2014-02-23 14:37:32 UTC (rev 59124)
@@ -36,6 +36,8 @@
from core.utils import _
import wx
+from grass.pydispatch.signal import Signal
+
from core.gcmd import RunCommand, GError, GMessage
from dbmgr.vinfo import CreateDbInfoDesc, VectorDBInfo
@@ -549,6 +551,11 @@
SQLBuilder.__init__(self, parent, title, vectmap, id = wx.ID_ANY,
modeChoices = modeChoices, layer = layer)
+ # signals
+ self.sqlApplied = Signal("SQLBuilder.sqlApplied")
+ if parent: # TODO: replace by giface
+ self.sqlApplied.connect(parent.Update)
+
def _doLayout(self, modeChoices):
"""!Do dialog layout"""
@@ -628,10 +635,10 @@
if ret != 0 and msg:
self.statusbar.SetStatusText(_("SQL statement was not applied"), 0)
- #GError(parent = self,
- # message = _("SQL statement can not be applied.\n\n%s") % msg)
else:
self.statusbar.SetStatusText(_("SQL statement applied"), 0)
+
+ self.sqlApplied.emit()
def OnClear(self, event):
"""!Clear button pressed"""
More information about the grass-commit
mailing list