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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2334 - (hide 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 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 jonathan 1305 #
6     # This program is free software under the GPL (>=v2)
7     # Read the file COPYING coming with Thuban for details.
8    
9 bh 1542 """The About Box"""
10    
11     __version__ = "$Revision$"
12     # $Source$
13     # $Id$
14    
15 jonathan 1305 from wxPython.wx import *
16    
17 silke 2334 import locale
18    
19 jonathan 1305 from Thuban import _
20     from Thuban.version import versions
21 bh 1964 from Thuban.Model.resource import gdal_support_status
22 jonathan 1305
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 bh 1980 # Note: The source code is in ASCII, so we escape some
35     # characters to get byte strings in latin1.
36 jan 1628 lead_developer = 'Bernhard Herzog'
37     developers = [ 'Jonathan Coles', 'Frank Koormann',
38 silke 2334 unicodeToLocale(u'Martin M\xfcller'), 'Jan-Oliver Wagner' ]
39 jan 1628 translators = [ ( _('French'), 'Daniel Calvelo Aros' ),
40 silke 2334 ( _('German'), unicodeToLocale(u'Bj\xf6rn Broscheit')),
41 jan 1628 ( _('Italian'), 'Maurizio Napolitano'),
42 frank 2053 ( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'),
43 jan 1628 ( _('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 bh 1631 ('GDAL', versions.get('gdal', _('- not available'))),
52     ('psycopg', versions.get('psycopg',
53     _('- not available')))]
54 jan 1628 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 bh 1964 if gdal_support_status:
67     text += gdal_support_status + "\n\n"
68    
69 jan 1628 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 bernhard 2140 "\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 jonathan 1305
100     self.text = text
101    
102     text_title = wxStaticText(self, -1,
103 jan 1628 _("Thuban is a program for exploring geographic data.\n\n") +
104 bernhard 2140 "Copyright 2001-2004 Intevation GmbH.\n" +
105 jan 1628 _("Thuban is licensed under the GNU GPL"),
106 jonathan 1305 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 silke 2334 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