Added support for adding a variable in program VariablePanel by drap'n dropping located variable like in global VariablePanel
authorLaurent Bessard
Thu, 02 May 2013 09:39:38 +0200
changeset 1083 40af794ecd4b
parent 1082 5a08404d5dda
child 1084 baa09a1c7b15
Added support for adding a variable in program VariablePanel by drap'n dropping located variable like in global VariablePanel
controls/VariablePanel.py
--- a/controls/VariablePanel.py	Tue Apr 30 11:42:35 2013 +0200
+++ b/controls/VariablePanel.py	Thu May 02 09:39:38 2013 +0200
@@ -303,7 +303,7 @@
                         self.ParentWindow.Table.ResetView(self.ParentWindow.VariablesGrid)
                         self.ParentWindow.SaveValues()
             elif (element_type not in ["config", "resource"] and values[1] == "Global" and self.ParentWindow.Filter in ["All", "Interface", "External"] or
-                  element_type in ["config", "resource"] and values[1] == "location"):
+                  element_type in ["config", "resource", "program"] and values[1] == "location"):
                 if values[1] == "location":
                     var_name = values[3]
                 else:
@@ -316,7 +316,10 @@
                     var_infos["Name"] = var_name
                     var_infos["Type"] = values[2]
                     if values[1] == "location":
-                        var_infos["Class"] = "Global"
+                        if element_type == "program":
+                            var_infos["Class"] = "Local"
+                        else:
+                            var_infos["Class"] = "Global"
                         var_infos["Location"] = values[0]
                     else:
                         var_infos["Class"] = "External"