From a39f3a64d0ae8b3112e72e4d2b778aa91bff1b87 Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 18 Nov 2018 20:14:57 +0100 Subject: [PATCH] Create backup_window on the stack Otherwise it can casue an error: RuntimeError: wrapped C/C++ object of type QProgressBar has been deleted at line 1277 of file /usr/lib/python3.5/site-packages/qubesmanager/qube_manager.py. I don't know how to avoid it. --- qubesmanager/qube_manager.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index bf5dea4..8f1b1fe 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -336,8 +336,6 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): self.sort_by_column = "Type" self.sort_order = QtCore.Qt.AscendingOrder - self.backup_window = None - self.vms_list = [] self.vms_in_table = {} @@ -1049,17 +1047,9 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow): # noinspection PyArgumentList @QtCore.pyqtSlot(name='on_action_backup_triggered') def action_backup_triggered(self): - if not self.backup_window: - self.backup_window = backup.BackupVMsWindow(self.qt_app, - self.qubes_app, self.dispatcher, self) - self.backup_window.finished.connect(self._backup_finished) - - self.backup_window.show() - self.backup_window.activateWindow() - - def _backup_finished(self): - self.backup_window.deleteLater() - self.backup_window = None + backup_window = backup.BackupVMsWindow(self.qt_app, self.qubes_app, + self.dispatcher, self) + backup_window.show() # noinspection PyArgumentList @QtCore.pyqtSlot(name='on_action_exit_triggered')