Skip to content

Commit

Permalink
Unset netvm for TemplateVMs in Create New Qube
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Oct 5, 2024
1 parent bab3289 commit 273cf53
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions qubes_config/new_qube/new_qube_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ def _type_selected(self, button: Gtk.RadioButton):
load_icon('qubes-question', 20, 20))
return
self.template_handler.change_vm_type(button_name)

if button_name == 'qube_type_template':
self.network_selector.network_none.set_active(True)
else:
self.network_selector.network_default.set_active(True)

self.tooltips[button_name].set_from_pixbuf(load_icon(
'qubes-question-light', 20, 20))

Expand All @@ -227,8 +233,10 @@ def _do_create_qube(self, *_args):

properties: Dict[str, Any] = {'provides_network':
self.advanced_handler.get_provides_network()}
if self.network_selector.get_selected_netvm() != qubesadmin.DEFAULT:
properties['netvm'] = self.network_selector.get_selected_netvm()
selected_netvm = self.network_selector.get_selected_netvm()
if not (klass == 'TemplateVM' and selected_netvm is None) \
and selected_netvm != qubesadmin.DEFAULT:
properties['netvm'] = selected_netvm
if klass == 'StandaloneVM' and \
not self.template_handler.get_selected_template():
properties['virt_mode'] = 'hvm'
Expand Down

0 comments on commit 273cf53

Please sign in to comment.