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