From 08d1435eea2537cb1321d0aa0170a8ac7957b9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 26 Mar 2020 16:50:25 +0100 Subject: [PATCH 1/2] Show correct template for DispVMs VM Settings DispVMs should have a template listed from among vms with 'template_from_dispvm' property, not from the normal available templates. fixes QubesOS/qubes-issues#5746 --- qubesmanager/settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 0b37ce2..0c7a74a 100644 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -389,6 +389,13 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): self.vm.app.default_template, (lambda vm: vm.klass == 'TemplateVM'), allow_default=False, allow_none=False) + elif self.vm.klass == 'DispVM': + self.template_list, self.template_idx = utils.prepare_vm_choice( + self.template_name, + self.vm, 'template', + self.vm.app.default_dispvm, + (lambda vm: getattr(vm, 'template_for_dispvms', False)), + allow_default=False, allow_none=False) else: self.template_name.setEnabled(False) self.template_idx = -1 From 96e75b350a5a6cbb2ee56219f5bf6d8914d53019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 26 Mar 2020 16:51:41 +0100 Subject: [PATCH 2/2] Template should not be enabled for running VMs in VM Settings --- qubesmanager/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 0c7a74a..853305f 100644 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -400,6 +400,9 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog): self.template_name.setEnabled(False) self.template_idx = -1 + if self.vm.is_running(): + self.template_name.setEnabled(False) + self.netvm_list, self.netvm_idx = utils.prepare_vm_choice( self.netVM, self.vm, 'netvm',