Sequel to 95fe62bfe920 : Copy description when DnD variables from Globals in resources and configuration variable panels to POUs, now including ST/IL POUs.
authorEdouard Tisserant
Thu, 16 Sep 2021 09:40:36 +0200
changeset 3319 e6c758e41f82
parent 3315 5f9db9c6c69c
child 3327 d753cc166bd0
child 3333 dd49e4055a10
Sequel to 95fe62bfe920 : Copy description when DnD variables from Globals in resources and configuration variable panels to POUs, now including ST/IL POUs.
editors/TextViewer.py
--- a/editors/TextViewer.py	Mon Sep 13 12:19:17 2021 +0200
+++ b/editors/TextViewer.py	Thu Sep 16 09:40:36 2021 +0200
@@ -369,7 +369,8 @@
                     message = _("\"%s\" pou already exists!") % var_name
                 else:
                     if not var_name.upper() in [name.upper() for name in self.Controler.GetEditedElementVariables(self.TagName, self.Debug)]:
-                        self.Controler.AddEditedElementPouExternalVar(self.TagName, values[2], var_name)
+                        kwargs = dict(description=values[4]) if len(values)>4 else {}
+                        self.Controler.AddEditedElementPouExternalVar(self.TagName, values[2], var_name, **kwargs)
                         self.RefreshVariablePanel()
                         self.RefreshVariableTree()
                     event.SetDragText(var_name)