Handle deleting in VM Settings without silent fails

Deleting qube will now show a Delete in Progress dialog box and
not exit QApplication before QThread finishes.

fixes QubesOS/qubes-issues#5515
This commit is contained in:
Marta Marczykowska-Górecka 2020-01-08 22:04:36 +01:00
parent cca5d7d785
commit e17332d84c
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -625,8 +625,17 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
if ok and answer == self.vm.name:
thread = common_threads.RemoveVMThread(self.vm)
thread.finished.connect(self.clear_threads)
self.threads_list.append(thread)
self.progress = QtWidgets.QProgressDialog(
self.tr("Deleting Qube..."), "", 0, 0)
self.progress.setCancelButton(None)
self.progress.setModal(True)
self.thread_closes = True
self.progress.show()
thread.start()
self.done(0)
elif ok:
QtWidgets.QMessageBox.warning(