Simplified firewall rules edit dialogs

This commit is contained in:
Tomasz Sterna 2011-03-03 22:41:47 +01:00
parent ee3cfbb95f
commit d2255f2fc7
4 changed files with 155 additions and 256 deletions

View File

@ -7,48 +7,76 @@
<x>0</x>
<y>0</y>
<width>500</width>
<height>280</height>
<height>335</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit Firewall Rules</string>
<string>VM Firewall</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<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">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<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>
<attribute name="headerDefaultSectionSize">
<number>40</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
<layout class="QVBoxLayout" name="verticalLayout_2">
<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>
<attribute name="headerDefaultSectionSize">
<number>40</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</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>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
@ -103,10 +131,13 @@
</layout>
</widget>
<tabstops>
<tabstop>policyAllowRadioButton</tabstop>
<tabstop>policyDenyRadioButton</tabstop>
<tabstop>dnsCheckBox</tabstop>
<tabstop>rulesTreeView</tabstop>
<tabstop>newRuleButton</tabstop>
<tabstop>editRuleButton</tabstop>
<tabstop>deleteRuleButton</tabstop>
<tabstop>rulesTreeView</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
@ -118,8 +149,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>320</x>
<y>330</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
@ -134,8 +165,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>252</x>
<y>330</y>
</hint>
<hint type="destinationlabel">
<x>157</x>

View File

@ -9,12 +9,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>311</width>
<height>202</height>
<width>381</width>
<height>121</height>
</rect>
</property>
<property name="windowTitle">
<string>New Firewall Rule</string>
<string>New Address</string>
</property>
<property name="modal">
<bool>true</bool>
@ -22,9 +22,9 @@
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>30</x>
<y>160</y>
<width>271</width>
<x>10</x>
<y>80</y>
<width>361</width>
<height>32</height>
</rect>
</property>
@ -35,170 +35,59 @@
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QLabel" name="label">
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<y>14</y>
<width>62</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Name</string>
<string>Address</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<widget class="QLineEdit" name="addressEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>291</width>
<height>121</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>62</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Address</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>190</x>
<y>10</y>
<width>62</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Netmask</string>
</property>
</widget>
<widget class="QCheckBox" name="allowCheckBox">
<property name="geometry">
<rect>
<x>200</x>
<y>80</y>
<width>71</width>
<height>23</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Allow</string>
</property>
</widget>
<widget class="QLineEdit" name="addressEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>171</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>10</x>
<y>62</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Port</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>123</x>
<y>62</y>
<width>16</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
<widget class="QComboBox" name="netmaskComboBox">
<property name="geometry">
<rect>
<x>190</x>
<y>30</y>
<width>84</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QSpinBox" name="portBeginSpinBox">
<property name="geometry">
<rect>
<x>50</x>
<y>60</y>
<width>71</width>
<height>27</height>
</rect>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="QSpinBox" name="portEndSpinBox">
<property name="geometry">
<rect>
<x>130</x>
<y>60</y>
<width>71</width>
<height>27</height>
</rect>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</widget>
<widget class="QLineEdit" name="nameEdit">
<property name="geometry">
<rect>
<x>60</x>
<y>4</y>
<width>241</width>
<x>70</x>
<y>10</y>
<width>301</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>10</x>
<y>44</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Service</string>
</property>
</widget>
<widget class="QComboBox" name="serviceComboBox">
<property name="geometry">
<rect>
<x>70</x>
<y>40</y>
<width>301</width>
<height>27</height>
</rect>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</widget>
<tabstops>
<tabstop>nameEdit</tabstop>
<tabstop>addressEdit</tabstop>
<tabstop>netmaskComboBox</tabstop>
<tabstop>portBeginSpinBox</tabstop>
<tabstop>portEndSpinBox</tabstop>
<tabstop>allowCheckBox</tabstop>
<tabstop>serviceComboBox</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
@ -210,12 +99,12 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>174</y>
<x>370</x>
<y>94</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>201</y>
<y>120</y>
</hint>
</hints>
</connection>
@ -226,12 +115,12 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>300</x>
<y>180</y>
<x>370</x>
<y>100</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>201</y>
<y>120</y>
</hint>
</hints>
</connection>

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'editfwrulesdlg.ui'
#
# Created: Wed Feb 16 20:55:59 2011
# Created: Thu Mar 3 17:36:19 2011
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
@ -12,12 +12,20 @@ from PyQt4 import QtCore, QtGui
class Ui_EditFwRulesDlg(object):
def setupUi(self, EditFwRulesDlg):
EditFwRulesDlg.setObjectName("EditFwRulesDlg")
EditFwRulesDlg.resize(500, 280)
EditFwRulesDlg.resize(500, 335)
self.verticalLayout_3 = QtGui.QVBoxLayout(EditFwRulesDlg)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.policyAllowRadioButton = QtGui.QRadioButton(EditFwRulesDlg)
self.policyAllowRadioButton.setObjectName("policyAllowRadioButton")
self.verticalLayout_3.addWidget(self.policyAllowRadioButton)
self.policyDenyRadioButton = QtGui.QRadioButton(EditFwRulesDlg)
self.policyDenyRadioButton.setObjectName("policyDenyRadioButton")
self.verticalLayout_3.addWidget(self.policyDenyRadioButton)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.rulesTreeView = QtGui.QTreeView(EditFwRulesDlg)
self.rulesTreeView.setRootIsDecorated(False)
self.rulesTreeView.setUniformRowHeights(False)
@ -27,7 +35,12 @@ class Ui_EditFwRulesDlg(object):
self.rulesTreeView.setObjectName("rulesTreeView")
self.rulesTreeView.header().setDefaultSectionSize(40)
self.rulesTreeView.header().setStretchLastSection(False)
self.horizontalLayout.addWidget(self.rulesTreeView)
self.verticalLayout_2.addWidget(self.rulesTreeView)
self.dnsCheckBox = QtGui.QCheckBox(EditFwRulesDlg)
self.dnsCheckBox.setChecked(True)
self.dnsCheckBox.setObjectName("dnsCheckBox")
self.verticalLayout_2.addWidget(self.dnsCheckBox)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.newRuleButton = QtGui.QPushButton(EditFwRulesDlg)
@ -53,13 +66,19 @@ class Ui_EditFwRulesDlg(object):
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), EditFwRulesDlg.reject)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), EditFwRulesDlg.accept)
QtCore.QMetaObject.connectSlotsByName(EditFwRulesDlg)
EditFwRulesDlg.setTabOrder(self.policyAllowRadioButton, self.policyDenyRadioButton)
EditFwRulesDlg.setTabOrder(self.policyDenyRadioButton, self.dnsCheckBox)
EditFwRulesDlg.setTabOrder(self.dnsCheckBox, self.rulesTreeView)
EditFwRulesDlg.setTabOrder(self.rulesTreeView, self.newRuleButton)
EditFwRulesDlg.setTabOrder(self.newRuleButton, self.editRuleButton)
EditFwRulesDlg.setTabOrder(self.editRuleButton, self.deleteRuleButton)
EditFwRulesDlg.setTabOrder(self.deleteRuleButton, self.rulesTreeView)
EditFwRulesDlg.setTabOrder(self.rulesTreeView, self.buttonBox)
EditFwRulesDlg.setTabOrder(self.deleteRuleButton, self.buttonBox)
def retranslateUi(self, EditFwRulesDlg):
EditFwRulesDlg.setWindowTitle(QtGui.QApplication.translate("EditFwRulesDlg", "Edit Firewall Rules", None, QtGui.QApplication.UnicodeUTF8))
EditFwRulesDlg.setWindowTitle(QtGui.QApplication.translate("EditFwRulesDlg", "VM Firewall", None, QtGui.QApplication.UnicodeUTF8))
self.policyAllowRadioButton.setText(QtGui.QApplication.translate("EditFwRulesDlg", "Allow network access except...", None, QtGui.QApplication.UnicodeUTF8))
self.policyDenyRadioButton.setText(QtGui.QApplication.translate("EditFwRulesDlg", "Deny network access except...", None, QtGui.QApplication.UnicodeUTF8))
self.dnsCheckBox.setText(QtGui.QApplication.translate("EditFwRulesDlg", "Allow DNS queries", None, QtGui.QApplication.UnicodeUTF8))
self.newRuleButton.setText(QtGui.QApplication.translate("EditFwRulesDlg", "&New", None, QtGui.QApplication.UnicodeUTF8))
self.editRuleButton.setText(QtGui.QApplication.translate("EditFwRulesDlg", "&Edit", None, QtGui.QApplication.UnicodeUTF8))
self.deleteRuleButton.setText(QtGui.QApplication.translate("EditFwRulesDlg", "&Delete", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'newfwruledlg.ui'
#
# Created: Wed Feb 16 20:55:59 2011
# Created: Thu Mar 3 17:36:19 2011
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
@ -13,76 +13,36 @@ class Ui_NewFwRuleDlg(object):
def setupUi(self, NewFwRuleDlg):
NewFwRuleDlg.setObjectName("NewFwRuleDlg")
NewFwRuleDlg.setWindowModality(QtCore.Qt.NonModal)
NewFwRuleDlg.resize(311, 202)
NewFwRuleDlg.resize(381, 121)
NewFwRuleDlg.setModal(True)
self.buttonBox = QtGui.QDialogButtonBox(NewFwRuleDlg)
self.buttonBox.setGeometry(QtCore.QRect(30, 160, 271, 32))
self.buttonBox.setGeometry(QtCore.QRect(10, 80, 361, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.label = QtGui.QLabel(NewFwRuleDlg)
self.label.setGeometry(QtCore.QRect(10, 10, 62, 17))
self.label.setObjectName("label")
self.groupBox = QtGui.QGroupBox(NewFwRuleDlg)
self.groupBox.setGeometry(QtCore.QRect(10, 40, 291, 121))
self.groupBox.setTitle("")
self.groupBox.setObjectName("groupBox")
self.label_2 = QtGui.QLabel(self.groupBox)
self.label_2.setGeometry(QtCore.QRect(10, 10, 62, 17))
self.label_2 = QtGui.QLabel(NewFwRuleDlg)
self.label_2.setGeometry(QtCore.QRect(10, 14, 62, 17))
self.label_2.setObjectName("label_2")
self.label_3 = QtGui.QLabel(self.groupBox)
self.label_3.setGeometry(QtCore.QRect(190, 10, 62, 17))
self.label_3.setObjectName("label_3")
self.allowCheckBox = QtGui.QCheckBox(self.groupBox)
self.allowCheckBox.setGeometry(QtCore.QRect(200, 80, 71, 23))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.allowCheckBox.sizePolicy().hasHeightForWidth())
self.allowCheckBox.setSizePolicy(sizePolicy)
self.allowCheckBox.setObjectName("allowCheckBox")
self.addressEdit = QtGui.QLineEdit(self.groupBox)
self.addressEdit.setGeometry(QtCore.QRect(10, 30, 171, 27))
self.addressEdit = QtGui.QLineEdit(NewFwRuleDlg)
self.addressEdit.setGeometry(QtCore.QRect(70, 10, 301, 27))
self.addressEdit.setObjectName("addressEdit")
self.label_4 = QtGui.QLabel(self.groupBox)
self.label_4.setGeometry(QtCore.QRect(10, 62, 31, 21))
self.label_4 = QtGui.QLabel(NewFwRuleDlg)
self.label_4.setGeometry(QtCore.QRect(10, 44, 61, 21))
self.label_4.setObjectName("label_4")
self.label_5 = QtGui.QLabel(self.groupBox)
self.label_5.setGeometry(QtCore.QRect(123, 62, 16, 21))
self.label_5.setObjectName("label_5")
self.netmaskComboBox = QtGui.QComboBox(self.groupBox)
self.netmaskComboBox.setGeometry(QtCore.QRect(190, 30, 84, 27))
self.netmaskComboBox.setObjectName("netmaskComboBox")
self.portBeginSpinBox = QtGui.QSpinBox(self.groupBox)
self.portBeginSpinBox.setGeometry(QtCore.QRect(50, 60, 71, 27))
self.portBeginSpinBox.setMaximum(65535)
self.portBeginSpinBox.setProperty("value", 0)
self.portBeginSpinBox.setObjectName("portBeginSpinBox")
self.portEndSpinBox = QtGui.QSpinBox(self.groupBox)
self.portEndSpinBox.setGeometry(QtCore.QRect(130, 60, 71, 27))
self.portEndSpinBox.setMaximum(65535)
self.portEndSpinBox.setObjectName("portEndSpinBox")
self.nameEdit = QtGui.QLineEdit(NewFwRuleDlg)
self.nameEdit.setGeometry(QtCore.QRect(60, 4, 241, 27))
self.nameEdit.setObjectName("nameEdit")
self.serviceComboBox = QtGui.QComboBox(NewFwRuleDlg)
self.serviceComboBox.setGeometry(QtCore.QRect(70, 40, 301, 27))
self.serviceComboBox.setEditable(True)
self.serviceComboBox.setObjectName("serviceComboBox")
self.retranslateUi(NewFwRuleDlg)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), NewFwRuleDlg.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), NewFwRuleDlg.reject)
QtCore.QMetaObject.connectSlotsByName(NewFwRuleDlg)
NewFwRuleDlg.setTabOrder(self.nameEdit, self.addressEdit)
NewFwRuleDlg.setTabOrder(self.addressEdit, self.netmaskComboBox)
NewFwRuleDlg.setTabOrder(self.netmaskComboBox, self.portBeginSpinBox)
NewFwRuleDlg.setTabOrder(self.portBeginSpinBox, self.portEndSpinBox)
NewFwRuleDlg.setTabOrder(self.portEndSpinBox, self.allowCheckBox)
NewFwRuleDlg.setTabOrder(self.allowCheckBox, self.buttonBox)
NewFwRuleDlg.setTabOrder(self.addressEdit, self.serviceComboBox)
NewFwRuleDlg.setTabOrder(self.serviceComboBox, self.buttonBox)
def retranslateUi(self, NewFwRuleDlg):
NewFwRuleDlg.setWindowTitle(QtGui.QApplication.translate("NewFwRuleDlg", "New Firewall Rule", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Name", None, QtGui.QApplication.UnicodeUTF8))
NewFwRuleDlg.setWindowTitle(QtGui.QApplication.translate("NewFwRuleDlg", "New Address", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Address", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Netmask", None, QtGui.QApplication.UnicodeUTF8))
self.allowCheckBox.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Allow", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Port", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("NewFwRuleDlg", "-", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("NewFwRuleDlg", "Service", None, QtGui.QApplication.UnicodeUTF8))