diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py
index a41f180..110a1eb 100644
--- a/qubesmanager/qube_manager.py
+++ b/qubesmanager/qube_manager.py
@@ -650,6 +650,10 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
for info in self.get_selected_vms():
info.vm.template = template
+ def change_network(self, netvm):
+ for info in self.get_selected_vms():
+ info.vm.netvm = netvm
+
def __init__(self, qt_app, qubes_app, dispatcher, _parent=None):
super().__init__()
self.setupUi(self)
@@ -671,10 +675,12 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
self.frame_height = 0
self.init_template_menu()
+ self.init_network_menu()
self.context_menu = QMenu(self)
self.context_menu.addAction(self.action_settings)
self.context_menu.addMenu(self.template_menu)
+ self.context_menu.addMenu(self.network_menu)
self.context_menu.addAction(self.action_editfwrules)
self.context_menu.addAction(self.action_appmenus)
self.context_menu.addAction(self.action_set_keyboard_layout)
@@ -834,6 +840,15 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
action.setCheckable(True)
action.triggered.connect(partial(self.change_template, vm.name))
+ def init_network_menu(self):
+ self.network_menu.clear()
+ for vm in self.qubes_app.domains:
+ if vm.qid != 0 and vm.provides_network:
+ action = self.network_menu.addAction(vm.name)
+ action.setData(vm.name)
+ action.setCheckable(True)
+ action.triggered.connect(partial(self.change_network, vm.name))
+
def setup_application(self):
self.qt_app.setApplicationName(self.tr("Qube Manager"))
self.qt_app.setWindowIcon(QIcon.fromTheme("qubes-manager"))
diff --git a/ui/qubemanager.ui b/ui/qubemanager.ui
index fdde9bc..204d07f 100644
--- a/ui/qubemanager.ui
+++ b/ui/qubemanager.ui
@@ -288,6 +288,15 @@ Template
:/templatevm.png:/templatevm.png
+
@@ -300,6 +309,7 @@ Template
+