1 |
bernhard |
2140 |
# Copyright (c) 2001, 2002, 2003, 2004 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 |
jonathan |
1305 |
from wxPython.wx import * |
17 |
|
|
|
18 |
bh |
2478 |
from locale import getdefaultlocale |
19 |
silke |
2338 |
|
20 |
jonathan |
1305 |
from Thuban import _ |
21 |
|
|
from Thuban.version import versions |
22 |
bh |
1964 |
from Thuban.Model.resource import gdal_support_status |
23 |
jonathan |
1305 |
|
24 |
jan |
2354 |
from Thuban.UI.extensionregistry import ext_registry |
25 |
|
|
|
26 |
jonathan |
1305 |
class About(wxDialog): |
27 |
|
|
|
28 |
|
|
def __init__(self, parent): |
29 |
|
|
wxDialog.__init__(self, parent, -1, _("About Thuban"), |
30 |
|
|
style = wxDEFAULT_DIALOG_STYLE |
31 |
|
|
| wxSYSTEM_MENU |
32 |
|
|
| wxMINIMIZE_BOX |
33 |
|
|
| wxMAXIMIZE_BOX |
34 |
|
|
| wxRESIZE_BORDER, |
35 |
|
|
size = (400, 250)) |
36 |
|
|
|
37 |
bh |
1980 |
# Note: The source code is in ASCII, so we escape some |
38 |
|
|
# characters to get byte strings in latin1. |
39 |
jan |
1628 |
lead_developer = 'Bernhard Herzog' |
40 |
jan |
2428 |
developers = [ 'Jonathan Coles', |
41 |
|
|
'Frank Koormann', |
42 |
|
|
unicodeToLocale(u'Martin M\xfcller'), |
43 |
|
|
'Bernhard Reiter', |
44 |
|
|
'Jan-Oliver Wagner' ] |
45 |
jan |
1628 |
translators = [ ( _('French'), 'Daniel Calvelo Aros' ), |
46 |
silke |
2334 |
( _('German'), unicodeToLocale(u'Bj\xf6rn Broscheit')), |
47 |
jan |
2428 |
( _('Hungarian'), 'Norbert Solymosi'), |
48 |
jan |
1628 |
( _('Italian'), 'Maurizio Napolitano'), |
49 |
frank |
2053 |
( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'), |
50 |
jan |
1628 |
( _('Russian'), 'Alex Shevlakov'), |
51 |
|
|
( _('Spanish'), 'Daniel Calvelo Aros') ] |
52 |
jan |
2428 |
other_contributors = [ 'Jonathan Byron', |
53 |
|
|
'Ole Rahn', |
54 |
|
|
'Silke Reimer' ] |
55 |
jan |
1628 |
dyn_modules = [ ('wxPython', versions['wxPython']), |
56 |
|
|
('Python', versions['python']), |
57 |
|
|
('PySQLite', versions['pysqlite']), |
58 |
|
|
('SQLite', versions['sqlite']), |
59 |
bh |
1631 |
('GDAL', versions.get('gdal', _('- not available'))), |
60 |
|
|
('psycopg', versions.get('psycopg', |
61 |
|
|
_('- not available')))] |
62 |
jan |
1628 |
direct_modules = [ \ |
63 |
|
|
('GTK', versions.get('gtk', _('- not available'))), |
64 |
|
|
('proj', versions['proj']) ] |
65 |
|
|
|
66 |
|
|
text = 'Thuban %s\n\n' % versions['thuban-long'] |
67 |
|
|
|
68 |
|
|
text += _('Currently using:\n') |
69 |
|
|
|
70 |
|
|
for name, version in dyn_modules: |
71 |
|
|
text+= '\t%s %s\n' % (name, version) |
72 |
|
|
text += '\n' |
73 |
|
|
|
74 |
bh |
1964 |
if gdal_support_status: |
75 |
|
|
text += gdal_support_status + "\n\n" |
76 |
|
|
|
77 |
jan |
1628 |
text += _('Compiled for:\n') |
78 |
|
|
|
79 |
|
|
for name, version in direct_modules: |
80 |
|
|
text+= '\t%s %s\n' % (name, version) |
81 |
|
|
text += '\n' |
82 |
|
|
|
83 |
jan |
2354 |
text += _('Extensions:\n') |
84 |
|
|
if ext_registry: |
85 |
|
|
for ext in ext_registry: |
86 |
|
|
text += '\t%s %s\n' % (ext.name, ext.version) |
87 |
|
|
else: |
88 |
|
|
text += _('\tNone registered.\n') |
89 |
|
|
text += '\n' |
90 |
|
|
|
91 |
jan |
1628 |
text += _('Lead Developer:\n') |
92 |
|
|
text += '\t%s\n\n' % lead_developer |
93 |
|
|
|
94 |
|
|
text += _('Developers:\n') |
95 |
|
|
for name in developers: |
96 |
|
|
text += '\t%s\n' % name |
97 |
|
|
text += '\n' |
98 |
|
|
|
99 |
|
|
text += _('Translators:\n') |
100 |
|
|
for lang, name in translators: |
101 |
|
|
text += '\t%s: %s\n' % (lang, name) |
102 |
|
|
text += '\n' |
103 |
|
|
|
104 |
|
|
text += _('Other Contributors:\n') |
105 |
|
|
for name in other_contributors: |
106 |
|
|
text += '\t%s\n' % name |
107 |
|
|
text += '\n' |
108 |
|
|
|
109 |
|
|
text += \ |
110 |
|
|
_("Questions and comments can be sent to the following addresses:\n" |
111 |
bernhard |
2140 |
"\tGeneral list (public):\n\t\t<[email protected]>\n" |
112 |
|
|
"\tDevelopers list (public):\n\t\t<[email protected]>\n" |
113 |
|
|
"\tThuban team at Intevation:\n\t\t<[email protected]>\n" |
114 |
|
|
) |
115 |
jonathan |
1305 |
|
116 |
jan |
2354 |
text += '\n\n' |
117 |
|
|
|
118 |
|
|
text += _("Details on the registered extensions:\n\n") |
119 |
|
|
|
120 |
|
|
if ext_registry: |
121 |
|
|
for ext in ext_registry: |
122 |
|
|
text += '%s %s:\n' % (ext.name, ext.version) |
123 |
|
|
text += _('Copyright %s\n') % ext.copyright |
124 |
|
|
text += _('Authors:\n') |
125 |
|
|
for author in ext.authors: |
126 |
|
|
text+= '\t%s\n' % author |
127 |
|
|
text += ext.desc |
128 |
|
|
text += '\n\n' |
129 |
|
|
else: |
130 |
|
|
text += _('\tNone registered.\n') |
131 |
|
|
|
132 |
jonathan |
1305 |
self.text = text |
133 |
|
|
|
134 |
|
|
text_title = wxStaticText(self, -1, |
135 |
jan |
1628 |
_("Thuban is a program for exploring geographic data.\n\n") + |
136 |
bernhard |
2140 |
"Copyright 2001-2004 Intevation GmbH.\n" + |
137 |
jan |
1628 |
_("Thuban is licensed under the GNU GPL"), |
138 |
jonathan |
1305 |
style=wxST_NO_AUTORESIZE|wxALIGN_CENTRE) |
139 |
|
|
|
140 |
|
|
textBox = wxTextCtrl(self, -1, text, |
141 |
|
|
style=wxTE_READONLY|wxTE_MULTILINE|wxTE_LINEWRAP) |
142 |
|
|
w, h = (300, 150) |
143 |
|
|
textBox.SetSizeHints(w, h) |
144 |
|
|
textBox.SetSize((w, h)) |
145 |
|
|
|
146 |
|
|
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
147 |
|
|
button_close.SetDefault() |
148 |
|
|
|
149 |
|
|
sizer = wxBoxSizer(wxVERTICAL) |
150 |
|
|
sizer.Add(text_title, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 10) |
151 |
|
|
sizer.Add(textBox, 1, wxALL|wxEXPAND, 10) |
152 |
|
|
sizer.Add(button_close, 0, wxALL|wxALIGN_RIGHT, 10) |
153 |
|
|
|
154 |
|
|
self.SetAutoLayout(True) |
155 |
|
|
self.SetSizer(sizer) |
156 |
|
|
sizer.Fit(self) |
157 |
|
|
sizer.SetSizeHints(self) |
158 |
|
|
self.Layout() |
159 |
|
|
|
160 |
|
|
EVT_BUTTON(self, wxID_CANCEL, self.OnCancel) |
161 |
|
|
|
162 |
|
|
def OnCancel(self, event): |
163 |
|
|
self.EndModal(wxID_CANCEL) |
164 |
|
|
|
165 |
|
|
|
166 |
silke |
2334 |
def unicodeToLocale(unicodeStr): |
167 |
silke |
2338 |
"Function to convert unicode to the user's locale encoding" |
168 |
bh |
2478 |
# Under a german windows 2000 getlocale returns an encoding name |
169 |
|
|
# that's not direcly usable (it's missing a "cp" at the beginning). |
170 |
|
|
# getdefaultlocale does return a usable encoding name so we use that |
171 |
|
|
# instead. |
172 |
|
|
return unicodeStr.encode(getdefaultlocale()[1]) |