# HG changeset patch # User Laurent Bessard # Date 1345898744 -7200 # Node ID 963123fb4917cd2bb6b589a53c84a0fdc86bf3d4 # Parent ecd2effd4660e1fab2a76657db7c9ac44a18ecaa Fix bug name kept when changing a function block to a function diff -r ecd2effd4660 -r 963123fb4917 dialogs/FBDBlockDialog.py --- a/dialogs/FBDBlockDialog.py Sat Aug 25 14:44:49 2012 +0200 +++ b/dialogs/FBDBlockDialog.py Sat Aug 25 14:45:44 2012 +0200 @@ -193,7 +193,7 @@ def GetValues(self): values = self.LibraryPanel.GetSelectedBlock() - if self.BlockName.GetValue() != "": + if self.BlockName.IsEnabled() and self.BlockName.GetValue() != "": values["name"] = self.BlockName.GetValue() values["width"], values["height"] = self.Block.GetSize() values["extension"] = self.Inputs.GetValue() @@ -247,8 +247,12 @@ dc.Clear() values = self.LibraryPanel.GetSelectedBlock() if values is not None: + if self.BlockName.IsEnabled(): + blockname = self.BlockName.GetValue() + else: + blockname = "" self.Block = FBD_Block(self.Preview, values["type"], - self.BlockName.GetValue(), + blockname, extension = self.Inputs.GetValue(), inputs = values["inputs"], executionControl = self.ExecutionControl.GetValue(),