]>
Commit | Line | Data |
---|---|---|
1f780e48 RD |
1 | #---------------------------------------------------------------------------- |
2 | # Name: AboutDialog.py | |
3 | # Purpose: AboutBox which has copyright notice, license information, and credits | |
4 | # | |
5 | # Author: Morgan Hua | |
6 | # | |
7 | # Created: 3/22/05 | |
8 | # Copyright: (c) 2005 ActiveGrid, Inc. | |
9 | # CVS-ID: $Id$ | |
10 | # License: wxWindows License | |
11 | #---------------------------------------------------------------------------- | |
12 | ||
13 | import wx | |
14 | from IDE import ACTIVEGRID_BASE_IDE, getSplashBitmap | |
15 | _ = wx.GetTranslation | |
16 | ||
17 | #---------------------------------------------------------------------------- | |
18 | # Package License Data for AboutDialog | |
19 | # Package, License, URL | |
20 | # If no information is available, put a None as a place holder. | |
21 | #---------------------------------------------------------------------------- | |
22 | ||
23 | ||
24 | licenseData = [ | |
25 | ("ActiveGrid", "ASL 2.0", "http://apache.org/licenses/LICENSE-2.0"), | |
26 | ("Python 2.3", "Python Software Foundation License", "http://www.python.org/2.3/license.html"), | |
27 | ("wxPython 2.5", "wxWidgets 2 - LGPL", "http://wxwidgets.org/newlicen.htm"), | |
28 | ("wxWidgets", "wxWindows Library License 3", "http://www.wxwidgets.org/manuals/2.5.4/wx_wxlicense.html"), | |
29 | ("pychecker", "MetaSlash - BSD", "http://pychecker.sourceforge.net/COPYRIGHT"), | |
30 | ("process.py", "See file", "http://starship.python.net/~tmick/"), | |
31 | ] | |
32 | ||
33 | if not ACTIVEGRID_BASE_IDE: # add licenses for database connections only if not the base IDE | |
34 | licenseData += [ | |
35 | ("pydb2", "LGPL", "http://sourceforge.net/projects/pydb2"), | |
36 | ("pysqlite", "Python License (CNRI)", "http://sourceforge.net/projects/pysqlite"), | |
37 | ("mysql-python", "GPL, Python License (CNRI), Zope Public License", "http://sourceforge.net/projects/mysql-python"), | |
38 | ("cx_Oracle", "Computronix", "http://http://www.computronix.com/download/License(cxOracle).txt"), | |
39 | ("SQLite", "Public Domain", "http://www.sqlite.org/copyright.html"), | |
40 | ("PyGreSQL", "BSD", "http://www.pygresql.org"), | |
41 | ] | |
42 | ||
43 | if wx.Platform == '__WXMSW__': | |
44 | licenseData += [("pywin32", "Python Software Foundation License", "http://sourceforge.net/projects/pywin32/")] | |
45 | ||
46 | class AboutDialog(wx.Dialog): | |
47 | ||
48 | def __init__(self, parent): | |
49 | """ | |
50 | Initializes the about dialog. | |
51 | """ | |
52 | wx.Dialog.__init__(self, parent, -1, _("About ") + wx.GetApp().GetAppName(), style = wx.DEFAULT_DIALOG_STYLE) | |
53 | ||
54 | nb = wx.Notebook(self, -1) | |
55 | ||
56 | aboutPage = wx.Panel(nb, -1) | |
57 | sizer = wx.BoxSizer(wx.VERTICAL) | |
58 | splash_bmp = getSplashBitmap() | |
59 | image = wx.StaticBitmap(aboutPage, -1, splash_bmp, (0,0), (splash_bmp.GetWidth(), splash_bmp.GetHeight())) | |
60 | sizer.Add(image, 0, wx.ALIGN_CENTER|wx.ALL, 0) | |
61 | sizer.Add(wx.StaticText(aboutPage, -1, wx.GetApp().GetAppName() + _("\nVersion 0.6 Early Access\n\nCopyright (c) 2003-2005 ActiveGrid Incorporated and Contributors. All rights reserved.")), 0, wx.ALIGN_LEFT|wx.ALL, 10) | |
62 | sizer.Add(wx.StaticText(aboutPage, -1, _("http://www.activegrid.com")), 0, wx.ALIGN_LEFT|wx.LEFT|wx.BOTTOM, 10) | |
63 | aboutPage.SetSizer(sizer) | |
64 | nb.AddPage(aboutPage, _("Copyright")) | |
65 | ||
66 | licensePage = wx.Panel(nb, -1) | |
67 | grid = wx.grid.Grid(licensePage, -1) | |
68 | grid.CreateGrid(len(licenseData), 2) | |
69 | ||
70 | dc = wx.ClientDC(grid) | |
71 | dc.SetFont(grid.GetLabelFont()) | |
72 | grid.SetColLabelValue(0, _("License")) | |
73 | grid.SetColLabelValue(1, _("URL")) | |
74 | w, maxHeight = dc.GetTextExtent(_("License")) | |
75 | w, h = dc.GetTextExtent(_("URL")) | |
76 | if h > maxHeight: | |
77 | maxHeight = h | |
78 | grid.SetColLabelSize(maxHeight + 6) # add a 6 pixel margin | |
79 | ||
80 | for row, data in enumerate(licenseData): | |
81 | package = data[0] | |
82 | license = data[1] | |
83 | url = data[2] | |
84 | if package: | |
85 | grid.SetRowLabelValue(row, package) | |
86 | if license: | |
87 | grid.SetCellValue(row, 0, license) | |
88 | if url: | |
89 | grid.SetCellValue(row, 1, url) | |
90 | ||
91 | grid.EnableEditing(False) | |
92 | grid.EnableDragGridSize(False) | |
93 | grid.EnableDragColSize(False) | |
94 | grid.EnableDragRowSize(False) | |
95 | grid.SetRowLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTRE) | |
96 | grid.SetLabelBackgroundColour(wx.WHITE) | |
97 | grid.AutoSizeColumn(0, 100) | |
98 | grid.AutoSizeColumn(1, 100) | |
99 | sizer = wx.BoxSizer(wx.VERTICAL) | |
100 | sizer.Add(grid, 1, wx.EXPAND|wx.ALL, 10) | |
101 | licensePage.SetSizer(sizer) | |
102 | nb.AddPage(licensePage, _("Licenses")) | |
103 | ||
104 | creditsPage = wx.Panel(nb, -1) | |
105 | sizer = wx.BoxSizer(wx.VERTICAL) | |
106 | sizer.Add(wx.StaticText(creditsPage, -1, _("ActiveGrid Development Team:\n\nLawrence Bruhmuller\nEric Chu\nMatt Fryer\nJoel Hare\nMorgan Hua\nAlan Mullendore\nJeff Norton\nKevin Wang\nPeter Yared")), 0, wx.ALIGN_LEFT|wx.ALL, 10) | |
107 | creditsPage.SetSizer(sizer) | |
108 | nb.AddPage(creditsPage, _("Credits")) | |
109 | ||
110 | sizer = wx.BoxSizer(wx.VERTICAL) | |
111 | sizer.Add(nb, 0, wx.ALIGN_CENTRE|wx.ALL, 5) | |
112 | btn = wx.Button(self, wx.ID_OK) | |
113 | sizer.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5) | |
114 | ||
115 | self.SetSizer(sizer) | |
116 | self.SetAutoLayout(True) | |
117 | sizer.Fit(self) | |
118 | ||
119 |