/[thuban]/trunk/thuban/Thuban/UI/about.py
ViewVC logotype

Contents of /trunk/thuban/Thuban/UI/about.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2334 - (show annotations)
Tue Aug 10 19:58:50 2004 UTC (20 years, 6 months ago) by silke
File MIME type: text/x-python
File size: 4841 byte(s)
Fixed encoding problem of about dialog: Added function unicodeToLocale() to
convert special characters to users locale encoding

1 # Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH
2 # Authors:
3 # Jonathan Coles <[email protected]>
4 # Bernhard Reiter <[email protected]>
5 #
6 # This program is free software under the GPL (>=v2)
7 # Read the file COPYING coming with Thuban for details.
8
9 """The About Box"""
10
11 __version__ = "$Revision$"
12 # $Source$
13 # $Id$
14
15 from wxPython.wx import *
16
17 import locale
18
19 from Thuban import _
20 from Thuban.version import versions
21 from Thuban.Model.resource import gdal_support_status
22
23 class About(wxDialog):
24
25 def __init__(self, parent):
26 wxDialog.__init__(self, parent, -1, _("About Thuban"),
27 style = wxDEFAULT_DIALOG_STYLE
28 | wxSYSTEM_MENU
29 | wxMINIMIZE_BOX
30 | wxMAXIMIZE_BOX
31 | wxRESIZE_BORDER,
32 size = (400, 250))
33
34 # Note: The source code is in ASCII, so we escape some
35 # characters to get byte strings in latin1.
36 lead_developer = 'Bernhard Herzog'
37 developers = [ 'Jonathan Coles', 'Frank Koormann',
38 unicodeToLocale(u'Martin M\xfcller'), 'Jan-Oliver Wagner' ]
39 translators = [ ( _('French'), 'Daniel Calvelo Aros' ),
40 ( _('German'), unicodeToLocale(u'Bj\xf6rn Broscheit')),
41 ( _('Italian'), 'Maurizio Napolitano'),
42 ( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'),
43 ( _('Russian'), 'Alex Shevlakov'),
44 ( _('Spanish'), 'Daniel Calvelo Aros') ]
45 other_contributors = [ 'Jonathan Byron', 'Silke Reimer',
46 'Bernhard Reiter' ]
47 dyn_modules = [ ('wxPython', versions['wxPython']),
48 ('Python', versions['python']),
49 ('PySQLite', versions['pysqlite']),
50 ('SQLite', versions['sqlite']),
51 ('GDAL', versions.get('gdal', _('- not available'))),
52 ('psycopg', versions.get('psycopg',
53 _('- not available')))]
54 direct_modules = [ \
55 ('GTK', versions.get('gtk', _('- not available'))),
56 ('proj', versions['proj']) ]
57
58 text = 'Thuban %s\n\n' % versions['thuban-long']
59
60 text += _('Currently using:\n')
61
62 for name, version in dyn_modules:
63 text+= '\t%s %s\n' % (name, version)
64 text += '\n'
65
66 if gdal_support_status:
67 text += gdal_support_status + "\n\n"
68
69 text += _('Compiled for:\n')
70
71 for name, version in direct_modules:
72 text+= '\t%s %s\n' % (name, version)
73 text += '\n'
74
75 text += _('Lead Developer:\n')
76 text += '\t%s\n\n' % lead_developer
77
78 text += _('Developers:\n')
79 for name in developers:
80 text += '\t%s\n' % name
81 text += '\n'
82
83 text += _('Translators:\n')
84 for lang, name in translators:
85 text += '\t%s: %s\n' % (lang, name)
86 text += '\n'
87
88 text += _('Other Contributors:\n')
89 for name in other_contributors:
90 text += '\t%s\n' % name
91 text += '\n'
92
93 text += \
94 _("Questions and comments can be sent to the following addresses:\n"
95 "\tGeneral list (public):\n\t\t<[email protected]>\n"
96 "\tDevelopers list (public):\n\t\t<[email protected]>\n"
97 "\tThuban team at Intevation:\n\t\t<[email protected]>\n"
98 )
99
100 self.text = text
101
102 text_title = wxStaticText(self, -1,
103 _("Thuban is a program for exploring geographic data.\n\n") +
104 "Copyright 2001-2004 Intevation GmbH.\n" +
105 _("Thuban is licensed under the GNU GPL"),
106 style=wxST_NO_AUTORESIZE|wxALIGN_CENTRE)
107
108 textBox = wxTextCtrl(self, -1, text,
109 style=wxTE_READONLY|wxTE_MULTILINE|wxTE_LINEWRAP)
110 w, h = (300, 150)
111 textBox.SetSizeHints(w, h)
112 textBox.SetSize((w, h))
113
114 button_close = wxButton(self, wxID_CANCEL, _("Close"))
115 button_close.SetDefault()
116
117 sizer = wxBoxSizer(wxVERTICAL)
118 sizer.Add(text_title, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 10)
119 sizer.Add(textBox, 1, wxALL|wxEXPAND, 10)
120 sizer.Add(button_close, 0, wxALL|wxALIGN_RIGHT, 10)
121
122 self.SetAutoLayout(True)
123 self.SetSizer(sizer)
124 sizer.Fit(self)
125 sizer.SetSizeHints(self)
126 self.Layout()
127
128 EVT_BUTTON(self, wxID_CANCEL, self.OnCancel)
129
130 def OnCancel(self, event):
131 self.EndModal(wxID_CANCEL)
132
133
134 def unicodeToLocale(unicodeStr):
135 " Function to convert a unicode object to an object \ in the user's locale encoding"
136
137
138 import locale
139 return unicodeStr.encode(locale.getlocale()[1])
140

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26