Recreation of the old qubes manager in a leaner, cut-down form. First
commit, WIP.
This commit is contained in:
parent
a84c5aba65
commit
443f48c648
2165
qubesmanager/main.py
Executable file
2165
qubesmanager/main.py
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/python2
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf8 -*-
|
||||
# pylint: skip-file
|
||||
#
|
||||
# The Qubes OS Project, http://www.qubes-os.org
|
||||
#
|
||||
# Copyright (C) 2014 Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
# Copyright (C) 2014 Marek Marczykowski-Górecki
|
||||
# <marmarek@invisiblethingslab.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -19,46 +19,43 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License along
|
||||
# with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4 import QtGui
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from PyQt4.QtCore import QSize, Qt
|
||||
|
||||
from PyQt4.QtGui import QTableWidgetItem, QHBoxLayout, QIcon, QLabel, QWidget, \
|
||||
QSizePolicy, QSpacerItem, QFont, QColor, QProgressBar, QPainter, QPen
|
||||
import time
|
||||
from qubes.qubes import vm_files
|
||||
import main
|
||||
|
||||
# TODO: are those needed?
|
||||
qubes_dom0_updates_stat_file = '/var/lib/qubes/updates/dom0-updates-available'
|
||||
power_order = Qt.DescendingOrder
|
||||
update_order = Qt.AscendingOrder
|
||||
power_order = QtCore.Qt.DescendingOrder
|
||||
update_order = QtCore.Qt.AscendingOrder
|
||||
|
||||
|
||||
row_height = 30
|
||||
|
||||
|
||||
class VmIconWidget (QWidget):
|
||||
# TODO: do I need to find icons?
|
||||
class VmIconWidget(QtGui.QWidget):
|
||||
def __init__(self, icon_path, enabled=True, size_multiplier=0.7,
|
||||
tooltip = None, parent=None, icon_sz = (32, 32)):
|
||||
tooltip=None, parent=None, icon_sz=(32, 32)):
|
||||
super(VmIconWidget, self).__init__(parent)
|
||||
|
||||
self.label_icon = QLabel()
|
||||
# TODO: check with Marek how icons should be done
|
||||
self.label_icon = QtGui.QLabel()
|
||||
if icon_path[0] in ':/':
|
||||
icon = QIcon (icon_path)
|
||||
icon = QtGui.QIcon(icon_path)
|
||||
else:
|
||||
icon = QIcon.fromTheme(icon_path)
|
||||
icon_sz = QSize (row_height * size_multiplier, row_height * size_multiplier)
|
||||
icon_pixmap = icon.pixmap(icon_sz, QIcon.Disabled if not enabled else QIcon.Normal)
|
||||
self.label_icon.setPixmap (icon_pixmap)
|
||||
self.label_icon.setFixedSize (icon_sz)
|
||||
if tooltip != None:
|
||||
icon = QtGui.QIcon.fromTheme(icon_path)
|
||||
icon_sz = QtCore.QSize(row_height * size_multiplier,
|
||||
row_height * size_multiplier)
|
||||
icon_pixmap = icon.pixmap(
|
||||
icon_sz,
|
||||
QtGui.QIcon.Disabled if not enabled else QtGui.QIcon.Normal)
|
||||
self.label_icon.setPixmap(icon_pixmap)
|
||||
self.label_icon.setFixedSize(icon_sz)
|
||||
if tooltip is not None:
|
||||
self.label_icon.setToolTip(tooltip)
|
||||
|
||||
layout = QHBoxLayout()
|
||||
layout = QtGui.QHBoxLayout()
|
||||
layout.addWidget(self.label_icon)
|
||||
layout.setContentsMargins(0,0,0,0)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.setLayout(layout)
|
||||
|
||||
def setToolTip(self, tooltip):
|
||||
@ -67,9 +64,9 @@ class VmIconWidget (QWidget):
|
||||
else:
|
||||
self.label_icon.setToolTip('')
|
||||
|
||||
class VmTypeWidget(VmIconWidget):
|
||||
|
||||
class VmTypeItem(QTableWidgetItem):
|
||||
class VmTypeWidget(VmIconWidget):
|
||||
class VmTypeItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, value, vm):
|
||||
super(VmTypeWidget.VmTypeItem, self).__init__()
|
||||
self.value = value
|
||||
@ -90,34 +87,41 @@ class VmTypeWidget(VmIconWidget):
|
||||
|
||||
def __init__(self, vm, parent=None):
|
||||
(icon_path, tooltip) = self.get_vm_icon(vm)
|
||||
super (VmTypeWidget, self).__init__(icon_path, True, 0.8, tooltip, parent)
|
||||
super(VmTypeWidget, self).__init__(
|
||||
icon_path, True, 0.8, tooltip, parent)
|
||||
self.vm = vm
|
||||
self.tableItem = self.VmTypeItem(self.value, vm)
|
||||
self.value = None
|
||||
|
||||
# TODO: seriously, are numbers the best idea here?
|
||||
# TODO: add "provides network column
|
||||
# TODO: in type make vmtype
|
||||
# 'AdminVM': '0',
|
||||
# 'TemplateVM': 't',
|
||||
# 'AppVM': 'a',
|
||||
# 'StandaloneVM': 's',
|
||||
# 'DispVM': 'd',
|
||||
|
||||
def get_vm_icon(self, vm):
|
||||
if vm.qid == 0:
|
||||
if vm.klass == 'AdminVM':
|
||||
self.value = 0
|
||||
return (":/dom0.png", "Dom0")
|
||||
elif vm.is_netvm() and not vm.is_proxyvm():
|
||||
self.value = 1
|
||||
return (":/netvm.png", "NetVM")
|
||||
elif vm.is_proxyvm():
|
||||
self.value = 2
|
||||
return (":/proxyvm.png", "ProxyVM")
|
||||
elif vm.is_appvm() and vm.template is None:
|
||||
self.value = 4
|
||||
return (":/standalonevm.png", "StandaloneVM")
|
||||
elif vm.is_template():
|
||||
icon_name = "dom0"
|
||||
elif vm.klass == 'TemplateVM':
|
||||
self.value = 3
|
||||
return (":/templatevm.png", "TemplateVM")
|
||||
elif vm.is_appvm() or vm.is_disposablevm():
|
||||
icon_name = "templatevm"
|
||||
elif vm.klass == 'StandaloneVM':
|
||||
self.value = 4
|
||||
icon_name = "standalonevm"
|
||||
else:
|
||||
self.value = 5 + vm.label.index
|
||||
return (":/appvm.png", "AppVM")
|
||||
icon_name = "appvm"
|
||||
|
||||
return ":/" + icon_name + ".png", vm.klass
|
||||
|
||||
|
||||
class VmLabelWidget(VmIconWidget):
|
||||
|
||||
class VmLabelItem(QTableWidgetItem):
|
||||
class VmLabelItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, value, vm):
|
||||
super(VmLabelWidget.VmLabelItem, self).__init__()
|
||||
self.value = value
|
||||
@ -126,6 +130,7 @@ class VmLabelWidget(VmIconWidget):
|
||||
def set_value(self, value):
|
||||
self.value = value
|
||||
|
||||
# TODO: figure a prettier sorting method?
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
return True
|
||||
@ -138,26 +143,23 @@ class VmLabelWidget(VmIconWidget):
|
||||
|
||||
def __init__(self, vm, parent=None):
|
||||
icon_path = self.get_vm_icon_path(vm)
|
||||
super (VmLabelWidget, self).__init__(icon_path, True, 0.8, None, parent)
|
||||
super(VmLabelWidget, self).__init__(icon_path, True, 0.8, None, parent)
|
||||
self.vm = vm
|
||||
self.tableItem = self.VmLabelItem(self.value, vm)
|
||||
self.value = None
|
||||
|
||||
def get_vm_icon_path(self, vm):
|
||||
if vm.qid == 0:
|
||||
self.value = 100
|
||||
return ":/off.png"
|
||||
else:
|
||||
self.value = vm.label.index
|
||||
return vm.label.icon
|
||||
self.value = vm.label.index
|
||||
return vm.label.icon
|
||||
|
||||
|
||||
|
||||
class VmNameItem (QTableWidgetItem):
|
||||
class VmNameItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmNameItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
# TODO: is this needed
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
self.setText(vm.name)
|
||||
self.setTextAlignment(Qt.AlignVCenter)
|
||||
self.setTextAlignment(QtCore.Qt.AlignVCenter)
|
||||
self.qid = vm.qid
|
||||
|
||||
def __lt__(self, other):
|
||||
@ -168,38 +170,40 @@ class VmNameItem (QTableWidgetItem):
|
||||
return super(VmNameItem, self).__lt__(other)
|
||||
|
||||
|
||||
class VmStatusIcon(QLabel):
|
||||
# TODO: current status - it should work...
|
||||
# TODO: maybe dbus events?
|
||||
class VmStatusIcon(QtGui.QLabel):
|
||||
def __init__(self, vm, parent=None):
|
||||
super (VmStatusIcon, self).__init__(parent)
|
||||
super(VmStatusIcon, self).__init__(parent)
|
||||
self.vm = vm
|
||||
self.set_on_icon()
|
||||
self.previous_power_state = vm.last_power_state
|
||||
# TODO: rename previous power state to something better?
|
||||
self.previous_power_state = self.vm.get_power_state()
|
||||
|
||||
def update(self):
|
||||
if self.previous_power_state != self.vm.last_power_state:
|
||||
self.previous_power_state = self.vm.get_power_state()
|
||||
if self.previous_power_state != self.vm.get_power_state():
|
||||
self.set_on_icon()
|
||||
self.previous_power_state = self.vm.last_power_state
|
||||
self.previous_power_state = self.vm.get_power_state()
|
||||
|
||||
def set_on_icon(self):
|
||||
if self.vm.last_power_state == "Running":
|
||||
icon = QIcon (":/on.png")
|
||||
elif self.vm.last_power_state in ["Paused", "Suspended"]:
|
||||
icon = QIcon (":/paused.png")
|
||||
elif self.vm.last_power_state in ["Transient", "Halting", "Dying"]:
|
||||
icon = QIcon (":/transient.png")
|
||||
if self.vm.get_power_state() == "Running":
|
||||
icon = QtGui.QIcon(":/on.png")
|
||||
elif self.vm.get_power_state() in ["Paused", "Suspended"]:
|
||||
icon = QtGui.QIcon(":/paused.png")
|
||||
elif self.vm.get_power_state() in ["Transient", "Halting", "Dying"]:
|
||||
icon = QtGui.QIcon(":/transient.png")
|
||||
else:
|
||||
icon = QIcon (":/off.png")
|
||||
icon = QtGui.QIcon(":/off.png")
|
||||
|
||||
icon_sz = QSize (row_height * 0.5, row_height *0.5)
|
||||
icon_sz = QtCore.QSize(row_height * 0.5, row_height * 0.5)
|
||||
icon_pixmap = icon.pixmap(icon_sz)
|
||||
self.setPixmap (icon_pixmap)
|
||||
self.setFixedSize (icon_sz)
|
||||
self.setPixmap(icon_pixmap)
|
||||
self.setFixedSize(icon_sz)
|
||||
|
||||
|
||||
|
||||
class VmInfoWidget (QWidget):
|
||||
|
||||
class VmInfoItem (QTableWidgetItem):
|
||||
class VmInfoWidget (QtGui.QWidget):
|
||||
class VmInfoItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, upd_info_item, vm):
|
||||
super(VmInfoWidget.VmInfoItem, self).__init__()
|
||||
self.upd_info_item = upd_info_item
|
||||
@ -213,7 +217,9 @@ class VmInfoWidget (QWidget):
|
||||
|
||||
self_val = self.upd_info_item.value
|
||||
other_val = other.upd_info_item.value
|
||||
if self.tableWidget().horizontalHeader().sortIndicatorOrder() == update_order:
|
||||
# TODO: is this shit needed?
|
||||
if self.tableWidget().\
|
||||
horizontalHeader().sortIndicatorOrder() == update_order:
|
||||
# the result will be sorted by upd, sorting order: Ascending
|
||||
self_val += 1 if self.vm.is_running() else 0
|
||||
other_val += 1 if other.vm.is_running() else 0
|
||||
@ -221,22 +227,26 @@ class VmInfoWidget (QWidget):
|
||||
return self.vm.qid < other.vm.qid
|
||||
else:
|
||||
return self_val > other_val
|
||||
elif self.tableWidget().horizontalHeader().sortIndicatorOrder() == power_order:
|
||||
#the result will be sorted by power state, sorting order: Descending
|
||||
self_val = -(self_val/10 + 10*(1 if self.vm.is_running() else 0))
|
||||
other_val = -(other_val/10 + 10*(1 if other.vm.is_running() else 0))
|
||||
elif self.tableWidget().\
|
||||
horizontalHeader().sortIndicatorOrder() == power_order:
|
||||
# the result will be sorted by power state,
|
||||
# sorting order: Descending
|
||||
self_val = -(self_val/10 +
|
||||
10*(1 if self.vm.is_running() else 0))
|
||||
other_val = -(other_val/10 +
|
||||
10*(1 if other.vm.is_running() else 0))
|
||||
if self_val == other_val:
|
||||
return self.vm.qid < other.vm.qid
|
||||
else:
|
||||
return self_val > other_val
|
||||
else:
|
||||
#it would be strange if this happened
|
||||
# it would be strange if this happened
|
||||
return
|
||||
|
||||
def __init__(self, vm, parent = None):
|
||||
super (VmInfoWidget, self).__init__(parent)
|
||||
def __init__(self, vm, parent=None):
|
||||
super(VmInfoWidget, self).__init__(parent)
|
||||
self.vm = vm
|
||||
layout = QHBoxLayout ()
|
||||
layout = QtGui.QHBoxLayout()
|
||||
|
||||
self.on_icon = VmStatusIcon(vm)
|
||||
self.upd_info = VmUpdateInfoWidget(vm, show_text=False)
|
||||
@ -247,11 +257,13 @@ class VmInfoWidget (QWidget):
|
||||
layout.addWidget(self.on_icon)
|
||||
layout.addWidget(self.upd_info)
|
||||
layout.addWidget(self.error_icon)
|
||||
layout.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
|
||||
layout.addItem(QtGui.QSpacerItem(0, 10,
|
||||
QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Expanding))
|
||||
layout.addWidget(self.blk_icon)
|
||||
layout.addWidget(self.rec_icon)
|
||||
|
||||
layout.setContentsMargins(5,0,5,0)
|
||||
layout.setContentsMargins(5, 0, 5, 0)
|
||||
self.setLayout(layout)
|
||||
|
||||
self.rec_icon.setVisible(False)
|
||||
@ -263,42 +275,36 @@ class VmInfoWidget (QWidget):
|
||||
def update_vm_state(self, vm, blk_visible, rec_visible=None):
|
||||
self.on_icon.update()
|
||||
self.upd_info.update_outdated(vm)
|
||||
if blk_visible != None:
|
||||
if blk_visible is not None:
|
||||
self.blk_icon.setVisible(blk_visible)
|
||||
if rec_visible != None:
|
||||
if rec_visible is not None:
|
||||
self.rec_icon.setVisible(rec_visible)
|
||||
self.error_icon.setToolTip(vm.qubes_manager_state[main.QMVmState
|
||||
.ErrorMsg])
|
||||
self.error_icon.setVisible(vm.qubes_manager_state[main.QMVmState
|
||||
.ErrorMsg] is not None)
|
||||
# TODO: are these needed?
|
||||
# self.error_icon.setToolTip(vm.qubes_manager_state[main.QMVmState
|
||||
# .ErrorMsg])
|
||||
# self.error_icon.setVisible(vm.qubes_manager_state[main.QMVmState
|
||||
# .ErrorMsg] is not None)
|
||||
|
||||
|
||||
class VmTemplateItem (QTableWidgetItem):
|
||||
# TODO add main to git history as a saner name and with a decent comment
|
||||
# TODO and rename that shit
|
||||
class VmTemplateItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmTemplateItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
self.vm = vm
|
||||
|
||||
if vm.template is not None:
|
||||
self.setText(vm.template.name)
|
||||
else:
|
||||
font = QFont()
|
||||
font.setStyle(QFont.StyleItalic)
|
||||
font = QtGui.QFont()
|
||||
font.setStyle(QtGui.QFont.StyleItalic)
|
||||
self.setFont(font)
|
||||
self.setTextColor(QColor("gray"))
|
||||
self.setTextColor(QtGui.QColor("gray"))
|
||||
|
||||
if vm.is_appvm(): # and vm.template is None
|
||||
self.setText("StandaloneVM")
|
||||
elif vm.is_template():
|
||||
self.setText("TemplateVM")
|
||||
elif vm.qid == 0:
|
||||
self.setText("AdminVM")
|
||||
elif vm.is_netvm():
|
||||
self.setText("NetVM")
|
||||
else:
|
||||
self.setText("---")
|
||||
self.setText(vm.klass)
|
||||
|
||||
self.setTextAlignment(Qt.AlignVCenter)
|
||||
self.setTextAlignment(QtCore.Qt.AlignVCenter)
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -311,22 +317,20 @@ class VmTemplateItem (QTableWidgetItem):
|
||||
return super(VmTemplateItem, self).__lt__(other)
|
||||
|
||||
|
||||
|
||||
|
||||
class VmNetvmItem (QTableWidgetItem):
|
||||
class VmNetvmItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmNetvmItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
self.vm = vm
|
||||
|
||||
if vm.is_netvm() and not vm.is_proxyvm():
|
||||
# TODO: differentiate without no net vm/ no networking?
|
||||
# TODO: mark provides network somehow?
|
||||
if vm.netvm is None:
|
||||
self.setText("n/a")
|
||||
elif vm.netvm is not None:
|
||||
self.setText(vm.netvm.name)
|
||||
else:
|
||||
self.setText("---")
|
||||
self.setText(vm.netvm.name)
|
||||
|
||||
self.setTextAlignment(Qt.AlignVCenter)
|
||||
self.setTextAlignment(QtCore.Qt.AlignVCenter)
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -338,18 +342,17 @@ class VmNetvmItem (QTableWidgetItem):
|
||||
else:
|
||||
return super(VmNetvmItem, self).__lt__(other)
|
||||
|
||||
class VmInternalItem(QTableWidgetItem):
|
||||
|
||||
class VmInternalItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmInternalItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.internal = self.vm.internal
|
||||
self.internal = vm.features.get('internal', False)
|
||||
# TODO: should default be false
|
||||
|
||||
if self.internal:
|
||||
self.setText("Yes")
|
||||
else:
|
||||
self.setText("")
|
||||
self.setText("Yes" if self.internal else "")
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -359,144 +362,10 @@ class VmInternalItem(QTableWidgetItem):
|
||||
return super(VmInternalItem, self).__lt__(other)
|
||||
|
||||
|
||||
class VmUsageBarWidget (QWidget):
|
||||
# features man qvm-features
|
||||
class VmUpdateInfoWidget(QtGui.QWidget):
|
||||
|
||||
class VmUsageBarItem (QTableWidgetItem):
|
||||
def __init__(self, value, vm):
|
||||
super(VmUsageBarWidget.VmUsageBarItem, self).__init__()
|
||||
self.value = value
|
||||
self.vm = vm
|
||||
|
||||
def set_value(self, value):
|
||||
self.value = value
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
return True
|
||||
elif other.vm.qid == 0:
|
||||
return False
|
||||
elif self.value == other.value:
|
||||
return self.vm.qid < other.vm.qid
|
||||
else:
|
||||
return int(self.value) < int(other.value)
|
||||
|
||||
def __init__(self, min, max, format, update_func, vm, load, hue=210, parent = None):
|
||||
super (VmUsageBarWidget, self).__init__(parent)
|
||||
|
||||
|
||||
self.min = min
|
||||
self.max = max
|
||||
self.update_func = update_func
|
||||
self.value = min
|
||||
|
||||
self.widget = QProgressBar()
|
||||
self.widget.setMinimum(min)
|
||||
self.widget.setMaximum(max)
|
||||
self.widget.setFormat(format)
|
||||
|
||||
self.widget.setStyleSheet(
|
||||
"QProgressBar:horizontal{" +\
|
||||
"border: 1px solid hsv({0}, 100, 250);".format(hue) +\
|
||||
"border-radius: 4px;\
|
||||
background: transparent;\
|
||||
text-align: center;\
|
||||
}\
|
||||
QProgressBar::chunk:horizontal {\
|
||||
background: qlineargradient(x1: 1, y1: 0.5, x2: 1, y2: 0.5, " +\
|
||||
"stop: 0 hsv({0}, 170, 207),".format(hue) +
|
||||
" stop: 1 white); \
|
||||
}"
|
||||
)
|
||||
|
||||
layout = QHBoxLayout()
|
||||
layout.addWidget(self.widget)
|
||||
|
||||
self.setLayout(layout)
|
||||
self.tableItem = self.VmUsageBarItem(min, vm)
|
||||
|
||||
self.update_load(vm, load)
|
||||
|
||||
|
||||
|
||||
def update_load(self, vm, load):
|
||||
self.value = self.update_func(vm, load)
|
||||
self.widget.setValue(self.value)
|
||||
self.tableItem.set_value(self.value)
|
||||
|
||||
class ChartWidget (QWidget):
|
||||
|
||||
class ChartItem (QTableWidgetItem):
|
||||
def __init__(self, value, vm):
|
||||
super(ChartWidget.ChartItem, self).__init__()
|
||||
self.value = value
|
||||
self.vm = vm
|
||||
|
||||
def set_value(self, value):
|
||||
self.value = value
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
return True
|
||||
elif other.vm.qid == 0:
|
||||
return False
|
||||
elif self.value == other.value:
|
||||
return self.vm.qid < other.vm.qid
|
||||
else:
|
||||
return self.value < other.value
|
||||
|
||||
def __init__(self, vm, update_func, hue, load = 0, parent = None):
|
||||
super (ChartWidget, self).__init__(parent)
|
||||
self.update_func = update_func
|
||||
self.hue = hue
|
||||
if hue < 0 or hue > 255:
|
||||
self.hue = 255
|
||||
self.load = load
|
||||
assert self.load >= 0 and self.load <= 100, "load = {0}".format(self.load)
|
||||
self.load_history = [self.load]
|
||||
self.tableItem = ChartWidget.ChartItem(self.load, vm)
|
||||
|
||||
def update_load (self, vm, load):
|
||||
self.load = self.update_func(vm, load)
|
||||
|
||||
assert self.load >= 0, "load = {0}".format(self.load)
|
||||
# assert self.load >= 0 and self.load <= 100, "load = {0}".format(self.load)
|
||||
if self.load > 100:
|
||||
# FIXME: This is an ugly workaround for cpu_load:/
|
||||
self.load = 100
|
||||
|
||||
self.load_history.append (self.load)
|
||||
self.tableItem.set_value(self.load)
|
||||
self.repaint()
|
||||
|
||||
def paintEvent (self, Event = None):
|
||||
p = QPainter (self)
|
||||
dx = 4
|
||||
|
||||
W = self.width()
|
||||
H = self.height() - 5
|
||||
N = len(self.load_history)
|
||||
if N > W/dx:
|
||||
tail = N - W/dx
|
||||
N = W/dx
|
||||
self.load_history = self.load_history[tail:]
|
||||
|
||||
assert len(self.load_history) == N
|
||||
|
||||
for i in range (0, N-1):
|
||||
val = self.load_history[N- i - 1]
|
||||
sat = 70 + val*(255-70)/100
|
||||
color = QColor.fromHsv (self.hue, sat, 255)
|
||||
pen = QPen (color)
|
||||
pen.setWidth(dx-1)
|
||||
p.setPen(pen)
|
||||
if val > 0:
|
||||
p.drawLine (W - i*dx - dx, H , W - i*dx - dx, H - (H - 5) * val/100)
|
||||
|
||||
|
||||
|
||||
class VmUpdateInfoWidget(QWidget):
|
||||
|
||||
class VmUpdateInfoItem (QTableWidgetItem):
|
||||
class VmUpdateInfoItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, value, vm):
|
||||
super(VmUpdateInfoWidget.VmUpdateInfoItem, self).__init__()
|
||||
self.value = 0
|
||||
@ -521,16 +390,16 @@ class VmUpdateInfoWidget(QWidget):
|
||||
else:
|
||||
return self.value < other.value
|
||||
|
||||
def __init__(self, vm, show_text=True, parent = None):
|
||||
super (VmUpdateInfoWidget, self).__init__(parent)
|
||||
layout = QHBoxLayout ()
|
||||
def __init__(self, vm, show_text=True, parent=None):
|
||||
super(VmUpdateInfoWidget, self).__init__(parent)
|
||||
layout = QtGui.QHBoxLayout()
|
||||
self.show_text = show_text
|
||||
if self.show_text:
|
||||
self.label=QLabel("")
|
||||
layout.addWidget(self.label, alignment=Qt.AlignCenter)
|
||||
self.label = QtGui.QLabel("")
|
||||
layout.addWidget(self.label, alignment=QtCore.Qt.AlignCenter)
|
||||
else:
|
||||
self.icon = QLabel("")
|
||||
layout.addWidget(self.icon, alignment=Qt.AlignCenter)
|
||||
self.icon = QtGui.QLabel("")
|
||||
layout.addWidget(self.icon, alignment=QtCore.Qt.AlignCenter)
|
||||
self.setLayout(layout)
|
||||
|
||||
self.previous_outdated_state = None
|
||||
@ -539,65 +408,27 @@ class VmUpdateInfoWidget(QWidget):
|
||||
self.tableItem = VmUpdateInfoWidget.VmUpdateInfoItem(self.value, vm)
|
||||
|
||||
def update_outdated(self, vm):
|
||||
if vm.type == "HVM":
|
||||
return
|
||||
|
||||
if vm.is_outdated():
|
||||
outdated_state = "outdated"
|
||||
# During TemplateVM shutdown, there's an interval of a few seconds
|
||||
# during which vm.template.is_running() returns false but
|
||||
# vm.is_outdated() does not yet return true, so the icon disappears.
|
||||
# This looks goofy, but we've decided not to fix it at this time
|
||||
# (2015-02-09).
|
||||
elif vm.template and vm.template.is_running():
|
||||
outdated_state = False
|
||||
|
||||
try:
|
||||
for vol in vm.volumes:
|
||||
if vol.is_outdated():
|
||||
outdated_state = "outdated"
|
||||
break
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
if not outdated_state and vm.template and vm.template.is_running():
|
||||
outdated_state = "to-be-outdated"
|
||||
else:
|
||||
outdated_state = None
|
||||
|
||||
if outdated_state != self.previous_outdated_state:
|
||||
self.update_status_widget(outdated_state)
|
||||
|
||||
self.previous_outdated_state = outdated_state
|
||||
|
||||
if not vm.is_updateable():
|
||||
return
|
||||
|
||||
if vm.qid == 0:
|
||||
update_recommended = self.previous_update_recommended
|
||||
if os.path.exists(qubes_dom0_updates_stat_file):
|
||||
update_recommended = True
|
||||
else:
|
||||
update_recommended = False
|
||||
|
||||
else:
|
||||
update_recommended = self.previous_update_recommended
|
||||
stat_file_path = vm.dir_path + '/' + vm_files["updates_stat_file"]
|
||||
if not os.path.exists(stat_file_path):
|
||||
update_recommended = False
|
||||
else:
|
||||
if (not hasattr(vm, "updates_stat_file_read_time")) or vm.updates_stat_file_read_time <= os.path.getmtime(stat_file_path):
|
||||
|
||||
stat_file = open(stat_file_path, "r")
|
||||
updates = stat_file.read().strip()
|
||||
stat_file.close()
|
||||
if updates.isdigit():
|
||||
updates = int(updates)
|
||||
else:
|
||||
updates = 0
|
||||
|
||||
if updates == 0:
|
||||
update_recommended = False
|
||||
else:
|
||||
update_recommended = True
|
||||
vm.updates_stat_file_read_time = time.time()
|
||||
|
||||
if update_recommended and not self.previous_update_recommended:
|
||||
self.update_status_widget("update")
|
||||
elif self.previous_update_recommended and not update_recommended:
|
||||
self.update_status_widget(None)
|
||||
|
||||
self.previous_update_recommended = update_recommended
|
||||
|
||||
updates_available = vm.features.get('updates-available', False)
|
||||
if updates_available != self.previous_update_recommended:
|
||||
self.update_status_widget("update" if updates_available else None)
|
||||
self.previous_update_recommended = updates_available
|
||||
|
||||
def update_status_widget(self, state):
|
||||
self.value = state
|
||||
@ -618,7 +449,7 @@ class VmUpdateInfoWidget(QWidget):
|
||||
tooltip_text = self.tr(
|
||||
"The TemplateVM must be stopped before changes from its "
|
||||
"current session can be picked up by this VM.")
|
||||
elif state is None:
|
||||
else:
|
||||
label_text = ""
|
||||
icon_path = None
|
||||
tooltip_text = None
|
||||
@ -632,26 +463,27 @@ class VmUpdateInfoWidget(QWidget):
|
||||
self.icon = VmIconWidget(icon_path, True, 0.7)
|
||||
self.icon.setToolTip(tooltip_text)
|
||||
else:
|
||||
self.icon = QLabel(label_text)
|
||||
self.layout().addWidget(self.icon, alignment=Qt.AlignCenter)
|
||||
self.icon = QtGui.QLabel(label_text)
|
||||
self.layout().addWidget(self.icon, alignment=QtCore.Qt.AlignCenter)
|
||||
|
||||
|
||||
class VmSizeOnDiskItem (QTableWidgetItem):
|
||||
class VmSizeOnDiskItem (QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmSizeOnDiskItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
self.value = 0
|
||||
self.update()
|
||||
self.setTextAlignment(Qt.AlignVCenter)
|
||||
self.setTextAlignment(QtCore.Qt.AlignVCenter)
|
||||
|
||||
def update(self):
|
||||
if self.vm.qid == 0:
|
||||
self.setText("n/a")
|
||||
else:
|
||||
self.value = 10
|
||||
self.value = self.vm.get_disk_utilization()/(1024*1024)
|
||||
self.setText( str(self.value) + " MiB")
|
||||
self.setText(str(self.value) + " MiB")
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -663,17 +495,20 @@ class VmSizeOnDiskItem (QTableWidgetItem):
|
||||
else:
|
||||
return self.value < other.value
|
||||
|
||||
class VmIPItem(QTableWidgetItem):
|
||||
|
||||
class VmIPItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmIPItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
# TODO: check if you don't need a try around here
|
||||
self.vm = vm
|
||||
self.ip = self.vm.ip
|
||||
if self.ip:
|
||||
self.setText(self.ip)
|
||||
else:
|
||||
self.setText("n/a")
|
||||
self.setText("n/a")
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -682,16 +517,18 @@ class VmIPItem(QTableWidgetItem):
|
||||
return False
|
||||
return super(VmIPItem, self).__lt__(other)
|
||||
|
||||
class VmIncludeInBackupsItem(QTableWidgetItem):
|
||||
|
||||
class VmIncludeInBackupsItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmIncludeInBackupsItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
if self.vm.include_in_backups:
|
||||
self.setText("Yes")
|
||||
else:
|
||||
self.setText("")
|
||||
self.setText("")
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
@ -703,16 +540,18 @@ class VmIncludeInBackupsItem(QTableWidgetItem):
|
||||
else:
|
||||
return self.vm.include_in_backups < other.vm.include_in_backups
|
||||
|
||||
class VmLastBackupItem(QTableWidgetItem):
|
||||
|
||||
class VmLastBackupItem(QtGui.QTableWidgetItem):
|
||||
def __init__(self, vm):
|
||||
super(VmLastBackupItem, self).__init__()
|
||||
self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)
|
||||
self.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
self.vm = vm
|
||||
if self.vm.backup_timestamp:
|
||||
self.setText(str(self.vm.backup_timestamp.date()))
|
||||
self.setText(self.vm.backup_timestamp)
|
||||
else:
|
||||
self.setText("")
|
||||
self.setText("")
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.vm.qid == 0:
|
||||
|
943
ui/vtmanager.ui
Normal file
943
ui/vtmanager.ui
Normal file
@ -0,0 +1,943 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VmManagerWindow</class>
|
||||
<widget class="QMainWindow" name="VmManagerWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>769</width>
|
||||
<height>385</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Qubes VM Manager</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset theme="qubes-manager">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="locale">
|
||||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="searchContainer">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Search:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTableWidget" name="table">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::NoPen</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="cornerButtonEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="rowCount">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>150</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||
<number>150</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Nowy wiersz</string>
|
||||
</property>
|
||||
</row>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<row/>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>VM name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>State</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Update info</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Template</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>VM's template</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>NetVM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>VM's netVM</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>CPU</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>CPU Graph</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>CPU usage graph</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>MEM</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>MEM Graph</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Memory usage graph</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Size</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Internal</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>IP</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Backups</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Last backup</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>769</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_system">
|
||||
<property name="title">
|
||||
<string>&System</string>
|
||||
</property>
|
||||
<addaction name="action_global_settings"/>
|
||||
<addaction name="action_show_network"/>
|
||||
<addaction name="action_backup"/>
|
||||
<addaction name="action_restore"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_view">
|
||||
<property name="title">
|
||||
<string>&View</string>
|
||||
</property>
|
||||
<addaction name="action_vm_type"/>
|
||||
<addaction name="action_label"/>
|
||||
<addaction name="action_name"/>
|
||||
<addaction name="action_state"/>
|
||||
<addaction name="action_template"/>
|
||||
<addaction name="action_netvm"/>
|
||||
<addaction name="action_cpu"/>
|
||||
<addaction name="action_cpu_graph"/>
|
||||
<addaction name="action_mem"/>
|
||||
<addaction name="action_mem_graph"/>
|
||||
<addaction name="action_size_on_disk"/>
|
||||
<addaction name="action_internal"/>
|
||||
<addaction name="action_ip"/>
|
||||
<addaction name="action_backups"/>
|
||||
<addaction name="action_last_backup"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_toolbar"/>
|
||||
<addaction name="action_menubar"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_showallvms"/>
|
||||
<addaction name="action_showinternalvms"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_search"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_vm">
|
||||
<property name="title">
|
||||
<string>V&M</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="logs_menu">
|
||||
<property name="title">
|
||||
<string>&Logs</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/log.png</normaloff>:/log.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="blk_menu">
|
||||
<property name="title">
|
||||
<string>Attach/detach &block devices</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/mount.png</normaloff>:/mount.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="action_createvm"/>
|
||||
<addaction name="action_removevm"/>
|
||||
<addaction name="action_clonevm"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_resumevm"/>
|
||||
<addaction name="action_pausevm"/>
|
||||
<addaction name="action_shutdownvm"/>
|
||||
<addaction name="action_restartvm"/>
|
||||
<addaction name="action_killvm"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_settings"/>
|
||||
<addaction name="action_editfwrules"/>
|
||||
<addaction name="action_appmenus"/>
|
||||
<addaction name="action_updatevm"/>
|
||||
<addaction name="action_run_command_in_vm"/>
|
||||
<addaction name="action_set_keyboard_layout"/>
|
||||
<addaction name="action_toggle_audio_input"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="logs_menu"/>
|
||||
<addaction name="blk_menu"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_about">
|
||||
<property name="title">
|
||||
<string>&About</string>
|
||||
</property>
|
||||
<addaction name="action_about_qubes"/>
|
||||
</widget>
|
||||
<addaction name="menu_system"/>
|
||||
<addaction name="menu_vm"/>
|
||||
<addaction name="menu_view"/>
|
||||
<addaction name="menu_about"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::BottomToolBarArea|Qt::TopToolBarArea</set>
|
||||
</property>
|
||||
<property name="floatable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="action_createvm"/>
|
||||
<addaction name="action_removevm"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_resumevm"/>
|
||||
<addaction name="action_pausevm"/>
|
||||
<addaction name="action_shutdownvm"/>
|
||||
<addaction name="action_restartvm"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_settings"/>
|
||||
<addaction name="action_editfwrules"/>
|
||||
<addaction name="action_appmenus"/>
|
||||
<addaction name="action_updatevm"/>
|
||||
<addaction name="action_set_keyboard_layout"/>
|
||||
<addaction name="action_toggle_audio_input"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_global_settings"/>
|
||||
<addaction name="action_backup"/>
|
||||
<addaction name="action_restore"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_showallvms"/>
|
||||
</widget>
|
||||
<action name="action_createvm">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/createvm.png</normaloff>:/createvm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create &New VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a new VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_removevm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/removevm.png</normaloff>:/removevm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Remove an existing VM (must be stopped first)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_resumevm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/resumevm.png</normaloff>:/resumevm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start/Resume V&M</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start/Resume selected VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_pausevm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/pausevm.png</normaloff>:/pausevm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Pause VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pause selected VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_shutdownvm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/shutdownvm.png</normaloff>:/shutdownvm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Shutdown VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Shutdown selected VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_restartvm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/restartvm.png</normaloff>:/restartvm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restar&t VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Restart selected VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_appmenus">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/apps.png</normaloff>:/apps.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add/remove app s&hortcuts</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add/remove app shortcuts for this VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_updatevm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/updateable.png</normaloff>:/updateable.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Update VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Update VM system</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_toggle_audio_input">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/mic.png</normaloff>:/mic.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Attach/detach &audio-input to the VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Attach/detach audio-input to the VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_showallvms">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/show-all-running.png</normaloff>
|
||||
<selectedoff>:/showallvms.png</selectedoff>:/show-all-running.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show/Hide inactive VMs</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show/Hide inactive VMs</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_editfwrules">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/firewall.png</normaloff>:/firewall.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit VM &firewall rules</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Edit VM firewall rules</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_showgraphs">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/showcpuload.png</normaloff>:/showcpuload.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show graphs</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show Graphs</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_options">
|
||||
<property name="text">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_view">
|
||||
<property name="text">
|
||||
<string>View</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_cpu">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&CPU</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_cpu_graph">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CPU &Graph</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_mem">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&MEM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_mem_graph">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M&EM Graph</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_template">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Template</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_netvm">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&NetVM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_settings">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/settings.png</normaloff>:/settings.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>VM s&ettings</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>VM Settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_restore">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/restore.png</normaloff>:/restore.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Restore VMs from backup</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_backup">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/backup.png</normaloff>:/backup.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Backup VMs</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_global_settings">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/global-settings.png</normaloff>:/global-settings.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Global settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_show_network">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/networking.png</normaloff>:/networking.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Qubes Network</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_state">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&State</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_killvm">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/killvm.png</normaloff>:/killvm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Kill VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Kill selected VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_set_keyboard_layout">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/kbd-layout.png</normaloff>:/kbd-layout.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set keyboard la&yout</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set keyboard layout per VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_vm_type">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>T&ype</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>VM Type</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_label">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Label</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_name">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>N&ame</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_toolbar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show tool bar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_menubar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show menu bar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_about_qubes">
|
||||
<property name="icon">
|
||||
<iconset theme="qubes-manager">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Qubes OS</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_size_on_disk">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Si&ze</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Size on Disk</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_run_command_in_vm">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/run-command.png</normaloff>:/run-command.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Run command in VM</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Run command in the specified VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_clonevm">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/templatevm.png</normaloff>:/templatevm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Clone VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_internal">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inte&rnal</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Is an internal VM</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_showinternalvms">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/show-all-running.png</normaloff>:/show-all-running.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show/Hide internal VMs</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_startvm_tools_install">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/resumevm.png</normaloff>:/resumevm.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start VM for Window Tools installation</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start VM for Window Tools installation</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_ip">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&IP</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_backups">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Include in &backups</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_last_backup">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Last back&up</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_search">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+F</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user