editors/ResourceEditor.py
changeset 2301 5b8a7dd43f9f
parent 2232 3220dd020675
child 2432 dbc065a2f7a5
--- a/editors/ResourceEditor.py	Tue Aug 28 18:06:30 2018 +0300
+++ b/editors/ResourceEditor.py	Wed Aug 29 18:53:02 2018 +0300
@@ -81,9 +81,6 @@
     return [_("Interrupt"), _("Cyclic")]
 
 
-TASKTRIGGERINGOPTIONS_DICT = dict([(_(option), option) for option in GetTaskTriggeringOptions()])
-
-
 def SingleCellEditor(*x):
     return wx.grid.GridCellChoiceEditor()
 
@@ -98,7 +95,6 @@
 
 
 class ResourceTable(CustomTable):
-
     """
     A custom wx.grid.Grid Table using user supplied data
     """
@@ -107,6 +103,8 @@
         CustomTable.__init__(self, parent, data, colnames)
         self.ColAlignements = []
         self.ColSizes = []
+        self.TASKTRIGGERINGOPTIONS_DICT = dict([(_(option), option)
+                                                for option in GetTaskTriggeringOptions()])
 
     def GetColAlignements(self):
         return self.ColAlignements
@@ -132,7 +130,7 @@
         if col < len(self.colnames):
             colname = self.GetColLabelValue(col, False)
             if colname == "Triggering":
-                value = TASKTRIGGERINGOPTIONS_DICT[value]
+                value = self.TASKTRIGGERINGOPTIONS_DICT[value]
             self.data[row][colname] = value
 
     def _updateColAttrs(self, grid):