Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/269'
Browse files Browse the repository at this point in the history
* origin/pr/269:
  Added more reasonable behavior to "should I force shutdown or wait" message
  • Loading branch information
marmarek committed Oct 29, 2020
2 parents 685dfd7 + 1cfd5b8 commit 1e3da9e
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 1e3da9e

Please sign in to comment.