From 2be8f8bcea853e1939ad68b323bae13ea68b1bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 6 Feb 2018 15:31:17 +0100 Subject: [PATCH 1/2] Fixed errors with virt mode choice Current virtualization mode wasn't displayed correctly. It should work now. fixes QubesOS/qubes-issues#3517 --- qubesmanager/settings.py | 2 +- qubesmanager/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 838fa3f..956b6b1 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -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)) diff --git a/qubesmanager/utils.py b/qubesmanager/utils.py index 45de190..5b40f5f 100644 --- a/qubesmanager/utils.py +++ b/qubesmanager/utils.py @@ -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 From 0ec3c704dd858f377fc6175d7e0d431f610250d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Tue, 6 Feb 2018 15:38:20 +0100 Subject: [PATCH 2/2] Fixed bug with template selection Template in VM settings was not displayed correctly. It should work now. --- qubesmanager/settings.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 956b6b1..e3b6989 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -307,9 +307,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog): self.vm, 'template', self.vm.app.default_template, (lambda vm: vm.klass == 'TemplateVM'), - allow_default=False, allow_none=False, - transform=(lambda x: x if x != self.vm.app.default_template - else x + self.tr(' (default)'))) + allow_default=False, allow_none=False) else: self.template_name.setEnabled(False) self.template_idx = -1