1.1 --- a/OpenSecurity/bin/ui/Makefile Mon Mar 31 12:37:59 2014 +0200
1.2 +++ b/OpenSecurity/bin/ui/Makefile Mon Mar 31 12:51:16 2014 +0200
1.3 @@ -3,7 +3,8 @@
1.4 UI= \
1.5 ui_AboutDialog.py \
1.6 ui_ConfigureDialog.py \
1.7 - ui_CredentialsDialog.py
1.8 + ui_CredentialsDialog.py \
1.9 + ui_PasswordDialog.py
1.10
1.11 RC= \
1.12 opensecurity_rc.py
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/OpenSecurity/bin/ui/PasswordDialog.ui Mon Mar 31 12:51:16 2014 +0200
2.3 @@ -0,0 +1,152 @@
2.4 +<?xml version="1.0" encoding="UTF-8"?>
2.5 +<ui version="4.0">
2.6 + <class>PasswordDialog</class>
2.7 + <widget class="QDialog" name="PasswordDialog">
2.8 + <property name="geometry">
2.9 + <rect>
2.10 + <x>0</x>
2.11 + <y>0</y>
2.12 + <width>420</width>
2.13 + <height>120</height>
2.14 + </rect>
2.15 + </property>
2.16 + <property name="sizePolicy">
2.17 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
2.18 + <horstretch>0</horstretch>
2.19 + <verstretch>0</verstretch>
2.20 + </sizepolicy>
2.21 + </property>
2.22 + <property name="windowTitle">
2.23 + <string>OpenSecuirty Password Request</string>
2.24 + </property>
2.25 + <property name="windowIcon">
2.26 + <iconset resource="opensecurity.qrc">
2.27 + <normaloff>:/opensecurity/gfx/opensecurity_icon_64.png</normaloff>:/opensecurity/gfx/opensecurity_icon_64.png</iconset>
2.28 + </property>
2.29 + <layout class="QVBoxLayout" name="verticalLayout">
2.30 + <item>
2.31 + <layout class="QHBoxLayout" name="lyContent">
2.32 + <property name="spacing">
2.33 + <number>16</number>
2.34 + </property>
2.35 + <item>
2.36 + <widget class="QLabel" name="lblIcon">
2.37 + <property name="text">
2.38 + <string/>
2.39 + </property>
2.40 + <property name="pixmap">
2.41 + <pixmap resource="opensecurity.qrc">:/opensecurity/gfx/opensecurity_icon_64.png</pixmap>
2.42 + </property>
2.43 + <property name="alignment">
2.44 + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
2.45 + </property>
2.46 + </widget>
2.47 + </item>
2.48 + <item>
2.49 + <layout class="QGridLayout" name="lyCredentials" rowstretch="0,0,0" columnstretch="0,0">
2.50 + <property name="spacing">
2.51 + <number>4</number>
2.52 + </property>
2.53 + <item row="1" column="1">
2.54 + <widget class="QLineEdit" name="edtPassword">
2.55 + <property name="echoMode">
2.56 + <enum>QLineEdit::Password</enum>
2.57 + </property>
2.58 + </widget>
2.59 + </item>
2.60 + <item row="0" column="0" colspan="2">
2.61 + <widget class="QLabel" name="lblText">
2.62 + <property name="text">
2.63 + <string>TextLabel</string>
2.64 + </property>
2.65 + </widget>
2.66 + </item>
2.67 + <item row="2" column="0" colspan="2">
2.68 + <widget class="QWidget" name="wdCredentialsSpacer" native="true"/>
2.69 + </item>
2.70 + <item row="1" column="0">
2.71 + <widget class="QLabel" name="lblPassword">
2.72 + <property name="text">
2.73 + <string>&Password:</string>
2.74 + </property>
2.75 + <property name="buddy">
2.76 + <cstring>edtPassword</cstring>
2.77 + </property>
2.78 + </widget>
2.79 + </item>
2.80 + </layout>
2.81 + </item>
2.82 + </layout>
2.83 + </item>
2.84 + <item>
2.85 + <layout class="QHBoxLayout" name="lyButtons">
2.86 + <item>
2.87 + <spacer name="spButtons">
2.88 + <property name="orientation">
2.89 + <enum>Qt::Horizontal</enum>
2.90 + </property>
2.91 + <property name="sizeHint" stdset="0">
2.92 + <size>
2.93 + <width>40</width>
2.94 + <height>20</height>
2.95 + </size>
2.96 + </property>
2.97 + </spacer>
2.98 + </item>
2.99 + <item>
2.100 + <widget class="QPushButton" name="btnAbout">
2.101 + <property name="minimumSize">
2.102 + <size>
2.103 + <width>100</width>
2.104 + <height>0</height>
2.105 + </size>
2.106 + </property>
2.107 + <property name="text">
2.108 + <string>&About</string>
2.109 + </property>
2.110 + </widget>
2.111 + </item>
2.112 + <item>
2.113 + <widget class="QPushButton" name="btnCancel">
2.114 + <property name="minimumSize">
2.115 + <size>
2.116 + <width>100</width>
2.117 + <height>0</height>
2.118 + </size>
2.119 + </property>
2.120 + <property name="text">
2.121 + <string>&Cancel</string>
2.122 + </property>
2.123 + </widget>
2.124 + </item>
2.125 + <item>
2.126 + <widget class="QPushButton" name="btnOk">
2.127 + <property name="minimumSize">
2.128 + <size>
2.129 + <width>100</width>
2.130 + <height>0</height>
2.131 + </size>
2.132 + </property>
2.133 + <property name="text">
2.134 + <string>&Ok</string>
2.135 + </property>
2.136 + <property name="default">
2.137 + <bool>true</bool>
2.138 + </property>
2.139 + </widget>
2.140 + </item>
2.141 + </layout>
2.142 + </item>
2.143 + </layout>
2.144 + </widget>
2.145 + <tabstops>
2.146 + <tabstop>edtPassword</tabstop>
2.147 + <tabstop>btnAbout</tabstop>
2.148 + <tabstop>btnCancel</tabstop>
2.149 + <tabstop>btnOk</tabstop>
2.150 + </tabstops>
2.151 + <resources>
2.152 + <include location="opensecurity.qrc"/>
2.153 + </resources>
2.154 + <connections/>
2.155 +</ui>
3.1 --- a/OpenSecurity/bin/ui/about.py Mon Mar 31 12:37:59 2014 +0200
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,152 +0,0 @@
3.4 -#!/bin/env python
3.5 -# -*- coding: utf-8 -*-
3.6 -
3.7 -# ------------------------------------------------------------
3.8 -# about-dialog
3.9 -#
3.10 -# tell the user about the project
3.11 -#
3.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
3.13 -#
3.14 -# Copyright (C) 2013 AIT Austrian Institute of Technology
3.15 -# AIT Austrian Institute of Technology GmbH
3.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
3.17 -# http://www.ait.ac.at
3.18 -#
3.19 -# This program is free software; you can redistribute it and/or
3.20 -# modify it under the terms of the GNU General Public License
3.21 -# as published by the Free Software Foundation version 2.
3.22 -#
3.23 -# This program is distributed in the hope that it will be useful,
3.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
3.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.26 -# GNU General Public License for more details.
3.27 -#
3.28 -# You should have received a copy of the GNU General Public License
3.29 -# along with this program; if not, write to the Free Software
3.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
3.31 -# Boston, MA 02110-1301, USA.
3.32 -# ------------------------------------------------------------
3.33 -
3.34 -
3.35 -# ------------------------------------------------------------
3.36 -# imports
3.37 -
3.38 -import os
3.39 -
3.40 -from PyQt4 import QtCore
3.41 -from PyQt4 import QtGui
3.42 -
3.43 -# local
3.44 -from environment import Environment
3.45 -
3.46 -
3.47 -# ------------------------------------------------------------
3.48 -# vars
3.49 -
3.50 -
3.51 -ABOUT_TEXT = """
3.52 -<html>
3.53 -
3.54 -<style type="text/css">
3.55 - .header { margin-bottom: 24px; }
3.56 - .about_text { margin-bottom: 100px; margin-left: 64px; margin-right: 64px; }
3.57 - .logo { vertical-align: top; margin-bottom: 24px; }
3.58 - .footer { margin-top: 100px; }
3.59 -</style>
3.60 -
3.61 -<body bgcolor="#FFFFFF">
3.62 -<div align="center">
3.63 -
3.64 -<h1 class="header">
3.65 - <a href="http://www.opensecurity.at"><img src="image:opensecurity_logo.jpg"/></a><br/><br/>
3.66 - OpenSecurity Demo V0.1
3.67 -</h1>
3.68 -
3.69 -<div class="about_text" align="justify">
3.70 - Blah ...<br/>
3.71 -</div>
3.72 -
3.73 -<div class="logo">
3.74 - <a href="http://www.ait.ac.at"><img src="image:ait_logo_no_claim.png"/></a>
3.75 - <a href="http://www.x-net.at"><img src="image:x-net_logo.jpg"/></a>
3.76 - <a href="http://www.ikarussecurity.com"><img src="image:ikarus_logo.jpg"/></a>
3.77 -</div>
3.78 -
3.79 -<div class="logo">
3.80 - <a href="http://www.liqua.net"><img src="image:liqua_logo.jpg"/></a>
3.81 - <a href="http://www.linz.at"><img src="image:linz_logo.jpg"/></a>
3.82 - <a href="http://www.bmvit.gv.at"><img src="image:bmvit_logo.jpg"/></a>
3.83 -</div>
3.84 -
3.85 -<div class="logo">
3.86 - <a href="http://www.ffg.at"><img src="image:ffg_logo.jpg"/></a>
3.87 - <a href="http://www.kiras.at"><img src="image:kiras_logo.jpg"/></a>
3.88 -</div>
3.89 -
3.90 -<div class="footer" align="left">
3.91 - Copyright (C) 2013, AIT Austrian Institute of Technology<br/>
3.92 - AIT Austrian Institute of Technology GmbH<br/>
3.93 - Donau-City-Strasse 1 | 1220 Vienna | Austria<br/>
3.94 - <a href="http://www.ait.ac.at">http://www.ait.ac.at</a>
3.95 -</div>
3.96 -
3.97 -</div>
3.98 -</body>
3.99 -</html>
3.100 -""";
3.101 -
3.102 -
3.103 -# ------------------------------------------------------------
3.104 -# code
3.105 -
3.106 -
3.107 -class About(QtGui.QDialog):
3.108 -
3.109 - """Show some about stuff."""
3.110 -
3.111 - def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags(0)):
3.112 -
3.113 - # super call and widget init
3.114 - super(About, self).__init__(parent, flags)
3.115 -
3.116 - # setup image search path
3.117 - QtCore.QDir.setSearchPaths("image", QtCore.QStringList(os.path.join(Environment('opensecurity').data_path, 'gfx')));
3.118 -
3.119 - self.setWindowTitle('About OpenSecurity ...')
3.120 - self.setup_ui()
3.121 -
3.122 -
3.123 - def setup_ui(self):
3.124 -
3.125 - """Create the widgets."""
3.126 -
3.127 - lyMain = QtGui.QVBoxLayout(self)
3.128 - lyMain.setContentsMargins(8, 8, 8, 8)
3.129 -
3.130 - lbAbout = QtGui.QLabel()
3.131 - lbAbout.setStyleSheet("QWidget { background: white; color: black; };")
3.132 - lbAbout.setText(ABOUT_TEXT)
3.133 - lbAbout.setContentsMargins(12, 12, 12, 12)
3.134 -
3.135 - scAbout = QtGui.QScrollArea()
3.136 - scAbout.setWidget(lbAbout)
3.137 - scAbout.viewport().setStyleSheet("QWidget { background: white; color: black; };")
3.138 - lyMain.addWidget(scAbout)
3.139 -
3.140 - # buttons
3.141 - lyButton = QtGui.QHBoxLayout()
3.142 - lyMain.addLayout(lyButton)
3.143 -
3.144 - lyButton.addStretch(1)
3.145 - btnOk = QtGui.QPushButton('&Ok', self)
3.146 - btnOk.setMinimumWidth(100)
3.147 - lyButton.addWidget(btnOk)
3.148 -
3.149 - # connectors
3.150 - btnOk.clicked.connect(self.accept)
3.151 -
3.152 - # reduce to the max
3.153 - self.setMinimumSize(600, 400)
3.154 - self.resize(lyMain.minimumSize())
3.155 -
4.1 --- a/OpenSecurity/bin/ui/about_dialog.py Mon Mar 31 12:37:59 2014 +0200
4.2 +++ b/OpenSecurity/bin/ui/about_dialog.py Mon Mar 31 12:51:16 2014 +0200
4.3 @@ -1,1 +1,135 @@
4.4 -about_dialog.pyw
4.5 \ No newline at end of file
4.6 +#!/bin/env python
4.7 +# -*- coding: utf-8 -*-
4.8 +
4.9 +# ------------------------------------------------------------
4.10 +# about_dialog.pyw
4.11 +#
4.12 +# something about OpenSecurity
4.13 +#
4.14 +# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
4.15 +#
4.16 +# Copyright (C) 2014 AIT Austrian Institute of Technology
4.17 +# AIT Austrian Institute of Technology GmbH
4.18 +# Donau-City-Strasse 1 | 1220 Vienna | Austria
4.19 +# http://www.ait.ac.at
4.20 +#
4.21 +# This program is free software; you can redistribute it and/or
4.22 +# modify it under the terms of the GNU General Public License
4.23 +# as published by the Free Software Foundation version 2.
4.24 +#
4.25 +# This program is distributed in the hope that it will be useful,
4.26 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
4.27 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.28 +# GNU General Public License for more details.
4.29 +#
4.30 +# You should have received a copy of the GNU General Public License
4.31 +# along with this program; if not, write to the Free Software
4.32 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
4.33 +# Boston, MA 02110-1301, USA.
4.34 +# ------------------------------------------------------------
4.35 +
4.36 +
4.37 +# ------------------------------------------------------------
4.38 +# imports
4.39 +
4.40 +import sys
4.41 +
4.42 +from PyQt4 import QtCore
4.43 +from PyQt4 import QtGui
4.44 +
4.45 +from ui_AboutDialog import Ui_AboutDialog
4.46 +
4.47 +
4.48 +# ------------------------------------------------------------
4.49 +# code
4.50 +
4.51 +
4.52 +ABOUT_TEXT = """
4.53 +<html>
4.54 +
4.55 +<head>
4.56 +
4.57 +<style type="text/css">
4.58 + .about_text { margin-bottom: 100px; margin-left: 64px; margin-right: 64px; }
4.59 + .logo { vertical-align: middle; margin-bottom: 24px; }
4.60 + .footer { margin-top: 100px; }
4.61 +</style>
4.62 +
4.63 +</head>
4.64 +
4.65 +<body bgcolor="#FFFFFF">
4.66 +
4.67 +<div align="center">
4.68 +
4.69 +<h1 class="header">
4.70 + <a href="http://www.opensecurity.at"><img src=":/opensecurity/gfx/opensecurity_logo.jpg"/></a><br/><br/>
4.71 + OpenSecurity V0.2.3
4.72 +</h1>
4.73 +
4.74 +<div class="about_text" align="justify">
4.75 + Blah ...<br/>
4.76 +</div>
4.77 +
4.78 +<div class="logo">
4.79 + <a href="http://www.ait.ac.at"><img src=":/opensecurity/gfx/ait_logo_no_claim.png"/></a>
4.80 + <a href="http://www.x-net.at"><img src=":/opensecurity/gfx/x-net_logo.jpg"/></a>
4.81 + <a href="http://www.ikarussecurity.com"><img src=":/opensecurity/gfx/ikarus_logo.jpg"/></a>
4.82 +</div>
4.83 +
4.84 +<div class="logo">
4.85 + <a href="http://www.liqua.net"><img src=":/opensecurity/gfx/liqua_logo.jpg"/></a>
4.86 + <a href="http://www.linz.at"><img src=":/opensecurity/gfx/linz_logo.jpg"/></a>
4.87 + <a href="http://www.bmvit.gv.at"><img src=":/opensecurity/gfx/bmvit_logo.jpg"/></a>
4.88 +</div>
4.89 +
4.90 +<div class="logo">
4.91 + <a href="http://www.ffg.at"><img src=":/opensecurity/gfx/ffg_logo.jpg"/></a>
4.92 + <a href="http://www.kiras.at"><img src=":/opensecurity/gfx/kiras_logo.jpg"/></a>
4.93 +</div>
4.94 +
4.95 +<div class="footer" align="left">
4.96 + Copyright (C) 2013, 2014 AIT Austrian Institute of Technology<br/>
4.97 + AIT Austrian Institute of Technology GmbH<br/>
4.98 + Donau-City-Strasse 1 | 1220 Vienna | Austria<br/>
4.99 + <a href="http://www.ait.ac.at">http://www.ait.ac.at</a>
4.100 +</div>
4.101 +
4.102 +</div>
4.103 +</body>
4.104 +</html>
4.105 +""";
4.106 +
4.107 +
4.108 +# ------------------------------------------------------------
4.109 +# code
4.110 +
4.111 +
4.112 +class AboutDialog(QtGui.QDialog):
4.113 +
4.114 + """A dialog which shows some information about the OpenSecurity project"""
4.115 +
4.116 + def __init__(self):
4.117 +
4.118 + QtGui.QDialog.__init__(self)
4.119 +
4.120 + # setup the user interface
4.121 + self.ui = Ui_AboutDialog()
4.122 + self.ui.setupUi(self)
4.123 +
4.124 + # fix the scroll area content
4.125 + self.ui.lblAbout = QtGui.QLabel(ABOUT_TEXT)
4.126 + self.ui.lblAbout.setContentsMargins(16, 16, 16, 16)
4.127 + self.ui.lblAbout.setStyleSheet(self.ui.scrAboutContent.styleSheet())
4.128 + self.ui.scrAbout.setWidget(self.ui.lblAbout)
4.129 +
4.130 + # connectors
4.131 + self.ui.btnOk.clicked.connect(self.accept)
4.132 + self.ui.lblAbout.setText(ABOUT_TEXT)
4.133 +
4.134 +
4.135 +if __name__ == "__main__":
4.136 + a = QtGui.QApplication(sys.argv)
4.137 + d = AboutDialog()
4.138 + d.show()
4.139 + sys.exit(a.exec_())
4.140 +
5.1 --- a/OpenSecurity/bin/ui/about_dialog.pyw Mon Mar 31 12:37:59 2014 +0200
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,135 +0,0 @@
5.4 -#!/bin/env python
5.5 -# -*- coding: utf-8 -*-
5.6 -
5.7 -# ------------------------------------------------------------
5.8 -# about_dialog.pyw
5.9 -#
5.10 -# something about OpenSecurity
5.11 -#
5.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
5.13 -#
5.14 -# Copyright (C) 2014 AIT Austrian Institute of Technology
5.15 -# AIT Austrian Institute of Technology GmbH
5.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
5.17 -# http://www.ait.ac.at
5.18 -#
5.19 -# This program is free software; you can redistribute it and/or
5.20 -# modify it under the terms of the GNU General Public License
5.21 -# as published by the Free Software Foundation version 2.
5.22 -#
5.23 -# This program is distributed in the hope that it will be useful,
5.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
5.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.26 -# GNU General Public License for more details.
5.27 -#
5.28 -# You should have received a copy of the GNU General Public License
5.29 -# along with this program; if not, write to the Free Software
5.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
5.31 -# Boston, MA 02110-1301, USA.
5.32 -# ------------------------------------------------------------
5.33 -
5.34 -
5.35 -# ------------------------------------------------------------
5.36 -# imports
5.37 -
5.38 -import sys
5.39 -
5.40 -from PyQt4 import QtCore
5.41 -from PyQt4 import QtGui
5.42 -
5.43 -from ui_AboutDialog import Ui_AboutDialog
5.44 -
5.45 -
5.46 -# ------------------------------------------------------------
5.47 -# code
5.48 -
5.49 -
5.50 -ABOUT_TEXT = """
5.51 -<html>
5.52 -
5.53 -<head>
5.54 -
5.55 -<style type="text/css">
5.56 - .about_text { margin-bottom: 100px; margin-left: 64px; margin-right: 64px; }
5.57 - .logo { vertical-align: middle; margin-bottom: 24px; }
5.58 - .footer { margin-top: 100px; }
5.59 -</style>
5.60 -
5.61 -</head>
5.62 -
5.63 -<body bgcolor="#FFFFFF">
5.64 -
5.65 -<div align="center">
5.66 -
5.67 -<h1 class="header">
5.68 - <a href="http://www.opensecurity.at"><img src=":/opensecurity/gfx/opensecurity_logo.jpg"/></a><br/><br/>
5.69 - OpenSecurity V0.2.3
5.70 -</h1>
5.71 -
5.72 -<div class="about_text" align="justify">
5.73 - Blah ...<br/>
5.74 -</div>
5.75 -
5.76 -<div class="logo">
5.77 - <a href="http://www.ait.ac.at"><img src=":/opensecurity/gfx/ait_logo_no_claim.png"/></a>
5.78 - <a href="http://www.x-net.at"><img src=":/opensecurity/gfx/x-net_logo.jpg"/></a>
5.79 - <a href="http://www.ikarussecurity.com"><img src=":/opensecurity/gfx/ikarus_logo.jpg"/></a>
5.80 -</div>
5.81 -
5.82 -<div class="logo">
5.83 - <a href="http://www.liqua.net"><img src=":/opensecurity/gfx/liqua_logo.jpg"/></a>
5.84 - <a href="http://www.linz.at"><img src=":/opensecurity/gfx/linz_logo.jpg"/></a>
5.85 - <a href="http://www.bmvit.gv.at"><img src=":/opensecurity/gfx/bmvit_logo.jpg"/></a>
5.86 -</div>
5.87 -
5.88 -<div class="logo">
5.89 - <a href="http://www.ffg.at"><img src=":/opensecurity/gfx/ffg_logo.jpg"/></a>
5.90 - <a href="http://www.kiras.at"><img src=":/opensecurity/gfx/kiras_logo.jpg"/></a>
5.91 -</div>
5.92 -
5.93 -<div class="footer" align="left">
5.94 - Copyright (C) 2013, 2014 AIT Austrian Institute of Technology<br/>
5.95 - AIT Austrian Institute of Technology GmbH<br/>
5.96 - Donau-City-Strasse 1 | 1220 Vienna | Austria<br/>
5.97 - <a href="http://www.ait.ac.at">http://www.ait.ac.at</a>
5.98 -</div>
5.99 -
5.100 -</div>
5.101 -</body>
5.102 -</html>
5.103 -""";
5.104 -
5.105 -
5.106 -# ------------------------------------------------------------
5.107 -# code
5.108 -
5.109 -
5.110 -class AboutDialog(QtGui.QDialog):
5.111 -
5.112 - """A dialog which shows some information about the OpenSecurity project"""
5.113 -
5.114 - def __init__(self):
5.115 -
5.116 - QtGui.QDialog.__init__(self)
5.117 -
5.118 - # setup the user interface
5.119 - self.ui = Ui_AboutDialog()
5.120 - self.ui.setupUi(self)
5.121 -
5.122 - # fix the scroll area content
5.123 - self.ui.lblAbout = QtGui.QLabel(ABOUT_TEXT)
5.124 - self.ui.lblAbout.setContentsMargins(16, 16, 16, 16)
5.125 - self.ui.lblAbout.setStyleSheet(self.ui.scrAboutContent.styleSheet())
5.126 - self.ui.scrAbout.setWidget(self.ui.lblAbout)
5.127 -
5.128 - # connectors
5.129 - self.ui.btnOk.clicked.connect(self.accept)
5.130 - self.ui.lblAbout.setText(ABOUT_TEXT)
5.131 -
5.132 -
5.133 -if __name__ == "__main__":
5.134 - a = QtGui.QApplication(sys.argv)
5.135 - d = AboutDialog()
5.136 - d.show()
5.137 - sys.exit(a.exec_())
5.138 -
6.1 --- a/OpenSecurity/bin/ui/configure_dialog.py Mon Mar 31 12:37:59 2014 +0200
6.2 +++ b/OpenSecurity/bin/ui/configure_dialog.py Mon Mar 31 12:51:16 2014 +0200
6.3 @@ -1,1 +1,101 @@
6.4 -configure_dialog.pyw
6.5 \ No newline at end of file
6.6 +#!/bin/env python
6.7 +# -*- coding: utf-8 -*-
6.8 +
6.9 +# ------------------------------------------------------------
6.10 +# configure_dialog.pyw
6.11 +#
6.12 +# let the user configure the opensecurity system
6.13 +#
6.14 +# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
6.15 +#
6.16 +# Copyright (C) 2014 AIT Austrian Institute of Technology
6.17 +# AIT Austrian Institute of Technology GmbH
6.18 +# Donau-City-Strasse 1 | 1220 Vienna | Austria
6.19 +# http://www.ait.ac.at
6.20 +#
6.21 +# This program is free software; you can redistribute it and/or
6.22 +# modify it under the terms of the GNU General Public License
6.23 +# as published by the Free Software Foundation version 2.
6.24 +#
6.25 +# This program is distributed in the hope that it will be useful,
6.26 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
6.27 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.28 +# GNU General Public License for more details.
6.29 +#
6.30 +# You should have received a copy of the GNU General Public License
6.31 +# along with this program; if not, write to the Free Software
6.32 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
6.33 +# Boston, MA 02110-1301, USA.
6.34 +# ------------------------------------------------------------
6.35 +
6.36 +
6.37 +# ------------------------------------------------------------
6.38 +# imports
6.39 +
6.40 +import sys
6.41 +
6.42 +from PyQt4 import QtCore
6.43 +from PyQt4 import QtGui
6.44 +
6.45 +from ui_ConfigureDialog import Ui_ConfigureDialog
6.46 +from about_dialog import AboutDialog
6.47 +
6.48 +
6.49 +# ------------------------------------------------------------
6.50 +# code
6.51 +
6.52 +
6.53 +class ConfigureDialog(QtGui.QDialog):
6.54 +
6.55 + """A dialog which lets the user configure the OpenSecurity Subsystem"""
6.56 +
6.57 + def __init__(self):
6.58 +
6.59 + QtGui.QDialog.__init__(self)
6.60 +
6.61 + # setup the user interface
6.62 + self.ui = Ui_ConfigureDialog()
6.63 + self.ui.setupUi(self)
6.64 +
6.65 + # local members
6.66 + self._about_dialog = AboutDialog()
6.67 +
6.68 + # connectors
6.69 + self.ui.btnAbout.clicked.connect(self.clicked_about)
6.70 + self.ui.btnClose.clicked.connect(self.accept)
6.71 + self.ui.btnDownload.clicked.connect(self.clicked_download)
6.72 + self.ui.btnImport.clicked.connect(self.clicked_import)
6.73 + self.ui.btnRefresh.clicked.connect(self.clicked_refresh)
6.74 +
6.75 +
6.76 + def clicked_about(self):
6.77 +
6.78 + """About button has been clicked."""
6.79 + self._about_dialog.show()
6.80 +
6.81 +
6.82 + def clicked_download(self):
6.83 +
6.84 + """Download button has been clicked."""
6.85 + print('clicked_download()')
6.86 +
6.87 +
6.88 + def clicked_import(self):
6.89 +
6.90 + """Import button has been clicked."""
6.91 + print('clicked_import()')
6.92 +
6.93 +
6.94 + def clicked_refresh(self):
6.95 +
6.96 + """Refresh button has been clicked."""
6.97 + print('clicked_refresh()')
6.98 +
6.99 +
6.100 +
6.101 +if __name__ == "__main__":
6.102 + a = QtGui.QApplication(sys.argv)
6.103 + d = ConfigureDialog()
6.104 + d.show()
6.105 + sys.exit(a.exec_())
6.106 +
7.1 --- a/OpenSecurity/bin/ui/configure_dialog.pyw Mon Mar 31 12:37:59 2014 +0200
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,101 +0,0 @@
7.4 -#!/bin/env python
7.5 -# -*- coding: utf-8 -*-
7.6 -
7.7 -# ------------------------------------------------------------
7.8 -# configure_dialog.pyw
7.9 -#
7.10 -# let the user configure the opensecurity system
7.11 -#
7.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
7.13 -#
7.14 -# Copyright (C) 2014 AIT Austrian Institute of Technology
7.15 -# AIT Austrian Institute of Technology GmbH
7.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
7.17 -# http://www.ait.ac.at
7.18 -#
7.19 -# This program is free software; you can redistribute it and/or
7.20 -# modify it under the terms of the GNU General Public License
7.21 -# as published by the Free Software Foundation version 2.
7.22 -#
7.23 -# This program is distributed in the hope that it will be useful,
7.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
7.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.26 -# GNU General Public License for more details.
7.27 -#
7.28 -# You should have received a copy of the GNU General Public License
7.29 -# along with this program; if not, write to the Free Software
7.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
7.31 -# Boston, MA 02110-1301, USA.
7.32 -# ------------------------------------------------------------
7.33 -
7.34 -
7.35 -# ------------------------------------------------------------
7.36 -# imports
7.37 -
7.38 -import sys
7.39 -
7.40 -from PyQt4 import QtCore
7.41 -from PyQt4 import QtGui
7.42 -
7.43 -from ui_ConfigureDialog import Ui_ConfigureDialog
7.44 -from about_dialog import AboutDialog
7.45 -
7.46 -
7.47 -# ------------------------------------------------------------
7.48 -# code
7.49 -
7.50 -
7.51 -class ConfigureDialog(QtGui.QDialog):
7.52 -
7.53 - """A dialog which lets the user configure the OpenSecurity Subsystem"""
7.54 -
7.55 - def __init__(self):
7.56 -
7.57 - QtGui.QDialog.__init__(self)
7.58 -
7.59 - # setup the user interface
7.60 - self.ui = Ui_ConfigureDialog()
7.61 - self.ui.setupUi(self)
7.62 -
7.63 - # local members
7.64 - self._about_dialog = AboutDialog()
7.65 -
7.66 - # connectors
7.67 - self.ui.btnAbout.clicked.connect(self.clicked_about)
7.68 - self.ui.btnClose.clicked.connect(self.accept)
7.69 - self.ui.btnDownload.clicked.connect(self.clicked_download)
7.70 - self.ui.btnImport.clicked.connect(self.clicked_import)
7.71 - self.ui.btnRefresh.clicked.connect(self.clicked_refresh)
7.72 -
7.73 -
7.74 - def clicked_about(self):
7.75 -
7.76 - """About button has been clicked."""
7.77 - self._about_dialog.show()
7.78 -
7.79 -
7.80 - def clicked_download(self):
7.81 -
7.82 - """Download button has been clicked."""
7.83 - print('clicked_download()')
7.84 -
7.85 -
7.86 - def clicked_import(self):
7.87 -
7.88 - """Import button has been clicked."""
7.89 - print('clicked_import()')
7.90 -
7.91 -
7.92 - def clicked_refresh(self):
7.93 -
7.94 - """Refresh button has been clicked."""
7.95 - print('clicked_refresh()')
7.96 -
7.97 -
7.98 -
7.99 -if __name__ == "__main__":
7.100 - a = QtGui.QApplication(sys.argv)
7.101 - d = ConfigureDialog()
7.102 - d.show()
7.103 - sys.exit(a.exec_())
7.104 -
8.1 --- a/OpenSecurity/bin/ui/credentials.py Mon Mar 31 12:37:59 2014 +0200
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,160 +0,0 @@
8.4 -#!/bin/env python
8.5 -# -*- coding: utf-8 -*-
8.6 -
8.7 -# ------------------------------------------------------------
8.8 -# credentials-dialog
8.9 -#
8.10 -# ask the user credentials
8.11 -#
8.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
8.13 -#
8.14 -# Copyright (C) 2013 AIT Austrian Institute of Technology
8.15 -# AIT Austrian Institute of Technology GmbH
8.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
8.17 -# http://www.ait.ac.at
8.18 -#
8.19 -# This program is free software; you can redistribute it and/or
8.20 -# modify it under the terms of the GNU General Public License
8.21 -# as published by the Free Software Foundation version 2.
8.22 -#
8.23 -# This program is distributed in the hope that it will be useful,
8.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
8.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8.26 -# GNU General Public License for more details.
8.27 -#
8.28 -# You should have received a copy of the GNU General Public License
8.29 -# along with this program; if not, write to the Free Software
8.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
8.31 -# Boston, MA 02110-1301, USA.
8.32 -# ------------------------------------------------------------
8.33 -
8.34 -
8.35 -# ------------------------------------------------------------
8.36 -# imports
8.37 -
8.38 -import sys
8.39 -
8.40 -from PyQt4 import QtCore
8.41 -from PyQt4 import QtGui
8.42 -
8.43 -# local
8.44 -from about import About
8.45 -
8.46 -# ------------------------------------------------------------
8.47 -# code
8.48 -
8.49 -
8.50 -class Credentials(QtGui.QDialog):
8.51 -
8.52 - """Ask the user for credentials."""
8.53 -
8.54 - def __init__(self, text, parent = None, flags = QtCore.Qt.WindowFlags(0)):
8.55 -
8.56 - super(Credentials, self).__init__(parent, flags)
8.57 - self.setWindowTitle('OpenSecuirty Credentials Request')
8.58 - self.setup_ui()
8.59 -
8.60 - # positionate ourself central
8.61 - screen = QtGui.QDesktopWidget().screenGeometry()
8.62 - self.resize(self.geometry().width() * 1.25, self.geometry().height())
8.63 - size = self.geometry()
8.64 - self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)
8.65 -
8.66 - # fix up text
8.67 - self.lbText.setText(text)
8.68 -
8.69 -
8.70 - def clicked_about(self):
8.71 - """clicked the about button"""
8.72 - dlgAbout = About()
8.73 - dlgAbout.exec_()
8.74 -
8.75 -
8.76 - def clicked_cancel(self):
8.77 - """clicked the cancel button"""
8.78 - self.reject()
8.79 -
8.80 -
8.81 - def clicked_ok(self):
8.82 - """clicked the ok button"""
8.83 - sys.stdout.write('{ ')
8.84 - sys.stdout.write('\'user\': \'')
8.85 - sys.stdout.write(self.edUser.text())
8.86 - sys.stdout.write('\', ')
8.87 - sys.stdout.write('\'password\': \'')
8.88 - sys.stdout.write(self.edPassword.text())
8.89 - sys.stdout.write('\' ')
8.90 - sys.stdout.write('}\n')
8.91 - self.accept()
8.92 -
8.93 -
8.94 - def setup_ui(self):
8.95 -
8.96 - """Create the widgets."""
8.97 -
8.98 - lyMain = QtGui.QVBoxLayout(self)
8.99 - lyMain.setContentsMargins(8, 8, 8, 8)
8.100 -
8.101 - # content area: left pixmap, right text
8.102 - lyContent = QtGui.QHBoxLayout()
8.103 - lyMain.addLayout(lyContent)
8.104 -
8.105 - # pixmap
8.106 - lbPix = QtGui.QLabel()
8.107 - lbPix.setPixmap(QtGui.QPixmapCache.find('opensecurity_icon_64'))
8.108 - lyContent.addWidget(lbPix, 0, QtCore.Qt.Alignment(QtCore.Qt.AlignTop + QtCore.Qt.AlignHCenter))
8.109 - lyContent.addSpacing(16)
8.110 -
8.111 - # text ...
8.112 - lyText = QtGui.QGridLayout()
8.113 - lyContent.addLayout(lyText, 1)
8.114 - self.lbText = QtGui.QLabel()
8.115 - lyText.addWidget(self.lbText, 0, 0, 1, 2)
8.116 -
8.117 - lbUser = QtGui.QLabel('&User:')
8.118 - lyText.addWidget(lbUser, 1, 0)
8.119 - self.edUser = QtGui.QLineEdit()
8.120 - lyText.addWidget(self.edUser, 1, 1)
8.121 - lbUser.setBuddy(self.edUser)
8.122 -
8.123 - lbPassword = QtGui.QLabel('&Password:')
8.124 - lyText.addWidget(lbPassword, 2, 0)
8.125 - self.edPassword = QtGui.QLineEdit()
8.126 - self.edPassword.setEchoMode(QtGui.QLineEdit.Password)
8.127 - lyText.addWidget(self.edPassword, 2, 1)
8.128 - lbPassword.setBuddy(self.edPassword)
8.129 -
8.130 - lyText.addWidget(QtGui.QWidget(), 3, 0, 1, 2)
8.131 - lyText.setColumnStretch(1, 1)
8.132 - lyText.setRowStretch(3, 1)
8.133 -
8.134 - lyMain.addStretch(1)
8.135 -
8.136 - # buttons
8.137 - lyButton = QtGui.QHBoxLayout()
8.138 - lyMain.addLayout(lyButton)
8.139 -
8.140 - lyButton.addStretch(1)
8.141 - btnOk = QtGui.QPushButton('&Ok', self)
8.142 - btnOk.setDefault(True)
8.143 - btnOk.setMinimumWidth(100)
8.144 - lyButton.addWidget(btnOk)
8.145 - btnCancel = QtGui.QPushButton('&Cancel', self)
8.146 - btnCancel.setMinimumWidth(100)
8.147 - lyButton.addWidget(btnCancel)
8.148 - btnAbout = QtGui.QPushButton('&About', self)
8.149 - btnAbout.setMinimumWidth(100)
8.150 - lyButton.addWidget(btnAbout)
8.151 -
8.152 - button_width = max(btnOk.width(), btnCancel.width(), btnAbout.width())
8.153 - btnOk.setMinimumWidth(button_width)
8.154 - btnCancel.setMinimumWidth(button_width)
8.155 - btnAbout.setMinimumWidth(button_width)
8.156 -
8.157 - # reduce to the max
8.158 - self.resize(lyMain.minimumSize())
8.159 -
8.160 - # connectors
8.161 - btnOk.clicked.connect(self.clicked_ok)
8.162 - btnCancel.clicked.connect(self.clicked_cancel)
8.163 - btnAbout.clicked.connect(self.clicked_about)
9.1 --- a/OpenSecurity/bin/ui/credentials_dialog.py Mon Mar 31 12:37:59 2014 +0200
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,1 +0,0 @@
9.4 -credentials_dialog.pyw
9.5 \ No newline at end of file
10.1 --- a/OpenSecurity/bin/ui/credentials_dialog.pyw Mon Mar 31 12:37:59 2014 +0200
10.2 +++ b/OpenSecurity/bin/ui/credentials_dialog.pyw Mon Mar 31 12:51:16 2014 +0200
10.3 @@ -66,6 +66,11 @@
10.4 self.ui.btnCancel.clicked.connect(self.reject)
10.5 self.ui.btnOk.clicked.connect(self.clicked_ok)
10.6
10.7 + # positionate ourself central
10.8 + screen = QtGui.QDesktopWidget().screenGeometry()
10.9 + size = self.geometry()
10.10 + self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)
10.11 +
10.12
10.13 def clicked_about(self):
10.14
11.1 --- a/OpenSecurity/bin/ui/launch.pyw Mon Mar 31 12:37:59 2014 +0200
11.2 +++ b/OpenSecurity/bin/ui/launch.pyw Mon Mar 31 12:51:16 2014 +0200
11.3 @@ -8,7 +8,7 @@
11.4 #
11.5 # Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
11.6 #
11.7 -# Copyright (C) 2013 AIT Austrian Institute of Technology
11.8 +# Copyright (C) 2013, 2014 AIT Austrian Institute of Technology
11.9 # AIT Austrian Institute of Technology GmbH
11.10 # Donau-City-Strasse 1 | 1220 Vienna | Austria
11.11 # http://www.ait.ac.at
12.1 --- a/OpenSecurity/bin/ui/password.py Mon Mar 31 12:37:59 2014 +0200
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,153 +0,0 @@
12.4 -#!/bin/env python
12.5 -# -*- coding: utf-8 -*-
12.6 -
12.7 -# ------------------------------------------------------------
12.8 -# password-dialog
12.9 -#
12.10 -# ask the user a password
12.11 -#
12.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
12.13 -#
12.14 -# Copyright (C) 2013 AIT Austrian Institute of Technology
12.15 -# AIT Austrian Institute of Technology GmbH
12.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
12.17 -# http://www.ait.ac.at
12.18 -#
12.19 -# This program is free software; you can redistribute it and/or
12.20 -# modify it under the terms of the GNU General Public License
12.21 -# as published by the Free Software Foundation version 2.
12.22 -#
12.23 -# This program is distributed in the hope that it will be useful,
12.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
12.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.26 -# GNU General Public License for more details.
12.27 -#
12.28 -# You should have received a copy of the GNU General Public License
12.29 -# along with this program; if not, write to the Free Software
12.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
12.31 -# Boston, MA 02110-1301, USA.
12.32 -# ------------------------------------------------------------
12.33 -
12.34 -
12.35 -# ------------------------------------------------------------
12.36 -# imports
12.37 -
12.38 -import sys
12.39 -
12.40 -from PyQt4 import QtCore
12.41 -from PyQt4 import QtGui
12.42 -
12.43 -# local
12.44 -from about import About
12.45 -
12.46 -
12.47 -# ------------------------------------------------------------
12.48 -# code
12.49 -
12.50 -
12.51 -class Password(QtGui.QDialog):
12.52 -
12.53 - """Ask the user for a password."""
12.54 -
12.55 - def __init__(self, text, parent = None, flags = QtCore.Qt.WindowFlags(0)):
12.56 -
12.57 - # super call and widget init
12.58 - super(Password, self).__init__(parent, flags)
12.59 - self.setWindowTitle('OpenSecuirty Password Request')
12.60 - self.setup_ui()
12.61 -
12.62 - # positionate ourself central
12.63 - screen = QtGui.QDesktopWidget().screenGeometry()
12.64 - self.resize(self.geometry().width() * 1.25, self.geometry().height())
12.65 - size = self.geometry()
12.66 - self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)
12.67 -
12.68 - # fix up text
12.69 - self.lbText.setText(text)
12.70 -
12.71 -
12.72 - def clicked_about(self):
12.73 - """clicked the about button"""
12.74 - dlgAbout = About()
12.75 - dlgAbout.exec_()
12.76 -
12.77 -
12.78 - def clicked_cancel(self):
12.79 - """clicked the cancel button"""
12.80 - self.reject()
12.81 -
12.82 -
12.83 - def clicked_ok(self):
12.84 - """clicked the ok button"""
12.85 - sys.stdout.write('{ ')
12.86 - sys.stdout.write('\'password\': \'')
12.87 - sys.stdout.write(self.edPassword.text())
12.88 - sys.stdout.write('\' ')
12.89 - sys.stdout.write('}\n')
12.90 - self.accept()
12.91 -
12.92 -
12.93 - def setup_ui(self):
12.94 -
12.95 - """Create the widgets."""
12.96 -
12.97 - lyMain = QtGui.QVBoxLayout(self)
12.98 - lyMain.setContentsMargins(8, 8, 8, 8)
12.99 -
12.100 - # content area: left pixmap, right text
12.101 - lyContent = QtGui.QHBoxLayout()
12.102 - lyMain.addLayout(lyContent)
12.103 -
12.104 - # pixmap
12.105 - lbPix = QtGui.QLabel()
12.106 - lbPix.setPixmap(QtGui.QPixmapCache.find('opensecurity_icon_64'))
12.107 - lyContent.addWidget(lbPix, 0, QtCore.Qt.Alignment(QtCore.Qt.AlignTop + QtCore.Qt.AlignHCenter))
12.108 - lyContent.addSpacing(16)
12.109 -
12.110 - # text ...
12.111 - lyText = QtGui.QVBoxLayout()
12.112 - lyContent.addLayout(lyText, 1)
12.113 - self.lbText = QtGui.QLabel()
12.114 - lyText.addWidget(self.lbText)
12.115 - lyPassword = QtGui.QHBoxLayout()
12.116 - lyText.addLayout(lyPassword)
12.117 - lbPassword = QtGui.QLabel('&Password:')
12.118 - lyPassword.addWidget(lbPassword)
12.119 - self.edPassword = QtGui.QLineEdit()
12.120 - self.edPassword.setEchoMode(QtGui.QLineEdit.Password)
12.121 - lyPassword.addWidget(self.edPassword)
12.122 - lbPassword.setBuddy(self.edPassword)
12.123 - lyText.addStretch(1)
12.124 -
12.125 - lyMain.addStretch(1)
12.126 -
12.127 - # buttons
12.128 - lyButton = QtGui.QHBoxLayout()
12.129 - lyMain.addLayout(lyButton)
12.130 -
12.131 - lyButton.addStretch(1)
12.132 - btnOk = QtGui.QPushButton('&Ok', self)
12.133 - btnOk.setDefault(True)
12.134 - btnOk.setMinimumWidth(100)
12.135 - lyButton.addWidget(btnOk)
12.136 - btnCancel = QtGui.QPushButton('&Cancel', self)
12.137 - btnCancel.setMinimumWidth(100)
12.138 - lyButton.addWidget(btnCancel)
12.139 - btnAbout = QtGui.QPushButton('&About', self)
12.140 - btnAbout.setMinimumWidth(100)
12.141 - lyButton.addWidget(btnAbout)
12.142 -
12.143 - button_width = max(btnOk.width(), btnCancel.width(), btnAbout.width())
12.144 - btnOk.setMinimumWidth(button_width)
12.145 - btnCancel.setMinimumWidth(button_width)
12.146 - btnAbout.setMinimumWidth(button_width)
12.147 -
12.148 - # reduce to the max
12.149 - self.resize(lyMain.minimumSize())
12.150 -
12.151 - # connectors
12.152 - btnOk.clicked.connect(self.clicked_ok)
12.153 - btnCancel.clicked.connect(self.clicked_cancel)
12.154 - btnAbout.clicked.connect(self.clicked_about)
12.155 -
12.156 -
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/OpenSecurity/bin/ui/password_dialog.py Mon Mar 31 12:51:16 2014 +0200
13.3 @@ -0,0 +1,104 @@
13.4 +#!/bin/env python
13.5 +# -*- coding: utf-8 -*-
13.6 +
13.7 +# ------------------------------------------------------------
13.8 +# password_dialog.pyw
13.9 +#
13.10 +# the user should give us a password
13.11 +#
13.12 +# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
13.13 +#
13.14 +# Copyright (C) 2014 AIT Austrian Institute of Technology
13.15 +# AIT Austrian Institute of Technology GmbH
13.16 +# Donau-City-Strasse 1 | 1220 Vienna | Austria
13.17 +# http://www.ait.ac.at
13.18 +#
13.19 +# This program is free software; you can redistribute it and/or
13.20 +# modify it under the terms of the GNU General Public License
13.21 +# as published by the Free Software Foundation version 2.
13.22 +#
13.23 +# This program is distributed in the hope that it will be useful,
13.24 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
13.25 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.26 +# GNU General Public License for more details.
13.27 +#
13.28 +# You should have received a copy of the GNU General Public License
13.29 +# along with this program; if not, write to the Free Software
13.30 +# Foundation, Inc., 51 Franklin Street, Fifth Floor,
13.31 +# Boston, MA 02110-1301, USA.
13.32 +# ------------------------------------------------------------
13.33 +
13.34 +
13.35 +# ------------------------------------------------------------
13.36 +# imports
13.37 +
13.38 +import sys
13.39 +
13.40 +from PyQt4 import QtCore
13.41 +from PyQt4 import QtGui
13.42 +
13.43 +from ui_PasswordDialog import Ui_PasswordDialog
13.44 +from about_dialog import AboutDialog
13.45 +
13.46 +
13.47 +# ------------------------------------------------------------
13.48 +# code
13.49 +
13.50 +
13.51 +class PasswordDialog(QtGui.QDialog):
13.52 +
13.53 + """A dialog for letting the user pass on a user/password combo"""
13.54 +
13.55 + def __init__(self, user_text = 'Please provide an approbitate password to proceed:'):
13.56 +
13.57 + QtGui.QDialog.__init__(self)
13.58 +
13.59 + # setup the user interface
13.60 + self.ui = Ui_PasswordDialog()
13.61 + self.ui.setupUi(self)
13.62 +
13.63 + # local members
13.64 + self._about_dialog = AboutDialog()
13.65 +
13.66 + # connectors
13.67 + self.ui.lblText.setText(user_text)
13.68 + self.ui.btnAbout.clicked.connect(self.clicked_about)
13.69 + self.ui.btnCancel.clicked.connect(self.reject)
13.70 + self.ui.btnOk.clicked.connect(self.clicked_ok)
13.71 +
13.72 + # positionate ourself central
13.73 + screen = QtGui.QDesktopWidget().screenGeometry()
13.74 + size = self.geometry()
13.75 + self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2)
13.76 +
13.77 +
13.78 + def clicked_about(self):
13.79 +
13.80 + """About button has been clicked."""
13.81 + self._about_dialog.show()
13.82 +
13.83 +
13.84 + def clicked_ok(self):
13.85 +
13.86 + """Ok button has been clicked."""
13.87 + sys.stdout.write('{ ')
13.88 + sys.stdout.write('\'password\': \'')
13.89 + sys.stdout.write(self.ui.edtPassword.text())
13.90 + sys.stdout.write('\' ')
13.91 + sys.stdout.write('}\n')
13.92 + self.accept()
13.93 +
13.94 +
13.95 + def set_user_text(user_text):
13.96 +
13.97 + """Set a text to explain which password we need."""
13.98 + self.ui.lblText.setText(user_text)
13.99 +
13.100 +
13.101 +
13.102 +if __name__ == "__main__":
13.103 + a = QtGui.QApplication(sys.argv)
13.104 + d = PasswordDialog()
13.105 + d.show()
13.106 + sys.exit(a.exec_())
13.107 +
14.1 Binary file OpenSecurity/bin/ui/ui_AboutDialog.pyc has changed
15.1 Binary file OpenSecurity/bin/ui/ui_ConfigureDialog.pyc has changed
16.1 Binary file OpenSecurity/bin/ui/ui_CredentialsDialog.pyc has changed
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/OpenSecurity/bin/ui/ui_PasswordDialog.py Mon Mar 31 12:51:16 2014 +0200
17.3 @@ -0,0 +1,101 @@
17.4 +# -*- coding: utf-8 -*-
17.5 +
17.6 +# Form implementation generated from reading ui file 'PasswordDialog.ui'
17.7 +#
17.8 +# Created: Mon Mar 31 12:41:50 2014
17.9 +# by: PyQt4 UI code generator 4.10.3
17.10 +#
17.11 +# WARNING! All changes made in this file will be lost!
17.12 +
17.13 +from PyQt4 import QtCore, QtGui
17.14 +
17.15 +try:
17.16 + _fromUtf8 = QtCore.QString.fromUtf8
17.17 +except AttributeError:
17.18 + def _fromUtf8(s):
17.19 + return s
17.20 +
17.21 +try:
17.22 + _encoding = QtGui.QApplication.UnicodeUTF8
17.23 + def _translate(context, text, disambig):
17.24 + return QtGui.QApplication.translate(context, text, disambig, _encoding)
17.25 +except AttributeError:
17.26 + def _translate(context, text, disambig):
17.27 + return QtGui.QApplication.translate(context, text, disambig)
17.28 +
17.29 +class Ui_PasswordDialog(object):
17.30 + def setupUi(self, PasswordDialog):
17.31 + PasswordDialog.setObjectName(_fromUtf8("PasswordDialog"))
17.32 + PasswordDialog.resize(420, 120)
17.33 + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
17.34 + sizePolicy.setHorizontalStretch(0)
17.35 + sizePolicy.setVerticalStretch(0)
17.36 + sizePolicy.setHeightForWidth(PasswordDialog.sizePolicy().hasHeightForWidth())
17.37 + PasswordDialog.setSizePolicy(sizePolicy)
17.38 + icon = QtGui.QIcon()
17.39 + icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/opensecurity/gfx/opensecurity_icon_64.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
17.40 + PasswordDialog.setWindowIcon(icon)
17.41 + self.verticalLayout = QtGui.QVBoxLayout(PasswordDialog)
17.42 + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
17.43 + self.lyContent = QtGui.QHBoxLayout()
17.44 + self.lyContent.setSpacing(16)
17.45 + self.lyContent.setObjectName(_fromUtf8("lyContent"))
17.46 + self.lblIcon = QtGui.QLabel(PasswordDialog)
17.47 + self.lblIcon.setText(_fromUtf8(""))
17.48 + self.lblIcon.setPixmap(QtGui.QPixmap(_fromUtf8(":/opensecurity/gfx/opensecurity_icon_64.png")))
17.49 + self.lblIcon.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
17.50 + self.lblIcon.setObjectName(_fromUtf8("lblIcon"))
17.51 + self.lyContent.addWidget(self.lblIcon)
17.52 + self.lyCredentials = QtGui.QGridLayout()
17.53 + self.lyCredentials.setSpacing(4)
17.54 + self.lyCredentials.setObjectName(_fromUtf8("lyCredentials"))
17.55 + self.edtPassword = QtGui.QLineEdit(PasswordDialog)
17.56 + self.edtPassword.setEchoMode(QtGui.QLineEdit.Password)
17.57 + self.edtPassword.setObjectName(_fromUtf8("edtPassword"))
17.58 + self.lyCredentials.addWidget(self.edtPassword, 1, 1, 1, 1)
17.59 + self.lblText = QtGui.QLabel(PasswordDialog)
17.60 + self.lblText.setObjectName(_fromUtf8("lblText"))
17.61 + self.lyCredentials.addWidget(self.lblText, 0, 0, 1, 2)
17.62 + self.wdCredentialsSpacer = QtGui.QWidget(PasswordDialog)
17.63 + self.wdCredentialsSpacer.setObjectName(_fromUtf8("wdCredentialsSpacer"))
17.64 + self.lyCredentials.addWidget(self.wdCredentialsSpacer, 2, 0, 1, 2)
17.65 + self.lblPassword = QtGui.QLabel(PasswordDialog)
17.66 + self.lblPassword.setObjectName(_fromUtf8("lblPassword"))
17.67 + self.lyCredentials.addWidget(self.lblPassword, 1, 0, 1, 1)
17.68 + self.lyContent.addLayout(self.lyCredentials)
17.69 + self.verticalLayout.addLayout(self.lyContent)
17.70 + self.lyButtons = QtGui.QHBoxLayout()
17.71 + self.lyButtons.setObjectName(_fromUtf8("lyButtons"))
17.72 + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
17.73 + self.lyButtons.addItem(spacerItem)
17.74 + self.btnAbout = QtGui.QPushButton(PasswordDialog)
17.75 + self.btnAbout.setMinimumSize(QtCore.QSize(100, 0))
17.76 + self.btnAbout.setObjectName(_fromUtf8("btnAbout"))
17.77 + self.lyButtons.addWidget(self.btnAbout)
17.78 + self.btnCancel = QtGui.QPushButton(PasswordDialog)
17.79 + self.btnCancel.setMinimumSize(QtCore.QSize(100, 0))
17.80 + self.btnCancel.setObjectName(_fromUtf8("btnCancel"))
17.81 + self.lyButtons.addWidget(self.btnCancel)
17.82 + self.btnOk = QtGui.QPushButton(PasswordDialog)
17.83 + self.btnOk.setMinimumSize(QtCore.QSize(100, 0))
17.84 + self.btnOk.setDefault(True)
17.85 + self.btnOk.setObjectName(_fromUtf8("btnOk"))
17.86 + self.lyButtons.addWidget(self.btnOk)
17.87 + self.verticalLayout.addLayout(self.lyButtons)
17.88 + self.lblPassword.setBuddy(self.edtPassword)
17.89 +
17.90 + self.retranslateUi(PasswordDialog)
17.91 + QtCore.QMetaObject.connectSlotsByName(PasswordDialog)
17.92 + PasswordDialog.setTabOrder(self.edtPassword, self.btnAbout)
17.93 + PasswordDialog.setTabOrder(self.btnAbout, self.btnCancel)
17.94 + PasswordDialog.setTabOrder(self.btnCancel, self.btnOk)
17.95 +
17.96 + def retranslateUi(self, PasswordDialog):
17.97 + PasswordDialog.setWindowTitle(_translate("PasswordDialog", "OpenSecuirty Password Request", None))
17.98 + self.lblText.setText(_translate("PasswordDialog", "TextLabel", None))
17.99 + self.lblPassword.setText(_translate("PasswordDialog", "&Password:", None))
17.100 + self.btnAbout.setText(_translate("PasswordDialog", "&About", None))
17.101 + self.btnCancel.setText(_translate("PasswordDialog", "&Cancel", None))
17.102 + self.btnOk.setText(_translate("PasswordDialog", "&Ok", None))
17.103 +
17.104 +import opensecurity_rc
18.1 Binary file OpenSecurity/bin/ui/ui_PasswordDialog.pyc has changed