[GRASS-SVN] r58146 - grass/trunk/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 3 13:46:48 PST 2013


Author: martinl
Date: 2013-11-03 13:46:48 -0800 (Sun, 03 Nov 2013)
New Revision: 58146

Modified:
   grass/trunk/gui/wxpython/gmodeler/frame.py
   grass/trunk/gui/wxpython/gmodeler/model.py
Log:
wxGUI/modeler: fix reordering items inside loop

Modified: grass/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py	2013-11-03 21:40:56 UTC (rev 58145)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py	2013-11-03 21:46:48 UTC (rev 58146)
@@ -596,7 +596,10 @@
                                 'to'   : None }
         
     def OnDefineLoop(self, event):
-        """!Define new loop in the model"""
+        """!Define new loop in the model
+
+        @todo: move to ModelCanvas?
+        """
         self.ModelChanged()
         
         width, height = self.canvas.GetSize()
@@ -611,7 +614,10 @@
         self.canvas.Refresh()
         
     def OnDefineCondition(self, event):
-        """!Define new condition in the model"""
+        """!Define new condition in the model
+
+        @todo: move to ModelCanvas?
+        """
         self.ModelChanged()
         
         width, height = self.canvas.GetSize()

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2013-11-03 21:40:56 UTC (rev 58145)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2013-11-03 21:46:48 UTC (rev 58146)
@@ -128,6 +128,11 @@
         dc = wx.ClientDC(self.canvas)
         for item in items:
             item.MoveLinks(dc)
+            for mo in item.GetBlock():
+                if isinstance(mo, ModelLoop):
+                    self.canvas.parent.DefineLoop(mo)
+                elif isinstance(mo, ModelCondition):
+                    self.canvas.parent.DefineCondition(mo)
             
     def Normalize(self):
         iId = 1



More information about the grass-commit mailing list