From b22ce36c3ca0de49dbe3a198113c45a4b6fab2fd Mon Sep 17 00:00:00 2001 From: Maxime Perrotin Date: Tue, 12 Sep 2017 10:40:48 +0200 Subject: [PATCH] Use more explicit buttons --- misc/helper-scripts/check-deployment-target-gui.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/helper-scripts/check-deployment-target-gui.py b/misc/helper-scripts/check-deployment-target-gui.py index a1ac35c..e1c97d7 100755 --- a/misc/helper-scripts/check-deployment-target-gui.py +++ b/misc/helper-scripts/check-deployment-target-gui.py @@ -19,12 +19,14 @@ def run_gui(platform): app = QApplication(sys.argv) msg_box = QMessageBox() msg_box.setWindowTitle("This plaform is not installed!") - msg_box.addButton(QMessageBox.Ok) - msg_box.addButton(QMessageBox.Cancel) + ok = msg_box.addButton("Install now", QMessageBox.AcceptRole) + later = msg_box.addButton("Install later", QMessageBox.RejectRole) + msg_box.setEscapeButton(later) + msg_box.setDefaultButton(ok) msg_box.setIcon(QMessageBox.Warning) msg_box.setText("Do you want to install target {} ?".format(platform)) - res = msg_box.exec_() - if res == QMessageBox.Ok: + msg_box.exec_() + if msg_box.clickedButton() == ok: print("OK, will do.") else: warn_box = QMessageBox() -- GitLab