From 1cfd5b87043b5ff6b1c1ebf37ca858cdd3eb7ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Mon, 26 Oct 2020 16:25:47 +0100 Subject: [PATCH] Added more reasonable behavior to "should I force shutdown or wait" message Now there's an option of "don't ask again" and there should not be a useless close button. fixes QubesOS/qubes-issues#6123 --- qubesmanager/qube_manager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 91f290e9..91023d12 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -533,7 +533,14 @@ def check_if_vm_has_shutdown(self): self.tr("Wait another {0} seconds...").format( self.shutdown_time / 1000), QMessageBox.NoRole) + ignore_button = msgbox.addButton(self.tr("Don't ask again"), + QMessageBox.RejectRole) msgbox.setDefaultButton(wait_button) + msgbox.setEscapeButton(ignore_button) + msgbox.setWindowFlags( + msgbox.windowFlags() | Qt.CustomizeWindowHint) + msgbox.setWindowFlags( + msgbox.windowFlags() & ~Qt.WindowCloseButtonHint) msgbox.exec_() msgbox.deleteLater() @@ -545,6 +552,8 @@ def check_if_vm_has_shutdown(self): # shutting it down pass self.restart_vm_if_needed() + elif msgbox.clickedButton() is ignore_button: + return else: self.shutdown_started = datetime.now() self.check_again_later()