OpenSecurity/bin/ui/about_dialog.py
author Oliver Maurhart <oliver.maurhart@ait.ac.at>
Fri, 13 Jun 2014 12:58:06 +0200
changeset 194 e79ca934e237
parent 144 dd472ede7a9f
child 195 18c1a46bd7a7
permissions -rwxr-xr-x
fixed about dialog
     1 #!/bin/env python
     2 # -*- coding: utf-8 -*-
     3 
     4 # ------------------------------------------------------------
     5 # about_dialog.pyw
     6 # 
     7 # something about OpenSecurity
     8 #
     9 # Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
    10 #
    11 # Copyright (C) 2014 AIT Austrian Institute of Technology
    12 # AIT Austrian Institute of Technology GmbH
    13 # Donau-City-Strasse 1 | 1220 Vienna | Austria
    14 # http://www.ait.ac.at
    15 #
    16 # This program is free software; you can redistribute it and/or
    17 # modify it under the terms of the GNU General Public License
    18 # as published by the Free Software Foundation version 2.
    19 # 
    20 # This program is distributed in the hope that it will be useful,
    21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    23 # GNU General Public License for more details.
    24 # 
    25 # You should have received a copy of the GNU General Public License
    26 # along with this program; if not, write to the Free Software
    27 # Foundation, Inc., 51 Franklin Street, Fifth Floor, 
    28 # Boston, MA  02110-1301, USA.
    29 # ------------------------------------------------------------
    30 
    31 
    32 # ------------------------------------------------------------
    33 # imports
    34 
    35 import sys
    36 
    37 from PyQt4 import QtCore
    38 from PyQt4 import QtGui
    39 
    40 from ui_AboutDialog import Ui_AboutDialog
    41 
    42 try:
    43     # mhm, bit of a hack to get the ../__init__.py loaded
    44     import os.path
    45     f = os.path.normpath(os.path.join(os.path.split(__file__)[0], '..', '__init__.py'))
    46     import imp
    47     opensecurity = imp.load_source('opensecurity', f)
    48     __version__ = opensecurity.__version__
    49 
    50 except:
    51     # failed to get the ../__init__.py loaded :(
    52     __version__ = 'N/A'
    53 
    54 
    55 # ------------------------------------------------------------
    56 # code
    57 
    58 
    59 ABOUT_TEXT = """
    60 <html>
    61 
    62 <head>
    63 
    64 <style type="text/css">
    65     .header { margin-bottom: 50px; }
    66     .logo { vertical-align: middle; margin-bottom: 24px; }
    67     .logo { vertical-align: middle; margin-bottom: 24px; }
    68     .footer { margin-top: 100px; }
    69 </style>
    70 
    71 </head>
    72 
    73 <body bgcolor="#FFFFFF">
    74 
    75 <div align="center">
    76 
    77 <h1 class="header">
    78     <a href="http://www.opensecurity.at"><img src=":/opensecurity/gfx/opensecurity_logo.jpg"/></a><br/><br/>
    79     OpenSecurity V%s
    80 </h1>
    81 
    82 <div class="about_text" align="left">
    83     OpenSecurity is an Austrian national project funded by the FFG KIRAS program.<br/>
    84     <br/>
    85     The goal of the project is to help to prevent the loss and (un)intentional misuse of sensitive, <br/>
    86     citizen-related data held by public bodies through the application of "security by isolation" approaches. <br/>
    87     <br/>
    88     The OpenSecurity consortium consists of small businesses (X-Net Services GmbH, IKARUS Security Software GmbH), <br/>
    89     research institutions (AIT Austrian Institute of Technology GmbH, Linzer Institut f&uuml;r qualitative Analysen), <br/>
    90     and public stakeholders (Bundesministerium f&uuml;r Landesverteidigung und Sport, IKT Linz Infrastruktur GmbH). <br/>
    91 </div>
    92 
    93 <div class="logo">
    94     <a href="http://www.ait.ac.at"><img src=":/opensecurity/gfx/ait_logo_no_claim.png"/></a>
    95     <a href="http://www.x-net.at"><img src=":/opensecurity/gfx/x-net_logo.jpg"/></a>
    96     <a href="http://www.ikarussecurity.com"><img src=":/opensecurity/gfx/ikarus_logo.jpg"/></a>
    97 </div>
    98 
    99 <div class="logo">
   100     <a href="http://www.liqua.net"><img src=":/opensecurity/gfx/liqua_logo.jpg"/></a>
   101     <a href="http://www.linz.at"><img src=":/opensecurity/gfx/linz_logo.jpg"/></a>
   102     <a href="http://www.bmvit.gv.at"><img src=":/opensecurity/gfx/bmvit_logo.jpg"/></a>
   103 </div>
   104 
   105 <div class="logo">
   106     <a href="http://www.ffg.at"><img src=":/opensecurity/gfx/ffg_logo.jpg"/></a>
   107     <a href="http://www.kiras.at"><img src=":/opensecurity/gfx/kiras_logo.jpg"/></a>
   108 </div>
   109 
   110 <div class="footer" align="left">
   111     Copyright (C) 2013, 2014 AIT Austrian Institute of Technology<br/>
   112     AIT Austrian Institute of Technology GmbH<br/>
   113     Donau-City-Strasse 1 | 1220 Vienna | Austria<br/>
   114     <a href="http://www.ait.ac.at">http://www.ait.ac.at</a>
   115 </div>
   116 
   117 </div>
   118 </body>
   119 </html>
   120 """;
   121 
   122 
   123 # ------------------------------------------------------------
   124 # code
   125 
   126 
   127 class AboutDialog(QtGui.QDialog):
   128 
   129     """A dialog which shows some information about the OpenSecurity project"""
   130 
   131     def __init__(self):
   132 
   133         QtGui.QDialog.__init__(self)
   134 
   135         # setup the user interface
   136         self.ui = Ui_AboutDialog()
   137         self.ui.setupUi(self)
   138    
   139         # fix the scroll area content
   140         self.ui.lblAbout = QtGui.QLabel(ABOUT_TEXT)
   141         self.ui.lblAbout.setContentsMargins(16, 16, 16, 16)
   142         self.ui.lblAbout.setStyleSheet(self.ui.scrAboutContent.styleSheet())
   143         self.ui.scrAbout.setWidget(self.ui.lblAbout)
   144 
   145         # connectors
   146         self.ui.btnOk.clicked.connect(self.accept)
   147         self.ui.lblAbout.setText(ABOUT_TEXT % __version__)
   148 
   149 
   150 if __name__ == "__main__":
   151     a = QtGui.QApplication(sys.argv)
   152     d = AboutDialog()
   153     d.show()
   154     sys.exit(a.exec_())     
   155