Browse Source

wxGUI/modeler: fix GetLabel() usage

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58529 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 năm trước cách đây
mục cha
commit
4af6da1eae
2 tập tin đã thay đổi với 7 bổ sung6 xóa
  1. 5 5
      gui/wxpython/gmodeler/dialogs.py
  2. 2 1
      gui/wxpython/gmodeler/model.py

+ 5 - 5
gui/wxpython/gmodeler/dialogs.py

@@ -560,7 +560,7 @@ class ModelConditionDialog(ModelItemDialog):
         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 @@ class ModelConditionDialog(ModelItemDialog):
         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 @@ class VariableListCtrl(ModelListCtrl):
         """!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 @@ class ItemListCtrl(ModelListCtrl):
         
         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 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
     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

+ 2 - 1
gui/wxpython/gmodeler/model.py

@@ -612,6 +612,7 @@ class Model(object):
                 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 @@ class ModelData(ModelObject, ogl.EllipseShape):
         @param value
         """
         self.value = value
-        self._setText()
+        self.SetLabel()
         for direction in ('from', 'to'):
             for rel in self.GetRelations(direction):
                 if direction == 'from':