1 |
bernhard |
2725 |
# Copyright (c) 2001-2007 by Intevation GmbH |
2 |
jonathan |
1305 |
# Authors: |
3 |
|
|
# Jonathan Coles <[email protected]> |
4 |
bernhard |
2140 |
# Bernhard Reiter <[email protected]> |
5 |
silke |
2338 |
# Silke Reimer <[email protected]> |
6 |
jonathan |
1305 |
# |
7 |
|
|
# This program is free software under the GPL (>=v2) |
8 |
|
|
# Read the file COPYING coming with Thuban for details. |
9 |
|
|
|
10 |
bh |
1542 |
"""The About Box""" |
11 |
|
|
|
12 |
|
|
__version__ = "$Revision$" |
13 |
|
|
# $Source$ |
14 |
|
|
# $Id$ |
15 |
|
|
|
16 |
dpinte |
2700 |
import wx |
17 |
jonathan |
1305 |
|
18 |
bernhard |
2674 |
from Thuban import _, internal_from_unicode, get_internal_encoding |
19 |
jonathan |
1305 |
from Thuban.version import versions |
20 |
bh |
1964 |
from Thuban.Model.resource import gdal_support_status |
21 |
jonathan |
1305 |
|
22 |
jan |
2354 |
from Thuban.UI.extensionregistry import ext_registry |
23 |
|
|
|
24 |
dpinte |
2700 |
class About(wx.Dialog): |
25 |
jonathan |
1305 |
|
26 |
|
|
def __init__(self, parent): |
27 |
dpinte |
2700 |
wx.Dialog.__init__(self, parent, -1, _("About Thuban"), |
28 |
|
|
style = wx.DEFAULT_DIALOG_STYLE |
29 |
|
|
| wx.SYSTEM_MENU |
30 |
|
|
| wx.MINIMIZE_BOX |
31 |
|
|
| wx.MAXIMIZE_BOX |
32 |
|
|
| wx.RESIZE_BORDER, |
33 |
jonathan |
1305 |
size = (400, 250)) |
34 |
|
|
|
35 |
bh |
1980 |
# Note: The source code is in ASCII, so we escape some |
36 |
|
|
# characters to get byte strings in latin1. |
37 |
bernhard |
2725 |
maintainers = [ 'Bernhard Reiter (2006 - current)', |
38 |
|
|
'Bernhard Herzog (2001 - 2005)' ] |
39 |
|
|
lead_developer = 'Bernhard Herzog (2001 - 2005)' |
40 |
|
|
developers = [ 'Jonathan Coles (2003, 2005)', |
41 |
|
|
'Frank Koormann (2002 - )', |
42 |
|
|
internal_from_unicode(u'Martin M\xfcller (2003)'), |
43 |
|
|
'Didrik Pinte (2006 - )', |
44 |
|
|
'Bernhard Reiter (2004 - )', |
45 |
|
|
'Jan-Oliver Wagner (2002 - 2005)' ] |
46 |
jan |
1628 |
translators = [ ( _('French'), 'Daniel Calvelo Aros' ), |
47 |
bh |
2642 |
( _('German'), |
48 |
|
|
internal_from_unicode(u'Bj\xf6rn Broscheit')), |
49 |
jan |
2428 |
( _('Hungarian'), 'Norbert Solymosi'), |
50 |
jan |
1628 |
( _('Italian'), 'Maurizio Napolitano'), |
51 |
frank |
2053 |
( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'), |
52 |
jan |
1628 |
( _('Russian'), 'Alex Shevlakov'), |
53 |
|
|
( _('Spanish'), 'Daniel Calvelo Aros') ] |
54 |
bernhard |
2725 |
other_contributors = [ 'Jonathan Byron (2004)', |
55 |
|
|
'Ole Rahn (2004)', |
56 |
|
|
'Silke Reimer (2003, 2004)', |
57 |
|
|
'Martin "Joey" Schulze (2004, 2005)' ] |
58 |
jan |
1628 |
dyn_modules = [ ('wxPython', versions['wxPython']), |
59 |
|
|
('Python', versions['python']), |
60 |
|
|
('PySQLite', versions['pysqlite']), |
61 |
|
|
('SQLite', versions['sqlite']), |
62 |
bh |
1631 |
('GDAL', versions.get('gdal', _('- not available'))), |
63 |
|
|
('psycopg', versions.get('psycopg', |
64 |
|
|
_('- not available')))] |
65 |
jan |
1628 |
direct_modules = [ \ |
66 |
|
|
('GTK', versions.get('gtk', _('- not available'))), |
67 |
|
|
('proj', versions['proj']) ] |
68 |
|
|
|
69 |
|
|
text = 'Thuban %s\n\n' % versions['thuban-long'] |
70 |
|
|
|
71 |
|
|
text += _('Currently using:\n') |
72 |
|
|
|
73 |
|
|
for name, version in dyn_modules: |
74 |
|
|
text+= '\t%s %s\n' % (name, version) |
75 |
|
|
text += '\n' |
76 |
|
|
|
77 |
bernhard |
2674 |
text += _('\tInternal encoding: %s\n') % get_internal_encoding() |
78 |
|
|
text += '\n' |
79 |
|
|
|
80 |
bh |
1964 |
if gdal_support_status: |
81 |
|
|
text += gdal_support_status + "\n\n" |
82 |
|
|
|
83 |
jan |
1628 |
text += _('Compiled for:\n') |
84 |
|
|
|
85 |
|
|
for name, version in direct_modules: |
86 |
|
|
text+= '\t%s %s\n' % (name, version) |
87 |
|
|
text += '\n' |
88 |
|
|
|
89 |
jan |
2354 |
text += _('Extensions:\n') |
90 |
|
|
if ext_registry: |
91 |
|
|
for ext in ext_registry: |
92 |
|
|
text += '\t%s %s\n' % (ext.name, ext.version) |
93 |
|
|
else: |
94 |
|
|
text += _('\tNone registered.\n') |
95 |
|
|
text += '\n' |
96 |
|
|
|
97 |
bernhard |
2725 |
text += _('Maintainers:\n') |
98 |
|
|
for name in maintainers: |
99 |
|
|
text += '\t%s\n' % name |
100 |
|
|
text += '\n' |
101 |
|
|
|
102 |
jan |
1628 |
text += _('Lead Developer:\n') |
103 |
|
|
text += '\t%s\n\n' % lead_developer |
104 |
|
|
|
105 |
|
|
text += _('Developers:\n') |
106 |
|
|
for name in developers: |
107 |
|
|
text += '\t%s\n' % name |
108 |
|
|
text += '\n' |
109 |
|
|
|
110 |
|
|
text += _('Translators:\n') |
111 |
|
|
for lang, name in translators: |
112 |
|
|
text += '\t%s: %s\n' % (lang, name) |
113 |
|
|
text += '\n' |
114 |
|
|
|
115 |
|
|
text += _('Other Contributors:\n') |
116 |
|
|
for name in other_contributors: |
117 |
|
|
text += '\t%s\n' % name |
118 |
|
|
text += '\n' |
119 |
|
|
|
120 |
|
|
text += \ |
121 |
|
|
_("Questions and comments can be sent to the following addresses:\n" |
122 |
bernhard |
2140 |
"\tGeneral list (public):\n\t\t<[email protected]>\n" |
123 |
|
|
"\tDevelopers list (public):\n\t\t<[email protected]>\n" |
124 |
|
|
"\tThuban team at Intevation:\n\t\t<[email protected]>\n" |
125 |
|
|
) |
126 |
jonathan |
1305 |
|
127 |
jan |
2354 |
text += '\n\n' |
128 |
|
|
|
129 |
|
|
text += _("Details on the registered extensions:\n\n") |
130 |
|
|
|
131 |
|
|
if ext_registry: |
132 |
|
|
for ext in ext_registry: |
133 |
|
|
text += '%s %s:\n' % (ext.name, ext.version) |
134 |
|
|
text += _('Copyright %s\n') % ext.copyright |
135 |
|
|
text += _('Authors:\n') |
136 |
|
|
for author in ext.authors: |
137 |
|
|
text+= '\t%s\n' % author |
138 |
|
|
text += ext.desc |
139 |
jan |
2582 |
text += '\n' |
140 |
|
|
text += 'Status: %s' % ext.status |
141 |
jan |
2354 |
text += '\n\n' |
142 |
|
|
else: |
143 |
|
|
text += _('\tNone registered.\n') |
144 |
|
|
|
145 |
jonathan |
1305 |
self.text = text |
146 |
|
|
|
147 |
dpinte |
2700 |
text_title = wx.StaticText(self, -1, |
148 |
jan |
1628 |
_("Thuban is a program for exploring geographic data.\n\n") + |
149 |
bernhard |
2725 |
"Copyright 2001-2007 Intevation GmbH.\n" + |
150 |
jan |
1628 |
_("Thuban is licensed under the GNU GPL"), |
151 |
dpinte |
2700 |
style=wx.ST_NO_AUTORESIZE|wx.ALIGN_CENTRE) |
152 |
jonathan |
1305 |
|
153 |
dpinte |
2700 |
textBox = wx.TextCtrl(self, -1, text, |
154 |
|
|
style=wx.TE_READONLY|wx.TE_MULTILINE|wx.TE_LINEWRAP) |
155 |
jonathan |
1305 |
w, h = (300, 150) |
156 |
|
|
textBox.SetSizeHints(w, h) |
157 |
|
|
textBox.SetSize((w, h)) |
158 |
|
|
|
159 |
dpinte |
2700 |
button_close = wx.Button(self, wx.ID_CANCEL, _("Close")) |
160 |
jonathan |
1305 |
button_close.SetDefault() |
161 |
|
|
|
162 |
dpinte |
2700 |
sizer = wx.BoxSizer(wx.VERTICAL) |
163 |
|
|
sizer.Add(text_title, 0, wx.ALL|wx.EXPAND|wx.ADJUST_MINSIZE, 10) |
164 |
|
|
sizer.Add(textBox, 1, wx.ALL|wx.EXPAND, 10) |
165 |
|
|
sizer.Add(button_close, 0, wx.ALL|wx.ALIGN_RIGHT, 10) |
166 |
jonathan |
1305 |
|
167 |
|
|
self.SetAutoLayout(True) |
168 |
|
|
self.SetSizer(sizer) |
169 |
|
|
sizer.Fit(self) |
170 |
|
|
sizer.SetSizeHints(self) |
171 |
|
|
self.Layout() |
172 |
|
|
|
173 |
dpinte |
2700 |
self.Bind(wx.EVT_BUTTON, self.OnCancel, id=wx.ID_CANCEL) |
174 |
jonathan |
1305 |
|
175 |
|
|
def OnCancel(self, event): |
176 |
dpinte |
2700 |
self.EndModal(wx.ID_CANCEL) |