Added default_dispvm to Global Settings

Added "default dispvm" to Global Settings.

references QubesOS/qubes-issues#3688
This commit is contained in:
Marta Marczykowska-Górecka 2018-03-14 22:21:33 +01:00
parent e1aca0a393
commit 7ed386985d
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 29 additions and 2 deletions

View File

@ -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',

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>651</width>
<height>386</height>
<width>974</width>
<height>587</height>
</rect>
</property>
<property name="windowTitle">
@ -81,6 +81,16 @@
<item row="3" column="1">
<widget class="QComboBox" name="default_template_combo"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Default DispVM:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="default_dispvm_combo"/>
</item>
</layout>
</widget>
</item>