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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 25 14:36:08 PST 2013


Author: martinl
Date: 2013-12-25 14:36:08 -0800 (Wed, 25 Dec 2013)
New Revision: 58529

Modified:
   grass/trunk/gui/wxpython/gmodeler/dialogs.py
   grass/trunk/gui/wxpython/gmodeler/model.py
Log:
wxGUI/modeler: fix GetLabel() usage


Modified: grass/trunk/gui/wxpython/gmodeler/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/dialogs.py	2013-12-25 20:17:13 UTC (rev 58528)
+++ grass/trunk/gui/wxpython/gmodeler/dialogs.py	2013-12-25 22:36:08 UTC (rev 58529)
@@ -560,7 +560,7 @@
         if flag is False:
             return
         
-        aId = int(self.itemListIf.GetItem(index, 0).GetLabel())
+        aId = int(self.itemListIf.GetItem(index, 0).GetText())
         if aId in self.itemListElse.GetItems()['checked']:
             self.itemListElse.CheckItemById(aId, False)
             
@@ -569,7 +569,7 @@
         if flag is False:
             return
         
-        aId = int(self.itemListElse.GetItem(index, 0).GetLabel())
+        aId = int(self.itemListElse.GetItem(index, 0).GetText())
         if aId in self.itemListIf.GetItems()['checked']:
             self.itemListIf.CheckItemById(aId, False)
         
@@ -720,7 +720,7 @@
         """!Finish editing of item"""
         itemIndex = event.GetIndex()
         columnIndex = event.GetColumn()
-        nameOld = self.GetItem(itemIndex, 0).GetLabel()
+        nameOld = self.GetItem(itemIndex, 0).GetText()
 
         if columnIndex == 0: # TODO
             event.Veto()
@@ -780,7 +780,7 @@
         
         if self.shape:
             if isinstance(self.shape, ModelCondition):
-                if self.GetLabel() == 'ElseBlockList':
+                if self.GetText() == 'ElseBlockList':
                     shapeItems = map(lambda x: x.GetId(), self.shape.GetItems()['else'])
                 else:
                     shapeItems = map(lambda x: x.GetId(), self.shape.GetItems()['if'])
@@ -981,7 +981,7 @@
     def CheckItemById(self, aId, flag):
         """!Check/uncheck given item by id"""
         for i in range(self.GetItemCount()):
-            iId = int(self.GetItem(i, 0).GetLabel())
+            iId = int(self.GetItem(i, 0).GetText())
             if iId == aId:
                 self.CheckItem(i, flag)
                 break

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2013-12-25 20:17:13 UTC (rev 58528)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2013-12-25 22:36:08 UTC (rev 58529)
@@ -612,6 +612,7 @@
                 self.RunAction(item, params, log, onDone)
             elif isinstance(item, ModelLoop):
                 cond = item.GetLabel()
+                
                 # substitute variables in condition
                 variables = self.GetVariables()
                 for variable in variables:
@@ -1249,7 +1250,7 @@
         @param value
         """
         self.value = value
-        self._setText()
+        self.SetLabel()
         for direction in ('from', 'to'):
             for rel in self.GetRelations(direction):
                 if direction == 'from':



More information about the grass-commit mailing list