From 7ed386985dd5a96d28077a80527abbd280817695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Wed, 14 Mar 2018 22:21:33 +0100 Subject: [PATCH] Added default_dispvm to Global Settings Added "default dispvm" to Global Settings. references QubesOS/qubes-issues#3688 --- qubesmanager/global_settings.py | 17 +++++++++++++++++ ui/globalsettingsdlg.ui | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/qubesmanager/global_settings.py b/qubesmanager/global_settings.py index e8ad420..cec533c 100644 --- a/qubesmanager/global_settings.py +++ b/qubesmanager/global_settings.py @@ -90,6 +90,15 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings, filter_function=(lambda vm: vm.klass == 'TemplateVM') ) + # default dispvm + self.default_dispvm_vmlist, self.default_dispvm_idx = \ + utils.prepare_vm_choice( + self.default_dispvm_combo, + self.qvm_collection, 'default_dispvm', + None, + (lambda vm: getattr(vm, 'template_for_dispvms', False)) + ) + def __apply_system_defaults__(self): # upatevm if self.qvm_collection.updatevm != \ @@ -119,6 +128,14 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings, self.default_template_vmlist[ self.default_template_combo.currentIndex()] + # default_dispvm + if self.qvm_collection.default_dispvm != \ + self.default_dispvm_vmlist[ + self.default_dispvm_combo.currentIndex()]: + self.qvm_collection.default_dispvm = \ + self.default_dispvm_vmlist[ + self.default_dispvm_combo.currentIndex()] + def __init_kernel_defaults__(self): self.kernels_list, self.kernels_idx = utils.prepare_kernel_choice( self.default_kernel_combo, self.qvm_collection, 'default_kernel', diff --git a/ui/globalsettingsdlg.ui b/ui/globalsettingsdlg.ui index 7ade6e1..3e76bc3 100644 --- a/ui/globalsettingsdlg.ui +++ b/ui/globalsettingsdlg.ui @@ -6,8 +6,8 @@ 0 0 - 651 - 386 + 974 + 587 @@ -81,6 +81,16 @@ + + + + Default DispVM: + + + + + +