From 094ec9982915ec7e931c9ee5395a9c803e775f15 Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 14 Mar 2021 13:21:24 +0100 Subject: [PATCH] Use vm.name instead vm object This helps create_new_vm since we don't have the vm yet --- qubesmanager/bootfromdevice.py | 7 ++++--- qubesmanager/settings.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qubesmanager/bootfromdevice.py b/qubesmanager/bootfromdevice.py index 1ed9d60..73f629e 100644 --- a/qubesmanager/bootfromdevice.py +++ b/qubesmanager/bootfromdevice.py @@ -38,7 +38,7 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog, self.setupUi(self) self.setWindowTitle( - self.tr("Boot {vm} from device").format(vm=self.vm.name)) + self.tr("Boot {vm} from device").format(vm=self.vm)) self.buttonBox.accepted.connect(self.save_and_apply) self.buttonBox.rejected.connect(self.reject) @@ -74,7 +74,7 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog, def __warn_if_running__(self): try: - if self.vm.is_running(): + if self.qubesapp.domains[self.vm].is_running(): QtWidgets.QMessageBox.warning( self, self.tr("Warning!"), @@ -104,7 +104,8 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog, ) device_choice = [] - for domain in self.vm.app.domains: + + for domain in self.qubesapp.domains: try: for device in domain.devices["block"]: device_choice.append((str(device), device)) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index b9c0b6a..51af4a4 100644 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -1025,7 +1025,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): def boot_from_cdrom_button_pressed(self): boot_dialog = bootfromdevice.VMBootFromDeviceWindow( - self.vm, self.qapp, self.qubesapp, self) + self.vm.name, self.qapp, self.qubesapp, self) if boot_dialog.exec_(): self.save_and_apply() qvm_start.main(['--cdrom', boot_dialog.cdrom_location, self.vm.name])