Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/259'
Browse files Browse the repository at this point in the history
* origin/pr/259:
  Fixed display of default template in Create New VM
  • Loading branch information
marmarek committed Aug 23, 2020
2 parents 1da41df + 476f1d0 commit 6180f0a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions qubesmanager/create_new_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ def __init__(self, qtapp, app, parent=None):
widget=self.label,
qubes_app=self.app)

utils.initialize_widget_with_default(
utils.initialize_widget_with_vms(
widget=self.template_vm,
choices=[(vm.name, vm) for vm in self.app.domains
if not utils.is_internal(vm) and vm.klass == 'TemplateVM'],
mark_existing_as_default=True,
default_value=getattr(self.app, 'default_template', None))
qubes_app=self.app,
filter_function=(lambda vm: not utils.is_internal(vm) and
vm.klass == 'TemplateVM'))

default_template = self.app.default_template
for i in range(self.template_vm.count()):
if self.template_vm.itemData(i) == default_template:
self.template_vm.setCurrentIndex(i)
self.template_vm.setItemText(
i, str(default_template) + " (default)")

utils.initialize_widget_with_default(
widget=self.netvm,
Expand Down

0 comments on commit 6180f0a

Please sign in to comment.