Added links to template manager to qube manager

Added a shortcut to template manager to qube manager main window and some minor pylint fixes.
This commit is contained in:
Marta Marczykowska-Górecka 2018-11-09 15:51:22 +01:00
parent ce20377e39
commit 13c4c748f1
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
3 changed files with 23 additions and 5 deletions

View File

@ -1041,6 +1041,12 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
self.qubes_app)
global_settings_window.exec_()
# noinspection PyArgumentList
@QtCore.pyqtSlot(name='on_action_manage_templates_triggered')
def action_manage_templates_triggered(self):
# pylint: disable=invalid-name, no-self-use
subprocess.check_call('qubes-template-manager')
# noinspection PyArgumentList
@QtCore.pyqtSlot(name='on_action_show_network_triggered')
def action_show_network_triggered(self):

View File

@ -34,10 +34,10 @@ from qubesadmin import events
from PyQt4 import QtGui # pylint: disable=import-error
from PyQt4 import QtCore # pylint: disable=import-error
from PyQt4 import Qt
from PyQt4 import Qt # pylint: disable=import-error
from . import ui_templatemanager
from . import ui_templatemanager # pylint: disable=no-name-in-module
column_names = ['Qube', 'State', 'Current template', 'New template']
@ -202,6 +202,7 @@ class TemplateManagerWindow(
class VMNameItem(QtGui.QTableWidgetItem):
# pylint: disable=too-few-public-methods
def __init__(self, vm):
super(VMNameItem, self).__init__()
self.vm = vm
@ -234,6 +235,7 @@ class StatusItem(QtGui.QTableWidgetItem):
class CurrentTemplateItem(QtGui.QTableWidgetItem):
# pylint: disable=too-few-public-methods
def __init__(self, vm):
super(CurrentTemplateItem, self).__init__()
self.vm = vm
@ -253,8 +255,8 @@ class NewTemplateItem(QtGui.QComboBox):
self.table_widget = table_widget
self.changed = False
for t in templates:
self.addItem(t)
for template in templates:
self.addItem(template)
self.setCurrentIndex(self.findText(vm.template.name))
self.start_value = self.currentText()
@ -282,6 +284,7 @@ class NewTemplateItem(QtGui.QComboBox):
class VMRow:
# pylint: disable=too-few-public-methods
def __init__(self, vm, row_no, table_widget, columns, templates):
self.vm = vm

View File

@ -244,7 +244,7 @@
<x>0</x>
<y>0</y>
<width>1100</width>
<height>46</height>
<height>28</height>
</rect>
</property>
<property name="contextMenuPolicy">
@ -256,6 +256,7 @@
</property>
<addaction name="action_global_settings"/>
<addaction name="action_show_network"/>
<addaction name="action_manage_templates"/>
<addaction name="action_backup"/>
<addaction name="action_restore"/>
<addaction name="action_exit"/>
@ -821,6 +822,14 @@
<string>&amp;Exit Qube Manager</string>
</property>
</action>
<action name="action_manage_templates">
<property name="text">
<string>Manage templates for qubes</string>
</property>
<property name="toolTip">
<string>Launch a tool that allows multiple templates to be changed at once</string>
</property>
</action>
</widget>
<resources>
<include location="../resources.qrc"/>