fix problem with clearing non-empty location field after changing type of config variable
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 11 Apr 2017 12:51:35 +0300
changeset 1676 eed01e0ab32a
parent 1675 5f4e53508e4e
child 1677 db05cb9e0439
fix problem with clearing non-empty location field after changing type of config variable

introduced by cd9db17 ("clear variable location cell in variable
panel, if variable class or type changed").

Closes #26
controls/VariablePanel.py
--- a/controls/VariablePanel.py	Mon Apr 10 18:29:12 2017 +0300
+++ b/controls/VariablePanel.py	Tue Apr 11 12:51:35 2017 +0300
@@ -800,9 +800,10 @@
     def ClearLocation(self, row, col, value):
         if self.Values[row].Location != '':
             if self.Table.GetColLabelValue(col, False) == 'Class' and value not in ["Local", "Global"] or \
-               self.Table.GetColLabelValue(col, False) == 'Type' and not self.Parent.Controler.IsLocatableType(value):
+               self.Table.GetColLabelValue(col, False) == 'Type' and not self.Controler.IsLocatableType(value):
                 self.Values[row].Location = ''
-            self.RefreshValues()
+                self.RefreshValues()
+                self.SaveValues()
 
     def BuildStdIECTypesMenu(self,type_menu):
             # build a submenu containing standard IEC types