added network_menu
This commit is contained in:
parent
62489e5c78
commit
5f4526a35c
@ -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"))
|
||||
|
@ -288,6 +288,15 @@ Template</string>
|
||||
<normaloff>:/templatevm.png</normaloff>:/templatevm.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="network_menu">
|
||||
<property name="title">
|
||||
<string>Network</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/netvm.png</normaloff>:/netvm.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="action_createvm"/>
|
||||
<addaction name="action_removevm"/>
|
||||
<addaction name="action_clonevm"/>
|
||||
@ -300,6 +309,7 @@ Template</string>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_settings"/>
|
||||
<addaction name="template_menu"/>
|
||||
<addaction name="network_menu"/>
|
||||
<addaction name="action_editfwrules"/>
|
||||
<addaction name="action_appmenus"/>
|
||||
<addaction name="action_updatevm"/>
|
||||
|
Loading…
Reference in New Issue
Block a user