Fixed errors with virt mode choice

Current virtualization mode wasn't displayed correctly. It should work now.

fixes QubesOS/qubes-issues#3517
This commit is contained in:
Marta Marczykowska-Górecka 2018-02-06 15:31:17 +01:00
parent 82323ca5ed
commit 2be8f8bcea
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 3 additions and 1 deletions

View File

@ -631,7 +631,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
try:
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
msg.append(str(ex))

View File

@ -60,6 +60,8 @@ def prepare_choice(widget, holder, propname, choice, default,
oldvalue = qubesadmin.DEFAULT
else:
oldvalue = getattr(holder, propname)
if transform is not None and oldvalue is not None:
oldvalue = transform(oldvalue)
else:
oldvalue = object() # won't match for identity
idx = 0