Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
4bb7fc38
Commit
4bb7fc38
authored
Nov 27, 2019
by
Flavio TARSETTI
Browse files
[widgets][toolchaineditor] add default color channel if none found
parent
60209994
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/widgets/toolchaineditor.py
View file @
4bb7fc38
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment