om@2: #!/bin/env python om@2: # -*- coding: utf-8 -*- om@2: om@2: # ------------------------------------------------------------ om@2: # about-dialog om@2: # om@2: # tell the user about the project om@2: # om@2: # Autor: Oliver Maurhart, om@2: # om@2: # Copyright (C) 2013 AIT Austrian Institute of Technology om@2: # AIT Austrian Institute of Technology GmbH om@2: # Donau-City-Strasse 1 | 1220 Vienna | Austria om@2: # http://www.ait.ac.at om@2: # om@2: # This program is free software; you can redistribute it and/or om@2: # modify it under the terms of the GNU General Public License om@2: # as published by the Free Software Foundation version 2. om@2: # om@2: # This program is distributed in the hope that it will be useful, om@2: # but WITHOUT ANY WARRANTY; without even the implied warranty of om@2: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the om@2: # GNU General Public License for more details. om@2: # om@2: # You should have received a copy of the GNU General Public License om@2: # along with this program; if not, write to the Free Software om@2: # Foundation, Inc., 51 Franklin Street, Fifth Floor, om@2: # Boston, MA 02110-1301, USA. om@2: # ------------------------------------------------------------ om@2: om@2: om@2: # ------------------------------------------------------------ om@2: # imports om@2: om@2: from PyQt4 import QtCore om@2: from PyQt4 import QtGui om@2: om@2: # local om@2: from environment import Environment om@2: om@2: # ------------------------------------------------------------ om@2: # vars om@2: om@2: om@2: ABOUT_TEXT = """ om@2: om@2: om@2: om@2:
om@2:

om@2: om@2:

om@2:

OpenSecurity

om@2:

om@2:

om@2:

om@2: Blah ...
om@2: om@2:

om@2: Copyright (C) 2013, AIT Austrian Institute of Technology
om@2: AIT Austrian Institute of Technology GmbH
om@2: Donau-City-Strasse 1 | 1220 Vienna | Austria
om@2: http://www.ait.ac.at om@2:

om@2: om@2: om@2: om@2: om@2: """; om@2: om@2: om@2: # ------------------------------------------------------------ om@2: # code om@2: om@2: om@2: class About(QtGui.QDialog): om@2: om@2: """Show some about stuff.""" om@2: om@2: def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags(0)): om@2: om@2: # super call and widget init om@2: super(About, self).__init__(parent, flags) om@2: om@2: # setup image search path om@2: QtCore.QDir.setSearchPaths("image", QtCore.QStringList(Environment('opensecurity').image_path)); om@2: om@2: self.setWindowTitle('About OpenSecuirty ...') om@2: self.setup_ui() om@2: om@2: om@2: def setup_ui(self): om@2: om@2: """Create the widgets.""" om@2: om@2: lyMain = QtGui.QVBoxLayout(self) om@2: lyMain.setContentsMargins(8, 8, 8, 8) om@2: om@2: lbAbout = QtGui.QLabel() om@2: lbAbout.setStyleSheet("QWidget { background: white; color: black; };") om@2: lbAbout.setText(ABOUT_TEXT) om@2: lbAbout.setContentsMargins(12, 12, 12, 12) om@2: om@2: scAbout = QtGui.QScrollArea() om@2: scAbout.setWidget(lbAbout) om@2: scAbout.viewport().setStyleSheet("QWidget { background: white; color: black; };") om@2: lyMain.addWidget(scAbout) om@2: om@2: # buttons om@2: lyButton = QtGui.QHBoxLayout() om@2: lyMain.addLayout(lyButton) om@2: om@2: lyButton.addStretch(1) om@2: btnOk = QtGui.QPushButton('&Ok', self) om@2: btnOk.setMinimumWidth(100) om@2: lyButton.addWidget(btnOk) om@2: om@2: # connectors om@2: btnOk.clicked.connect(self.accept) om@2: om@2: # reduce to the max om@2: self.setMinimumSize(400, 200) om@2: self.resize(lyMain.minimumSize()) om@2: