Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AnalyseMorphologique
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
INSTANCE de PREPROD
Les données peuvent être supprimées à tout moment.
Show more breadcrumbs
Scanner3D
AnalyseMorphologique
Commits
7bb86e26
Commit
7bb86e26
authored
1 year ago
by
Djalim Simaila
Browse files
Options
Downloads
Patches
Plain Diff
Added ErrorPopup window
parent
5897f874
No related branches found
No related tags found
1 merge request
!16
Error management
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/gui/pyqt/error_popup/ErrorPopup.py
+32
-0
32 additions, 0 deletions
utils/gui/pyqt/error_popup/ErrorPopup.py
with
32 additions
and
0 deletions
utils/gui/pyqt/error_popup/ErrorPopup.py
0 → 100644
+
32
−
0
View file @
7bb86e26
from
PyQt5
import
QtCore
,
QtGui
,
QtWidgets
from
PyQt5.QtWidgets
import
QMessageBox
class
ErrorPopup
(
object
):
def
__init__
(
self
,
error_text
,
details
=
None
,
button_label
=
None
,
button_callback
=
None
):
self
.
error_text
=
error_text
self
.
button_label
=
button_label
self
.
button_callback
=
button_callback
self
.
details
=
details
def
show_popup
(
self
):
msg
=
QMessageBox
()
msg
.
setWindowTitle
(
"
Erreur
"
)
msg
.
setText
(
"
Erreur:
"
+
self
.
error_text
)
msg
.
setIcon
(
QMessageBox
.
Critical
)
if
self
.
button_label
is
not
None
and
self
.
button_callback
is
not
None
:
msg
.
setStandardButtons
(
QMessageBox
.
Cancel
|
QMessageBox
.
Retry
)
msg
.
setDefaultButton
(
QMessageBox
.
Cancel
)
msg
.
button
(
QMessageBox
.
Cancel
).
clicked
.
connect
(
msg
.
close
)
msg
.
button
(
QMessageBox
.
Retry
).
setText
(
self
.
button_label
)
msg
.
button
(
QMessageBox
.
Retry
).
clicked
.
connect
(
self
.
button_callback
)
else
:
msg
.
setStandardButtons
(
QMessageBox
.
Ok
)
msg
.
setDefaultButton
(
QMessageBox
.
Ok
)
msg
.
button
(
QMessageBox
.
Ok
).
clicked
.
connect
(
msg
.
close
)
msg
.
setInformativeText
(
self
.
error_text
)
if
self
.
details
is
not
None
:
msg
.
setDetailedText
(
self
.
details
)
msg
.
exec_
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment