12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #!/usr/bin/python3
- # -*- coding: utf-8 -*-
- import sys
- from portscan import PortScan
- from PyQt4 import QtGui, QtCore
- class MainClass(QtGui.QMainWindow):
-
- def __init__(self):
- super(MainClass, self).__init__()
-
- self.initUI()
-
- def initUI(self):
-
- self.resize(500,300)
- self.center()
- self.setWindowTitle('FDN - VPN configuration generator')
- self.statusBar().showMessage('Ready')
- qbtn = QtGui.QPushButton('Quit', self)
- qbtn.clicked.connect(QtCore.QCoreApplication.instance().quit)
- qbtn.resize(qbtn.sizeHint())
- resbox = QtGui.QLabel(PortScan.portscan())
- hbox = QtGui.QHBoxLayout()
- hbox.addStretch(3)
- hbox.addWidget(qbtn)
- hbox.addWidget(resbox)
- vbox = QtGui.QVBoxLayout()
- vbox.addStretch(1)
- vbox.addLayout(hbox)
- self.setLayout(vbox)
- self.show()
- def center(self):
-
- qr = self.frameGeometry()
- cp = QtGui.QDesktopWidget().availableGeometry().center()
- qr.moveCenter(cp)
- self.move(qr.topLeft())
-
-
- def main():
-
- app = QtGui.QApplication(sys.argv)
- ex = MainClass()
- sys.exit(app.exec_())
- if __name__ == '__main__':
- main()
|