Skip to content

Commit

Permalink
Added more reasonable behavior to "should I force shutdown or wait" m…
Browse files Browse the repository at this point in the history
…essage

Now there's an option of "don't ask again" and there should not be
a useless close button.

fixes QubesOS/qubes-issues#6123
  • Loading branch information
marmarta committed Oct 26, 2020
1 parent 954f2dc commit 1cfd5b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()
Expand Down

0 comments on commit 1cfd5b8

Please sign in to comment.