Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
303106cf
Commit
303106cf
authored
Jun 18, 2020
by
Amir MOHAMMADI
Browse files
Merge branch '264_add_tooltip_for_errors' into 'master'
Add tooltip when asset is invalid Closes
#264
See merge request
!135
parents
3c0c058b
b0af5c74
Pipeline
#40551
passed with stages
in 11 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/widgets/assetwidget.py
View file @
303106cf
...
...
@@ -236,14 +236,19 @@ class AssetWidget(QWidget):
self
.
asset_name_label
.
setText
(
self
.
current_asset
.
name
)
self
.
save_button
.
setEnabled
(
False
)
def
__update_editors_icon
(
self
,
is_valid
):
def
__update_editors_icon
(
self
,
is_valid
,
errors
=
None
):
tab_index
=
self
.
tab_widget
.
indexOf
(
self
.
editors
)
tab_icon
=
(
self
.
style
().
standardIcon
(
QStyle
.
SP_MessageBoxCritical
)
if
not
is_valid
else
QIcon
()
)
tab_tooltip
=
""
if
errors
is
not
None
:
tab_tooltip
=
"
\n
"
.
join
(
errors
)
self
.
tab_widget
.
setTabIcon
(
tab_index
,
tab_icon
)
self
.
tab_widget
.
setTabToolTip
(
tab_index
,
tab_tooltip
)
def
__clear_watcher
(
self
):
"""Clears the content of the file system watcher"""
...
...
@@ -454,7 +459,7 @@ class AssetWidget(QWidget):
do_load
=
True
if
do_load
:
self
.
__update_editors_icon
(
is_valid
)
self
.
__update_editors_icon
(
is_valid
,
errors
)
declaration
=
asset
.
declaration
...
...
@@ -512,8 +517,8 @@ class AssetWidget(QWidget):
with
FileBlocker
(
self
.
watcher
,
declaration_path
):
self
.
current_asset
.
declaration
=
json_data
is_valid
,
_
=
self
.
current_asset
.
is_valid
()
self
.
__update_editors_icon
(
is_valid
)
is_valid
,
errors
=
self
.
current_asset
.
is_valid
()
self
.
__update_editors_icon
(
is_valid
,
errors
)
if
self
.
current_asset
.
type
==
AssetType
.
ALGORITHM
:
update_code
(
self
.
current_asset
)
...
...
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