Translated using Weblate.
[wammu.git] / Wammu / About.py
blob9945b713937131607e87078d7357bcaa72f843a6
1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
3 '''
4 Wammu - Phone manager
5 About dialog
6 '''
7 __author__ = 'Michal Čihař'
8 __email__ = 'michal@cihar.com'
9 __license__ = '''
10 Copyright © 2003 - 2010 Michal Čihař
12 This program is free software; you can redistribute it and/or modify it
13 under the terms of the GNU General Public License version 2 as published by
14 the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 more details.
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 '''
26 import wx
27 import wx.html
28 import wx.lib.wxpTag
29 import sys
30 import Wammu
31 if Wammu.gammu_error == None:
32 import gammu
33 import Wammu.Utils
34 import Wammu.Paths
35 from Wammu.Locales import hgettext as _, HtmlStrConv
37 class AboutBox(wx.Dialog):
38 '''
39 Displays box showing information about program including versions of used
40 components.
41 '''
42 def __init__(self, parent):
43 wx.Dialog.__init__(self, parent, -1, _('About Wammu'))
45 copyrightline = u'Copyright © 2003 - 2011 Michal Čihař'
47 # default system colours
48 bgc = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)
49 fgc = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNTEXT)
50 hfgc = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNHIGHLIGHT)
52 colours = 'text="#%02x%02x%02x" bgcolor="#%02x%02x%02x" link="#%02x%02x%02x"' % (
53 fgc.Red(), fgc.Green(), fgc.Blue(),
54 bgc.Red(), bgc.Green(), bgc.Blue(),
55 hfgc.Red(), hfgc.Green(), hfgc.Blue())
57 text = '''
58 <html>
59 <body %s>
60 <center><font color="#ffffff"><table bgcolor="#458154" width="100%%" cellspacing="0"
61 cellpadding="0" border="1">
62 <tr>
63 <td align="center">
65 </td>
66 </tr>
67 </table></font>
69 <p>%s</p>
71 <p>
72 <font size=-3>
74 <br><br>
76 <br><br>
78 </font>
79 </p>
80 <p>
81 <wxp module="wx" class="Button">
82 <param name="id" value="ID_OK">
83 </wxp>
84 </p>
85 </center>
86 </body>
87 </html>
89 ''' % (colours, '''<img src="%s"><br><h2> Wammu %s</h2>
90 %s<br>
91 %s<br>
92 %s<br>
93 ''' % (Wammu.Paths.AppIconPath('wammu'),
94 Wammu.__version__,
95 _('Running on Python %s') % sys.version.split()[0],
96 _('Using wxPython %s') % wx.VERSION_STRING,
97 _('Using python-gammu %(python_gammu_version)s and Gammu %(gammu_version)s') %
99 'python_gammu_version':gammu.Version()[1],
100 'gammu_version': gammu.Version()[0]
102 _('<b>Wammu</b> is a wxPython based GUI for Gammu.'),
103 copyrightline,
104 _('''
105 This program is free software; you can redistribute it and/or modify
106 it under the terms of the GNU General Public License version 2 as
107 published by the Free Software Foundation.
108 '''),
109 _('''
110 This program is distributed in the hope that it will be useful,
111 but WITHOUT ANY WARRANTY; without even the implied warranty of
112 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
113 GNU General Public License for more details.
114 '''))
116 html = wx.html.HtmlWindow(self, -1, size = (500, -1))
117 html.SetPage(text)
118 btn = html.FindWindowById(wx.ID_OK)
119 if btn != None:
120 btn.SetDefault()
121 representation = html.GetInternalRepresentation()
122 html.SetSize( (representation.GetWidth()+25, representation.GetHeight()+25) )
123 self.SetClientSize(html.GetSize())
124 self.CentreOnParent(wx.BOTH)