From 35523aa6851b0abcf03493d54770d7b756ce4907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Wed, 8 Jan 2020 22:04:36 +0100 Subject: [PATCH] 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 (cherry picked from commit e17332d84ce5e1f139e6c7b935c944443e0b1f90) --- qubesmanager/settings.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 4279f5c3..3618334e 100644 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -655,8 +655,17 @@ def remove_vm(self): 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: QtGui.QMessageBox.warning(