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