Commit 34b8ec6f authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Timeout to close dialog if user does not react

parent 8ed31b01
......@@ -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 = 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',
ans = question.exec_()
if ans == QMessageBox.AcceptRole:
QTimer().singleShot(3000, partial(timeout, question))
_ = question.exec_()
if question.result() == QMessageBox.AcceptRole:
res[0] = 1
res[0] = 0
Supports Markdown
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