[GRASS-SVN] r58415 - in grass/trunk/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 8 13:51:51 PST 2013


Author: martinl
Date: 2013-12-08 13:51:51 -0800 (Sun, 08 Dec 2013)
New Revision: 58415

Modified:
   grass/trunk/gui/wxpython/core/gconsole.py
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI: re-render display when mask set

Modified: grass/trunk/gui/wxpython/core/gconsole.py
===================================================================
--- grass/trunk/gui/wxpython/core/gconsole.py	2013-12-08 21:49:40 UTC (rev 58414)
+++ grass/trunk/gui/wxpython/core/gconsole.py	2013-12-08 21:51:51 UTC (rev 58415)
@@ -345,6 +345,8 @@
         # Signal when some map is created or updated by a module.
         # attributes: name: map name, ltype: map type,
         self.mapCreated = Signal('GConsole.mapCreated')
+        # emitted when map display should be re-render
+        self.updateMap = Signal('GConsole.updateMap')
         # emitted when log message should be written
         self.writeLog = Signal('GConsole.writeLog')
         # emitted when command log message should be written
@@ -663,11 +665,13 @@
                      # TODO: do it better (?)
                      name in ('r.colors', 'r3.colors', 'v.colors')) and \
                     p.get('value', None):
-                name = p.get('value')
-                if '@' not in name:
-                    name = name + '@' + grass.gisenv()['MAPSET']
-                self.mapCreated.emit(name=name, ltype=prompt)
-
+                lname = p.get('value')
+                if '@' not in lname:
+                    lname += '@' + grass.gisenv()['MAPSET']
+                self.mapCreated.emit(name=lname, ltype=prompt)
+        if name == 'r.mask':
+            self.updateMap.emit()
+        
         event.Skip()
 
     def OnProcessPendingOutputWindowEvents(self, event):

Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2013-12-08 21:49:40 UTC (rev 58414)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2013-12-08 21:51:51 UTC (rev 58415)
@@ -460,6 +460,7 @@
         self._gconsole = self.notebookpanel._gconsole
         if self._gconsole:
             self._gconsole.mapCreated.connect(self.OnMapCreated)
+            self._gconsole.updateMap.connect(lambda: self._giface.updateMap.emit())
         self.goutput = self.notebookpanel.goutput
         if self.goutput:
             self.goutput.showNotification.connect(lambda message: self.SetStatusText(message))
@@ -795,6 +796,7 @@
         wx.Panel.__init__(self, parent, id = id, *args, **kwargs)
 
         self.mapCreated = Signal
+        self.updateMap  = Signal
 
         # Determine tab layout
         sections = []



More information about the grass-commit mailing list