Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
34b8ec6f
Commit
34b8ec6f
authored
Aug 20, 2016
by
Maxime Perrotin
Browse files
Timeout to close dialog if user does not react
parent
8ed31b01
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
34b8ec6f
...
...
@@ -823,15 +823,20 @@ class sdlHandler(QObject):
to let the user decide if continuous signals shall be processed '''
# res is of type ctypes.POINTER(c_int) -> res[0]=0 to set False,
# meaning that there is no message pending in the queue
ans
=
-
1
def
timeout
(
question
):
question
.
close
()
question
=
QMessageBox
(
self
.
parent
,
'Evaluate Continuous States'
,
''
)
question
.
setText
(
'Do you want to send a new message'
'
or
evaluate continuous signals (default)?'
)
question
.
setText
(
'Do you want to send a new message
or evaluate
'
'evaluate continuous signals (default
in 3 sec
)?'
)
question
.
addButton
(
'Send message'
,
QMessageBox
.
AcceptRole
)
question
.
addButton
(
'Evaluate continuous signals'
,
QMessageBox
.
RejectRole
)
ans
=
question
.
exec_
()
if
ans
==
QMessageBox
.
AcceptRole
:
QTimer
().
singleShot
(
3000
,
partial
(
timeout
,
question
))
_
=
question
.
exec_
()
if
question
.
result
()
==
QMessageBox
.
AcceptRole
:
res
[
0
]
=
1
else
:
res
[
0
]
=
0
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment