[GRASS-SVN] r41836 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 13 09:15:46 EDT 2010
Author: martinl
Date: 2010-04-13 09:15:45 -0400 (Tue, 13 Apr 2010)
New Revision: 41836
Modified:
grass/trunk/gui/wxpython/gui_modules/gmodeler.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/modeler: fix oncancel bug
Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-04-13 09:42:17 UTC (rev 41835)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-04-13 13:15:45 UTC (rev 41836)
@@ -389,6 +389,8 @@
# executable file
os.chmod(filename, stat.S_IRWXU | stat.S_IWUSR)
+ self.SetStatusText(_("Model exported to <%s>") % filename)
+
def _writePython(self, fd):
"""!Write model to file"""
fd.write(
@@ -558,7 +560,8 @@
def GetOptData(self, dcmd, layer, params, propwin):
"""!Process action data"""
- layer.SetProperties(dcmd, params, propwin)
+ if dcmd:
+ layer.SetProperties(dcmd, params, propwin)
if params: # add data items
width, height = self.canvas.GetSize()
@@ -1032,24 +1035,17 @@
"""!Show properties dialog"""
self.frame.ModelChanged()
shape = self.GetShape()
- win = shape.GetPropDialog()
- if not win:
- if isinstance(shape, ModelAction):
- module = menuform.GUI().ParseCommand(shape.cmd,
- completed = (self.frame.GetOptData, shape, None),
- parentframe = self.frame, show = True)
- elif isinstance(shape, ModelData):
- dlg = ModelDataDialog(parent = self.frame, shape = shape)
- shape.SetPropDialog(dlg)
- dlg.CentreOnParent()
- dlg.Show()
-
- elif win and not win.IsShown():
- win.Show()
+ # win = shape.GetPropDialog()
+ if isinstance(shape, ModelAction):
+ module = menuform.GUI().ParseCommand(shape.GetLog(string = False),
+ completed = (self.frame.GetOptData, shape, shape.GetParams()),
+ parentframe = self.frame, show = True)
+ elif isinstance(shape, ModelData):
+ dlg = ModelDataDialog(parent = self.frame, shape = shape)
+ shape.SetPropDialog(dlg)
+ dlg.CentreOnParent()
+ dlg.Show()
- if win:
- win.Raise()
-
def OnBeginDragLeft(self, x, y, keys = 0, attachment = 0):
"""!Drag shape"""
self.frame.ModelChanged()
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-04-13 09:42:17 UTC (rev 41835)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-04-13 13:15:45 UTC (rev 41836)
@@ -1014,8 +1014,6 @@
elif len(self.parent.GetPyData(self.layer)[0]['cmd']) < 1:
self.parent.Delete(self.layer)
self.Destroy()
- elif self.parent and self.parent.GetName() == 'Modeler':
- self.Destroy()
else:
# cancel for non-display commands
self.Destroy()
More information about the grass-commit
mailing list