Bug with Dropping blocks on Viewer checking name fixed
authorlbessard
Thu, 10 Apr 2008 19:25:24 +0200
changeset 198 4768050433b8
parent 197 8023d02d78ed
child 199 85d721b33574
Bug with Dropping blocks on Viewer checking name fixed
Viewer.py
--- a/Viewer.py	Thu Apr 10 19:24:36 2008 +0200
+++ b/Viewer.py	Thu Apr 10 19:25:24 2008 +0200
@@ -110,11 +110,11 @@
                     if dialog.ShowModal():
                         blockname = dialog.GetValue()
                     dialog.Destroy()
-                if blockname.upper() not in [name.upper() for name in self.ParentWindow.Controler.GetProjectPouNames()]:
+                if blockname.upper() in [name.upper() for name in self.ParentWindow.Controler.GetProjectPouNames()]:
                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
                     message.ShowModal()
                     message.Destroy()
-                elif blockname.upper() not in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(self.ParentWindow.GetTagName())]:
+                elif blockname.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(self.ParentWindow.GetTagName())]:
                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" element for this pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
                     message.ShowModal()
                     message.Destroy()