Merge remote-tracking branch 'origin/pr/233'

* origin/pr/233:
  Template should not be enabled for running VMs in VM Settings
  Show correct template for DispVMs VM Settings
This commit is contained in:
Marek Marczykowski-Górecki 2020-03-28 04:21:58 +01:00
commit f1ad829d71
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -389,10 +389,20 @@ 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
if self.vm.is_running():
self.template_name.setEnabled(False)
self.netvm_list, self.netvm_idx = utils.prepare_vm_choice( self.netvm_list, self.netvm_idx = utils.prepare_vm_choice(
self.netVM, self.netVM,
self.vm, 'netvm', self.vm, 'netvm',