Fix setting kernel property

Fixes QubesOS/qubes-issues#3145
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-07 00:23:37 +02:00
parent 07162ba089
commit 4d3a992ac6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 2 additions and 18 deletions

View File

@ -504,23 +504,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
if hasattr(self.vm, "kernel") and self.kernel_groupbox.isVisible():
try:
if self.kernel.currentIndex() != self.kernel_idx:
new_kernel = str(self.kernel.currentText())
new_kernel = new_kernel.split(' ')[0]
uses_default_kernel = False
if new_kernel == "default":
kernel = self.app.get_default_kernel()
uses_default_kernel = True
elif new_kernel == "none":
kernel = None
else:
kernel = new_kernel
self.vm.kernel = kernel
# Set self.vm.uses_default_kernel after self.vm.kernel to ensure that
# the correct value persists after QubesVm.kernel resets self.vm.uses_default_kernel
# to False.
self.vm.uses_default_kernel = uses_default_kernel
self.vm.kernel = self.kernel_list[self.kernel.currentIndex()]
self.anything_changed = True
except Exception as ex:
msg.append(str(ex))

View File

@ -87,7 +87,7 @@ def prepare_choice(widget, holder, propname, choice, default,
text = str(item)
if item is qubesadmin.DEFAULT and is_default \
or item is not qubesadmin.DEFAULT and item is oldvalue:
or item is not qubesadmin.DEFAULT and item == oldvalue:
text += ' (current)'
idx = i