Commit e94bd8bc authored by Flavio TARSETTI's avatar Flavio TARSETTI

[widgets][toolchaineditor] warn about invalid connections (non-synchronized)

parent f3146ffc
......@@ -340,13 +340,25 @@ class Connection(QGraphicsPathItem):
self.end_pin_name = connection_details["to"].split(".")[1]
self.channel = connection_details["channel"]
hexadecimal = channel_colors[self.channel].lstrip("#")
hlen = len(hexadecimal)
self.connection_color = list(
int(hexadecimal[i : i + hlen // 3], 16) for i in range(0, hlen, hlen // 3)
)
self.connection_color.append(255)
self.connection_pen.setColor(QColor(*self.connection_color))
if self.channel is None or self.channel not in channel_colors:
warning = QMessageBox()
warning.setIcon(QMessageBox.Warning)
warning.setWindowTitle(toolchain.tr("Connection creation"))
warning.setInformativeText(
toolchain.tr("No dataset synchronization channel connection found!")
)
warning.setStandardButtons(QMessageBox.Ok)
warning.exec_()
else:
hexadecimal = channel_colors[self.channel].lstrip("#")
hlen = len(hexadecimal)
self.connection_color = list(
int(hexadecimal[i : i + hlen // 3], 16)
for i in range(0, hlen, hlen // 3)
)
self.connection_color.append(255)
self.connection_pen.setColor(QColor(*self.connection_color))
self.blocks = toolchain.blocks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment