diff --git a/beat/editor/widgets/toolchaineditor.py b/beat/editor/widgets/toolchaineditor.py index b983f12aca95794c72fa5169227a71f8a8301eff..80041e8747fe4729a9753ff35e4058d13d6332dc 100644 --- a/beat/editor/widgets/toolchaineditor.py +++ b/beat/editor/widgets/toolchaineditor.py @@ -389,7 +389,7 @@ class Connection(QGraphicsPathItem): self.end_pin_name = connection_details["to"].split(".")[1] self.channel = connection_details["channel"] - if self.channel is None or self.channel not in channel_colors: + if self.channel is None: warning = QMessageBox() warning.setIcon(QMessageBox.Warning) warning.setWindowTitle(toolchain.tr("Connection creation")) @@ -400,6 +400,21 @@ class Connection(QGraphicsPathItem): warning.exec_() else: + if self.channel not in channel_colors: + toolchain.web_representation["channel_colors"][self.channel] = "#000000" + channel_colors = toolchain.web_representation["channel_colors"] + + warning = QMessageBox() + warning.setIcon(QMessageBox.Warning) + warning.setWindowTitle(toolchain.tr("Channel color")) + warning.setInformativeText( + toolchain.tr( + "No channel color found. Assigning default black color" + ) + ) + warning.setStandardButtons(QMessageBox.Ok) + warning.exec_() + hexadecimal = channel_colors[self.channel].lstrip("#") hlen = len(hexadecimal) self.connection_color = list(