[GRASS-SVN] r55144 - grass/trunk/gui/wxpython/modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 21 05:23:18 PST 2013
Author: annakrat
Date: 2013-02-21 05:23:18 -0800 (Thu, 21 Feb 2013)
New Revision: 55144
Modified:
grass/trunk/gui/wxpython/modules/mcalc_builder.py
Log:
wxGUI: fix #1793
Modified: grass/trunk/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/modules/mcalc_builder.py 2013-02-21 13:19:03 UTC (rev 55143)
+++ grass/trunk/gui/wxpython/modules/mcalc_builder.py 2013-02-21 13:23:18 UTC (rev 55144)
@@ -27,6 +27,7 @@
from core import globalvar
from core.gcmd import GError, RunCommand
+from core.events import gMapCreated
from gui_core.gselect import Select
from gui_core.forms import GUI
from core.settings import UserSettings
@@ -503,20 +504,16 @@
def OnDone(self, cmd, returncode):
"""!Add create map to the layer tree"""
- if not self.addbox.IsChecked() or returncode != 0:
+ if returncode != 0:
return
name = self.newmaptxt.GetValue().strip(' "') + '@' + grass.gisenv()['MAPSET']
- mapTree = self.parent.GetLayerTree()
- if not mapTree.GetMap().GetListOfLayers(name = name):
- mapTree.AddLayer(ltype = 'raster',
- lname = name,
- lcmd = ['d.rast', 'map=%s' % name],
- multiple = False)
-
- display = self.parent.GetLayerTree().GetMapDisplay()
- if display and display.IsAutoRendered():
- display.GetWindow().UpdateMap(render = True)
-
+ ltype = 'rast'
+ if self.rast3d:
+ ltype = 'rast3d'
+ mapEvent = gMapCreated(self.GetId(),
+ name=name, ltype=ltype, add=self.addbox.IsChecked())
+ wx.PostEvent(self, mapEvent)
+
def OnSaveExpression(self, event):
"""!Saves expression to file
"""
More information about the grass-commit
mailing list