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
这个提交包含在:
Marta Marczykowska-Górecka 2020-10-26 16:25:47 +01:00
父节点 954f2dc7f7
当前提交 1cfd5b8704
找不到此签名对应的密钥
GPG 密钥 ID: 9A752C30B26FD04B

查看文件

@ -533,7 +533,14 @@ class VmShutdownMonitor(QObject):
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 @@ class VmShutdownMonitor(QObject):
# 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()