1 |
# Copyright (c) 2001, 2002, 2003 by Intevation GmbH |
2 |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
4 |
# |
5 |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
7 |
|
8 |
from wxPython.wx import * |
9 |
#from wxPython.wx import __version__ as wxPython_version |
10 |
|
11 |
from Thuban import _ |
12 |
#import Thuban.version |
13 |
from Thuban.version import versions |
14 |
|
15 |
#from sqlite import version as pysqlite_version |
16 |
#from _sqlite import sqlite_version |
17 |
|
18 |
#from wxproj import get_proj_version, get_gtk_version |
19 |
|
20 |
#from Thuban.Model.resource import has_gdal_support |
21 |
|
22 |
#if has_gdal_support(): |
23 |
# from gdalwarp import get_gdal_version |
24 |
|
25 |
class About(wxDialog): |
26 |
|
27 |
def __init__(self, parent): |
28 |
wxDialog.__init__(self, parent, -1, _("About Thuban"), |
29 |
style = wxDEFAULT_DIALOG_STYLE |
30 |
| wxSYSTEM_MENU |
31 |
| wxMINIMIZE_BOX |
32 |
| wxMAXIMIZE_BOX |
33 |
| wxRESIZE_BORDER, |
34 |
size = (400, 250)) |
35 |
|
36 |
#proj_ver = get_proj_version() |
37 |
#if proj_ver: |
38 |
#proj_ver = "%d.%d.%d" % proj_ver |
39 |
#else: |
40 |
#proj_ver = " - not available" |
41 |
|
42 |
#gtk_ver = get_gtk_version() |
43 |
#if gtk_ver: |
44 |
#gtk_ver = "%d.%d.%d" % gtk_ver |
45 |
#else: |
46 |
#gtk_ver = " - not available" |
47 |
|
48 |
text = _(#"Build Date: %s\n" |
49 |
"%s\n\n" |
50 |
"Currently using:\n" |
51 |
"\t%s\n" |
52 |
"\t%s\n" |
53 |
"\t%s\n" |
54 |
"\t%s\n" |
55 |
"\t%s\n\n" |
56 |
"Compiled against:\n" |
57 |
"\t%s\n" |
58 |
"\t%s\n\n" |
59 |
"Lead Developer:\n" |
60 |
"\tBernhard Herzog <[email protected]>\n\n" |
61 |
"Developers:\n" |
62 |
"\tJonathan Coles\n" |
63 |
"\tFrank Koormann\n" |
64 |
"\tBernhard Reiter\n" |
65 |
"\tJan-Oliver Wagner\n\n" |
66 |
"Contributors:\n" |
67 |
"\tJonathan Byron\n" |
68 |
"\tMartin Müller" |
69 |
% ("Thuban %s" % versions['thuban-long'], |
70 |
"wxPython %s" % versions['wxPython'], |
71 |
"Python %s" % versions['python'], |
72 |
"PySQLite %s" % versions['pysqlite'], |
73 |
"SQLite %s" % versions['sqlite'], |
74 |
"GDAL %s" % versions.get('gdal', " - not available"), |
75 |
"GTK %s" % versions.get('gtk', " - not available"), |
76 |
"proj %s" % versions['proj'])) |
77 |
|
78 |
self.text = text |
79 |
|
80 |
text_title = wxStaticText(self, -1, |
81 |
"Thuban is a program for exploring geographic data.\n\n" |
82 |
"Copyright 2001-2003 Intevation GmbH.\n" |
83 |
"Thuban is licensed under the GNU GPL", |
84 |
style=wxST_NO_AUTORESIZE|wxALIGN_CENTRE) |
85 |
|
86 |
textBox = wxTextCtrl(self, -1, text, |
87 |
style=wxTE_READONLY|wxTE_MULTILINE|wxTE_LINEWRAP) |
88 |
w, h = (300, 150) |
89 |
textBox.SetSizeHints(w, h) |
90 |
textBox.SetSize((w, h)) |
91 |
|
92 |
button_close = wxButton(self, wxID_CANCEL, _("Close")) |
93 |
button_close.SetDefault() |
94 |
|
95 |
sizer = wxBoxSizer(wxVERTICAL) |
96 |
sizer.Add(text_title, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 10) |
97 |
sizer.Add(textBox, 1, wxALL|wxEXPAND, 10) |
98 |
sizer.Add(button_close, 0, wxALL|wxALIGN_RIGHT, 10) |
99 |
|
100 |
self.SetAutoLayout(True) |
101 |
self.SetSizer(sizer) |
102 |
sizer.Fit(self) |
103 |
sizer.SetSizeHints(self) |
104 |
self.Layout() |
105 |
|
106 |
EVT_BUTTON(self, wxID_CANCEL, self.OnCancel) |
107 |
|
108 |
def OnCancel(self, event): |
109 |
self.EndModal(wxID_CANCEL) |
110 |
|
111 |
|