Merge remote-tracking branch 'qubesos/pr/63'
* qubesos/pr/63: Fixed bug with template selection Fixed errors with virt mode choice
This commit is contained in:
commit
712e95617a
@ -307,9 +307,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
self.vm, 'template',
|
self.vm, 'template',
|
||||||
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)
|
||||||
transform=(lambda x: x if x != self.vm.app.default_template
|
|
||||||
else x + self.tr(' (default)')))
|
|
||||||
else:
|
else:
|
||||||
self.template_name.setEnabled(False)
|
self.template_name.setEnabled(False)
|
||||||
self.template_idx = -1
|
self.template_idx = -1
|
||||||
@ -631,7 +629,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if self.virt_mode.currentIndex() != self.virt_mode_idx:
|
if self.virt_mode.currentIndex() != self.virt_mode_idx:
|
||||||
self.vm.virt_mode = self.selected_virt_mode().lower()
|
self.vm.virt_mode = self.selected_virt_mode()
|
||||||
except Exception as ex: # pylint: disable=broad-except
|
except Exception as ex: # pylint: disable=broad-except
|
||||||
msg.append(str(ex))
|
msg.append(str(ex))
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ def prepare_choice(widget, holder, propname, choice, default,
|
|||||||
oldvalue = qubesadmin.DEFAULT
|
oldvalue = qubesadmin.DEFAULT
|
||||||
else:
|
else:
|
||||||
oldvalue = getattr(holder, propname)
|
oldvalue = getattr(holder, propname)
|
||||||
|
if transform is not None and oldvalue is not None:
|
||||||
|
oldvalue = transform(oldvalue)
|
||||||
else:
|
else:
|
||||||
oldvalue = object() # won't match for identity
|
oldvalue = object() # won't match for identity
|
||||||
idx = 0
|
idx = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user