[GRASS-SVN] r66931 - grass/branches/releasebranch_7_0/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 25 16:28:19 PST 2015


Author: martinl
Date: 2015-11-25 16:28:18 -0800 (Wed, 25 Nov 2015)
New Revision: 66931

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
Log:
wxGUI: fix run model from menu [news]
       (merge r66930 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2015-11-26 00:23:29 UTC (rev 66930)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2015-11-26 00:28:18 UTC (rev 66931)
@@ -602,6 +602,7 @@
         delInterData = False
         if params:
             dlg = ModelParamDialog(parent = parent,
+                                   model = self,
                                    params = params)
             dlg.CenterOnParent()
             
@@ -2508,11 +2509,12 @@
 
 
 class ModelParamDialog(wx.Dialog):
-    def __init__(self, parent, params, id = wx.ID_ANY, title = _("Model parameters"),
+    def __init__(self, parent, model, params, id = wx.ID_ANY, title = _("Model parameters"),
                  style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
         """Model parameters dialog
         """
         self.parent = parent
+        self._model  = model
         self.params = params
         self.tasks  = list() # list of tasks/pages
         
@@ -2527,7 +2529,7 @@
         # intermediate data?
         self.interData = wx.CheckBox(parent = self, label = _("Delete intermediate data when finish"))
         self.interData.SetValue(True)
-        rast, vect, rast3d, msg = self.parent.GetModel().GetIntermediateData()
+        rast, vect, rast3d, msg = self._model.GetIntermediateData()
         if not rast and not vect and not rast3d:
             self.interData.Hide()
         
@@ -2592,7 +2594,7 @@
         task.params = params['params']
         
         panel = CmdPanel(parent = self, id = wx.ID_ANY, task = task,
-                         giface = GraphicalModelerGrassInterface(self.parent.GetModel()))
+                         giface = GraphicalModelerGrassInterface(self._model))
         self.tasks.append(task)
         
         return panel



More information about the grass-commit mailing list