From 4d3a992ac6373183689efed74eadd7acc7397fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 7 Oct 2017 00:23:37 +0200 Subject: [PATCH] Fix setting kernel property Fixes QubesOS/qubes-issues#3145 --- qubesmanager/settings.py | 18 +----------------- qubesmanager/utils.py | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index ce4afc8..629ca5b 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -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)) diff --git a/qubesmanager/utils.py b/qubesmanager/utils.py index cbe8777..cca3647 100644 --- a/qubesmanager/utils.py +++ b/qubesmanager/utils.py @@ -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