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
This commit is contained in:
Marta Marczykowska-Górecka 2020-03-26 16:50:25 +01:00
parent cf3f102ed7
commit 08d1435eea
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -389,6 +389,13 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
self.vm.app.default_template, self.vm.app.default_template,
(lambda vm: vm.klass == 'TemplateVM'), (lambda vm: vm.klass == 'TemplateVM'),
allow_default=False, allow_none=False) 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: else:
self.template_name.setEnabled(False) self.template_name.setEnabled(False)
self.template_idx = -1 self.template_idx = -1