After meeting changes to the whole gui.

This commit is contained in:
Agnieszka Kostrzewa 2012-02-05 18:41:41 +01:00
parent 49495d6444
commit e525bc7583
19 changed files with 1045 additions and 624 deletions

View File

@ -25,10 +25,10 @@
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -40,31 +40,21 @@
</layout>
</widget>
<widget class="QWizardPage" name="wizardPage">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Backup destination directory</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
</font>
</property>
<property name="text">
<string>Select backup destination directory:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Device</string>
<string>Device:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -94,17 +84,17 @@
</item>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Backup directory:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QLineEdit" name="pathLineEdit"/>
</item>
<item row="2" column="2">
<item row="1" column="2">
<widget class="QToolButton" name="selectPathButton">
<property name="text">
<string>...</string>
@ -113,16 +103,19 @@
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizardPage2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -150,10 +143,10 @@ p, li { white-space: pre-wrap; }
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -170,10 +163,10 @@ p, li { white-space: pre-wrap; }
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -182,21 +175,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit_2">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;br /&gt;A lot of info&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">

View File

@ -6,14 +6,20 @@
<rect>
<x>0</x>
<y>0</y>
<width>568</width>
<height>342</height>
<width>678</width>
<height>288</height>
</rect>
</property>
<property name="windowTitle">
<string>Qubes Global Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>System defaults</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
@ -66,17 +72,100 @@
<item row="3" column="1">
<widget class="QComboBox" name="defaultTemplateVMCombo"/>
</item>
<item row="4" column="0">
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Default memory settings</string>
</property>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>11</x>
<y>26</y>
<width>134</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Minimal VM's memory:</string>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>11</x>
<y>57</y>
<width>139</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>dom0 memory margin:</string>
</property>
</widget>
<widget class="QSpinBox" name="minVMmem">
<property name="geometry">
<rect>
<x>156</x>
<y>26</y>
<width>121</width>
<height>25</height>
</rect>
</property>
<property name="suffix">
<string> MB</string>
</property>
<property name="maximum">
<number>999999999</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
</widget>
<widget class="QSpinBox" name="dom0memMargin">
<property name="geometry">
<rect>
<x>156</x>
<y>57</y>
<width>121</width>
<height>25</height>
</rect>
</property>
<property name="suffix">
<string> MB</string>
</property>
<property name="maximum">
<number>999999999</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
</widget>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Kernel</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Default kernel:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_5"/>
</item>
<item row="5" column="0" colspan="2">
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>

BIN
icons/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
icons/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
icons/flag-blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
icons/flag-green.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
icons/flag-red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
icons/flag-yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
icons/pencil.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
icons/remove.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -22,6 +22,13 @@
<property name="windowTitle">
<string>Qubes VM Manager</string>
</property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/qubes.png</normaloff>:/qubes.png</iconset>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<widget class="QWidget" name="centralwidget">
<property name="enabled">
<bool>true</bool>
@ -42,6 +49,12 @@
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTableWidget" name="table">
<property name="sizePolicy">
@ -87,10 +100,10 @@
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="gridStyle">
<enum>Qt::DashLine</enum>
<enum>Qt::NoPen</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
@ -128,16 +141,33 @@
<property name="text">
<string>Name</string>
</property>
<property name="toolTip">
<string>VM name</string>
</property>
</column>
<column>
<property name="text">
<string>Upd</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">
@ -148,6 +178,9 @@
<property name="text">
<string>CPU Graph</string>
</property>
<property name="toolTip">
<string>CPU usage graph</string>
</property>
</column>
<column>
<property name="text">
@ -158,6 +191,9 @@
<property name="text">
<string>MEM Graph</string>
</property>
<property name="toolTip">
<string>Memory usage graph</string>
</property>
</column>
<column>
<property name="text">
@ -198,6 +234,7 @@
<property name="title">
<string>Columns visibility</string>
</property>
<addaction name="actionUpd"/>
<addaction name="actionTemplate"/>
<addaction name="actionNetVM"/>
<addaction name="actionCPU"/>
@ -212,17 +249,6 @@
<addaction name="menuOptions"/>
<addaction name="menuView"/>
</widget>
<widget class="QStatusBar" name="statusbar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
@ -522,6 +548,14 @@
<string>Global settings</string>
</property>
</action>
<action name="actionUpd">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Upd</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View File

@ -86,6 +86,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="add_all_button">
<property name="text">
<string>&gt;&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="add_selected_button">
<property name="text">
@ -100,6 +107,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="remove_all_button">
<property name="text">
<string>&lt;&lt;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">

View File

@ -156,7 +156,7 @@ class VmIconWidget (QWidget):
label_icon = QLabel()
icon = QIcon (icon_path)
icon_sz = QSize (VmManagerWindow.row_height * 0.8, VmManagerWindow.row_height * 0.3)
icon_sz = QSize (VmManagerWindow.row_height * 0.8, VmManagerWindow.row_height * 0.8)
icon_pixmap = icon.pixmap(icon_sz, QIcon.Disabled if not enabled else QIcon.Normal)
label_icon.setPixmap (icon_pixmap)
label_icon.setFixedSize (icon_sz)
@ -187,7 +187,7 @@ class VmNetvmWidget (QWidget):
class VmUsageBarWidget (QWidget):
def __init__(self, min, max, format, label, update_func, vm, load, parent = None):
def __init__(self, min, max, format, update_func, vm, load, parent = None):
super (VmUsageBarWidget, self).__init__(parent)
self.min = min
@ -198,10 +198,20 @@ class VmUsageBarWidget (QWidget):
self.widget.setMinimum(min)
self.widget.setMaximum(max)
self.widget.setFormat(format);
self.label = QLabel(label)
self.widget.setStyleSheet(
"QProgressBar:horizontal{ \
border: 1px solid lightblue;\
border-radius: 4px;\
background: white;\
text-align: center;\
}\
QProgressBar::chunk:horizontal {\
background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 hsv(210, 170, 207), stop: 1 white);\
}"
)
layout = QHBoxLayout()
layout.addWidget(self.label)
layout.addWidget(self.widget)
self.setLayout(layout)
@ -298,20 +308,25 @@ class MemChartWidget (QWidget):
class VmUpdateInfoWidget(QWidget):
def __init__(self, vm, parent = None):
def __init__(self, vm, show_text=True, parent = None):
super (VmUpdateInfoWidget, self).__init__(parent)
layout = QHBoxLayout ()
self.label = QLabel("---")
self.show_text = show_text
if self.show_text:
self.label=QLabel("")
layout.addWidget(self.label, alignment=Qt.AlignCenter)
else:
self.icon = QLabel("")
layout.addWidget(self.icon, alignment=Qt.AlignHCenter)
self.setLayout(layout)
self.previous_outdated = False
self.previous_update_recommended = False
self.previous_update_recommended = None
def update_outdated(self, vm):
outdated = vm.is_outdated()
if outdated and not self.previous_outdated:
self.label.setText("<font color=\"red\">outdated</font>")
self.update_status_widget("outdated")
self.previous_outdated = outdated
if vm.is_updateable():
@ -323,11 +338,37 @@ class VmUpdateInfoWidget(QWidget):
update_recommended = True
else:
update_recommended = False
self.label.setText("<font color=\"green\">OK</font>")
if not self.show_text and self.previous_update_recommended != False:
self.update_status_widget("ok")
if update_recommended and not self.previous_update_recommended:
self.label.setText("<font color=\"#CCCC00\">check updates</font>")
self.update_status_widget("update")
self.previous_update_recommended = update_recommended
def update_status_widget(self, state):
if state == "ok":
label_text = ""
icon_path = ":/flag-green.png"
tooltip_text = "VM up to date"
elif state == "update":
label_text = "<font color=\"#CCCC00\">Check updates</font>"
icon_path = ":/flag-yellow.png"
tooltip_text = "Update recommended"
elif state == "outdated":
label_text = "<font color=\"red\">VM outdated</font>"
icon_path = ":/flag-red.png"
tooltip_text = "VM outdated"
if self.show_text:
self.label.setText(label_text)
else:
self.layout().removeWidget(self.icon)
self.icon.deleteLater()
self.icon = VmIconWidget(icon_path, True)
self.icon.setToolTip(tooltip_text)
self.layout().addWidget(self.icon, alignment=Qt.AlignCenter)
class VmBlockDevicesWidget(QWidget):
def __init__(self, vm, parent=None):
@ -353,31 +394,34 @@ class VmRowInTable(object):
self.info_widget = VmInfoWidget(vm)
table.setCellWidget(row_no, 0, self.info_widget)
self.upd_widget = VmUpdateInfoWidget(vm, False)
table.setCellWidget(row_no, 1, self.upd_widget)
self.template_widget = VmTemplateWidget(vm)
table.setCellWidget(row_no, 1, self.template_widget)
table.setCellWidget(row_no, 2, self.template_widget)
self.netvm_widget = VmNetvmWidget(vm)
table.setCellWidget(row_no, 2, self.netvm_widget)
table.setCellWidget(row_no, 3, self.netvm_widget)
self.cpu_usage_widget = VmUsageBarWidget(0, 100, "", "CPU",
self.cpu_usage_widget = VmUsageBarWidget(0, 100, "",
lambda vm, val: val if vm.last_power_state else 0, vm, 0)
table.setCellWidget(row_no, 3, self.cpu_usage_widget)
table.setCellWidget(row_no, 4, self.cpu_usage_widget)
self.load_widget = LoadChartWidget(vm)
table.setCellWidget(row_no, 4, self.load_widget)
table.setCellWidget(row_no, 5, self.load_widget)
self.mem_usage_widget = VmUsageBarWidget(0, qubes_host.memory_total/1024, "%v MB", "MEM",
self.mem_usage_widget = VmUsageBarWidget(0, qubes_host.memory_total/1024, "%v MB",
lambda vm, val: vm.get_mem()/1024 if vm.last_power_state else 0, vm, 0)
table.setCellWidget(row_no, 5, self.mem_usage_widget)
table.setCellWidget(row_no, 6, self.mem_usage_widget)
self.mem_widget = MemChartWidget(vm)
table.setCellWidget(row_no, 6, self.mem_widget)
table.setCellWidget(row_no, 7, self.mem_widget)
self.updateinfo_widget = VmUpdateInfoWidget(vm)
table.setCellWidget(row_no, 7, self.updateinfo_widget)
self.updateinfo_widget = VmUpdateInfoWidget(vm, True)
table.setCellWidget(row_no, 8, self.updateinfo_widget)
self.blockdevices_widget = VmBlockDevicesWidget(vm)
table.setCellWidget(row_no, 8, self.blockdevices_widget)
table.setCellWidget(row_no, 9, self.blockdevices_widget)
def update(self, counter, cpu_load = None):
@ -388,6 +432,7 @@ class VmRowInTable(object):
self.load_widget.update_load(self.vm, cpu_load)
self.mem_widget.update_load(self.vm)
self.updateinfo_widget.update_outdated(self.vm)
self.upd_widget.update_outdated(self.vm)
class NewAppVmDlg (QDialog, ui_newappvmdlg.Ui_NewAppVMDlg):
def __init__(self, parent = None):
@ -437,18 +482,20 @@ class ThreadMonitor(QObject):
class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
row_height = 30
column_width = 200
max_visible_rows = 7
update_interval = 1000 # in msec
show_inactive_vms = True
columns_indices = { "Name": 0,
"Template": 1,
"NetVM": 2,
"CPU": 3,
"CPU Graph": 4,
"MEM": 5,
"MEM Graph": 6,
"Update Info": 7,
"Block Device": 8 }
"Upd": 1,
"Template": 2,
"NetVM": 3,
"CPU": 4,
"CPU Graph": 5,
"MEM": 6,
"MEM Graph": 7,
"Update Info": 8,
"Block Device": 9 }
@ -462,7 +509,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.connect(self.table, SIGNAL("itemSelectionChanged()"), self.table_selection_changed)
cur_pos = self.pos()
self.table.setColumnWidth(0, 200)
self.table.setColumnWidth(0, self.column_width)
self.setSizeIncrement(QtCore.QSize(200, 30))
self.centralwidget.setSizeIncrement(QtCore.QSize(200, 30))
self.table.setSizeIncrement(QtCore.QSize(200, 30))
@ -471,15 +518,21 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.table.setColumnHidden( self.columns_indices["NetVM"], True)
self.actionNetVM.setChecked(False)
self.table.setColumnHidden( self.columns_indices["Update Info"], True)
self.actionUpdate_Info.setChecked(False)
self.table.setColumnHidden( self.columns_indices["CPU Graph"], True)
self.actionCPU_Graph.setChecked(False)
self.table.setColumnHidden( self.columns_indices["MEM Graph"], True)
self.actionMEM_Graph.setChecked(False)
self.table.setColumnHidden( self.columns_indices["Block Device"], True)
self.actionBlock_Devices.setChecked(False)
self.table.setColumnWidth(self.columns_indices["Upd"], 50)
#self.table.setFrameShape(QFrame.NoFrame)
self.table.setContentsMargins(0,0,0,0)
self.centralwidget.layout().setContentsMargins(0,0,0,0)
self.layout().setContentsMargins(0,0,0,0)
self.update_table_columns()
self.set_table_geom_height()
self.counter = 0
self.shutdown_monitor = {}
@ -487,35 +540,41 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.last_measure_time = time.time()
QTimer.singleShot (self.update_interval, self.update_table)
def show(self):
super(VmManagerWindow, self).show()
self.set_table_geom_height()
self.update_table_columns()
def set_table_geom_height(self):
minH = self.table.horizontalHeader().height() +\
2*self.table.contentsMargins().top() +\
self.centralwidget.layout().contentsMargins().top() +\
self.centralwidget.layout().contentsMargins().bottom()
#self.table.contentsMargins().bottom() # this is huge, dunno why
#2*self.centralwidget.layout().verticalSpacing() # and this is negative...
2*self.table.frameWidth()
#All this sizing is kind of magic, so change it only if you have to
#or if you know what you're doing :)
n = self.table.rowCount();
if n > self.max_visible_rows:
for i in range (0, self.max_visible_rows):
minH += self.table.rowHeight(i)
maxH = minH
for i in range (self.max_visible_rows, n):
maxH += self.table.rowHeight(i)
if n >= self.max_visible_rows:
minH += self.max_visible_rows*self.row_height
maxH += n*self.row_height
else:
for i in range (n):
minH += self.table.rowHeight(i)
minH += n*self.row_height
maxH = minH
self.centralwidget.setMinimumHeight(minH)
maxH += self.menubar.height() + self.statusbar.height() +\
self.toolbar.height()
self.centralwidget.setMaximumHeight(maxH)
mainwindow_to_add = self.menubar.height() +\
self.toolbar.height() + \
self.menubar.contentsMargins().top() + self.menubar.contentsMargins().bottom() +\
self.toolbar.contentsMargins().top() + self.toolbar.contentsMargins().bottom()
maxH += mainwindow_to_add
minH += mainwindow_to_add
self.setMaximumHeight(maxH)
self.adjustSize()
self.setMinimumHeight(minH)
def get_vms_list(self):
@ -613,12 +672,14 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
def update_table_columns(self):
width = self.table.horizontalHeader().length() +\
table_width = self.table.horizontalHeader().length() +\
self.table.verticalScrollBar().width() + \
self.centralwidget.layout().contentsMargins().left() +\
self.centralwidget.layout().contentsMargins().right()
2*self.table.frameWidth() + 1
self.table.setFixedWidth( table_width )
self.centralwidget.setFixedWidth(table_width)
self.setFixedWidth(table_width)
self.table.setFixedWidth( width )
def table_selection_changed (self):
@ -738,6 +799,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
@pyqtSlot(name='on_action_removevm_triggered')
def action_removevm_triggered(self):
vm = self.get_selected_vm()
assert not vm.is_running()
assert not vm.installed_by_rpm
@ -885,7 +947,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
@pyqtSlot(name='on_action_settings_triggered')
def action_settings_triggered(self):
vm = self.get_selected_vm()
settings_window = VMSettingsWindow(vm)
settings_window = VMSettingsWindow(vm, 1)
settings_window.exec_()
@ -981,29 +1043,32 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.table.setColumnHidden( col_num, not show)
self.update_table_columns()
def on_actionUpd_toggled(self, checked):
self.showhide_collumn( self.columns_indices['Upd'], checked)
def on_actionTemplate_toggled(self, checked):
self.showhide_collumn( 1, checked)
self.showhide_collumn( self.columns_indices['Template'], checked)
def on_actionNetVM_toggled(self, checked):
self.showhide_collumn( 2, checked)
self.showhide_collumn( self.columns_indices['NetVM'], checked)
def on_actionCPU_toggled(self, checked):
self.showhide_collumn( 3, checked)
self.showhide_collumn( self.columns_indices['CPU'], checked)
def on_actionCPU_Graph_toggled(self, checked):
self.showhide_collumn( 4, checked)
self.showhide_collumn( self.columns_indices['CPU Graph'], checked)
def on_actionMEM_toggled(self, checked):
self.showhide_collumn( 5, checked)
self.showhide_collumn( self.columns_indices['MEM'], checked)
def on_actionMEM_Graph_toggled(self, checked):
self.showhide_collumn( 6, checked)
self.showhide_collumn( self.columns_indices['MEM Graph'], checked)
def on_actionUpdate_Info_toggled(self, checked):
self.showhide_collumn( 7, checked)
self.showhide_collumn( self.columns_indices['Update Info'], checked)
def on_actionBlock_Devices_toggled(self, checked):
self.showhide_collumn( 8, checked)
self.showhide_collumn( self.columns_indices['Block Device'], checked)
class QubesTrayIcon(QSystemTrayIcon):
@ -1139,4 +1204,3 @@ def main():
app.exec_()
trayIcon = None

View File

@ -9,7 +9,9 @@ class MultiSelectWidget(Ui_MultiSelectWidget, QWidget):
super(MultiSelectWidget, self).__init__()
self.setupUi(self);
self.add_selected_button.clicked.connect(self.add_selected)
self.add_all_button.clicked.connect(self.add_all)
self.remove_selected_button.clicked.connect(self.remove_selected)
self.remove_all_button.clicked.connect(self.remove_all)
self.available_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.selected_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
@ -20,15 +22,25 @@ class MultiSelectWidget(Ui_MultiSelectWidget, QWidget):
row = src.indexFromItem(s).row()
item = src.takeItem(row)
dst.addItem(item)
dst.sortItems()
def add_selected(self):
self.switch_selected(self.available_list, self.selected_list)
self.selected_list.sortItems()
def remove_selected(self):
self.switch_selected(self.selected_list, self.available_list)
self.available_list.sortItems()
def move_all(self, src, dst):
while src.count() > 0:
item = src.takeItem(0)
dst.addItem(item)
dst.sortItems()
def add_all(self):
self.move_all(self.available_list, self.selected_list)
def remove_all(self):
self.move_all(self.selected_list, self.available_list)
def clear(self):
self.available_list.clear()
@ -36,7 +48,6 @@ class MultiSelectWidget(Ui_MultiSelectWidget, QWidget):
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
ui = MultiSelectWidget()

View File

@ -53,7 +53,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
self.setupUi(self)
self.selectVMsWidget = MultiSelectWidget(self)
self.verticalLayout.insertWidget(1, self.selectVMsWidget)
self.selectVMsLayout.insertWidget(1, self.selectVMsWidget)
self.selectVMsWidget.available_list.addItem("netVM1")
self.selectVMsWidget.available_list.addItem("appVM1")

View File

@ -50,10 +50,12 @@ from multiselectwidget import *
class VMSettingsWindow(Ui_SettingsDialog, QDialog):
def __init__(self, vm, parent=None):
def __init__(self, vm, init_page=0, parent=None):
super(VMSettingsWindow, self).__init__(parent)
self.setupUi(self)
if init_page in range(self.tabWidget.count()):
self.tabWidget.setCurrentIndex(init_page)
self.connect(self.buttonBox, SIGNAL("accepted()"), self.save_and_apply)
self.connect(self.buttonBox, SIGNAL("rejected()"), self.reject)

View File

@ -1,5 +1,13 @@
<RCC>
<qresource>
<file alias="pencil.png">icons/pencil.png</file>
<file alias="edit.png">icons/edit.png</file>
<file alias="add.png">icons/add.png</file>
<file alias="flag-blue.png">icons/flag-blue.png</file>
<file alias="flag-green.png">icons/flag-green.png</file>
<file alias="flag-red.png">icons/flag-red.png</file>
<file alias="flag-yellow.png">icons/flag-yellow.png</file>
<file alias="remove.png">icons/remove.png</file>
<file alias="on.png">icons/on.png</file>
<file alias="appsprefs.png">icons/appsprefs.png</file>
<file alias="newfirewall.png">icons/newfirewall.png</file>

View File

@ -20,15 +20,33 @@
<set>QWizard::NoBackButtonOnLastPage|QWizard::NoBackButtonOnStartPage</set>
</property>
<widget class="QWizardPage" name="wizardPage1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Backup source location</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Device</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -58,82 +76,71 @@
</item>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Backup directory:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QLineEdit" name="pathLineEdit"/>
</item>
<item row="2" column="2">
<item row="1" column="2">
<widget class="QToolButton" name="selectPathButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
</font>
</property>
<property name="text">
<string>Select backup source location:</string>
</property>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>215</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizardPage">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
</font>
</property>
<property name="text">
<string>Select VMs to restore:</string>
<widget class="QGroupBox" name="seletVMsGroupbox">
<property name="title">
<string>VMs to restore</string>
</property>
<layout class="QVBoxLayout" name="selectVMsLayout"/>
</widget>
</item>
<item>
<widget class="QWidget" name="selectVMsWidget" native="true"/>
</item>
<item>
<widget class="QLabel" name="label_5">
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Restore options:</string>
<property name="title">
<string>Restore options</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="skip_broken">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Do not restore VMs that have missing templates or netvms.</string>
</property>
@ -143,26 +150,6 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="skip_conflicting">
<property name="toolTip">
<string>Do not restore VMs that are already present on the host.</string>
</property>
<property name="text">
<string>skip conflicting</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="ignore_uname_mismatch">
<property name="toolTip">
<string>Ignore dom0 username mismatch while restoring homedir.</string>
</property>
<property name="text">
<string>ignore username mismatch</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="ignore_missing">
<property name="toolTip">
<string>Ignore missing templates or netvms, restore VMs anyway.</string>
@ -172,17 +159,28 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="force_root">
<item row="0" column="2">
<widget class="QCheckBox" name="skip_conflicting">
<property name="toolTip">
<string>Force to run, even with root privileges.</string>
<string>Do not restore VMs that are already present on the host.</string>
</property>
<property name="text">
<string>force root</string>
<string>skip conflicting</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="ignore_uname_mismatch">
<property name="toolTip">
<string>Ignore dom0 username mismatch while restoring homedir.</string>
</property>
<property name="text">
<string>ignore username mismatch</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
@ -192,10 +190,10 @@
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -223,10 +221,10 @@ p, li { white-space: pre-wrap; }
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -243,10 +241,10 @@ p, li { white-space: pre-wrap; }
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
</font>
</property>
@ -255,21 +253,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit_2">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info&lt;br /&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A lot of info A lot of info A lot of info A lot of info A lot of info A lot of info&lt;br /&gt;A lot of info&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">

View File

@ -26,7 +26,7 @@
<locale language="English" country="UnitedStates"/>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="basic_tab">
<property name="locale">
@ -35,8 +35,6 @@
<attribute name="title">
<string>Basic</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_3">
@ -68,7 +66,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Use this template:</string>
<string>Template:</string>
</property>
</widget>
</item>
@ -76,9 +74,22 @@
<widget class="QComboBox" name="template_name"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="allow_networking">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Allow networking</string>
<string>NetVM:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="netVM"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Include in backups by default</string>
</property>
<property name="checked">
<bool>true</bool>
@ -94,6 +105,9 @@
<string>Info</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
@ -137,29 +151,7 @@
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>157</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="advanced_tab">
<attribute name="title">
<string>Advanced</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_16">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Disk storage</string>
@ -168,7 +160,7 @@
<item row="0" column="1">
<widget class="QSpinBox" name="priv_size">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -181,16 +173,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="priv_allow_to_grow">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Allow to grow</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_5">
<property name="text">
@ -205,64 +187,39 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Include in backups</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="2">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>73</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="advanced_tab">
<attribute name="title">
<string>Advanced</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Memory/CPU</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="1">
<widget class="QSpinBox" name="max_mem_size">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_6">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>MB</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<number>1</number>
<string>Initial memory:</string>
</property>
</widget>
</item>
@ -289,57 +246,70 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_15">
<item row="1" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Memory:</string>
<string>Max memory:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="max_mem_size">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>MB</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Max Memory:</string>
<string>VCPUs no.:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="2" column="1">
<widget class="QSpinBox" name="vcpus">
<property name="enabled">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="include_in_balancing">
<property name="text">
<string>VCPUs:</string>
<string>Include in memory balancing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_9">
<property name="title">
<string>Networking</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>NetVM:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="netVM"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>VM updateable?</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QGroupBox" name="groupBox_10">
<property name="title">
<string>Kernel</string>
@ -378,7 +348,7 @@
</layout>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>Paths</string>
@ -469,6 +439,168 @@
</layout>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>88</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="firewall_tab">
<attribute name="title">
<string>Firewall rules</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QRadioButton" name="policyAllowRadioButton">
<property name="text">
<string>Allow network access except...</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="policyDenyRadioButton">
<property name="text">
<string>Deny network access except...</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTreeView" name="rulesTreeView">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>true</bool>
</property>
<attribute name="headerDefaultSectionSize">
<number>40</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="icmpCheckBox">
<property name="text">
<string>Allow ICMP traffic</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dnsCheckBox">
<property name="text">
<string>Allow DNS queries</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QPushButton" name="newRuleButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/add.png</normaloff>:/add.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editRuleButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/pencil.png</normaloff>:/pencil.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="deleteRuleButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/remove.png</normaloff>:/remove.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="devices_tab">
@ -495,6 +627,112 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="services_tab">
<attribute name="title">
<string>Services</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLineEdit" name="service_lineEdit"/>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="add_button">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/add.png</normaloff>:/add.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0" rowspan="2">
<widget class="QListWidget" name="services_list">
<item>
<property name="text">
<string>ntpd</string>
</property>
<property name="checkState">
<enum>Checked</enum>
</property>
</item>
<item>
<property name="text">
<string>cupsd</string>
</property>
<property name="checkState">
<enum>Checked</enum>
</property>
</item>
<item>
<property name="text">
<string>meminfo</string>
</property>
<property name="checkState">
<enum>Checked</enum>
</property>
</item>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Checked services will be turned on.</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Unchecked services will be turned off.</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Unlisted services will follow default VM's settings.</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="remove_button">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/remove.png</normaloff>:/remove.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>