#
# This file is part of Documancer (http://documancer.sf.net)
#
# Copyright (C) 2004 Vaclav Slavik
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: AboutBox.py,v 1.7 2004/12/26 21:46:27 vaclavslavik Exp $
#
# About box with information about used plugins
import wxPython
from wxPython.wx import *
from wxPython.html import *
from wxPython.lib.ClickableHtmlWindow import *
import HtmlBrowser, indexer
# ---------------------------------------------------------------------------
# Dependencies information
# ---------------------------------------------------------------------------
# Generates HTML page with brief listing of Documancer's dependencies and
# how are they resolved:
def GetDependenciesPage():
str = """
"""
def package(name, version, good='', help=''):
text = '
%s:
| ' % name
hlpstr = ''
if version.find(good) == -1:
text += '%s' % version
if help != '':
text += ' (%s)' % help
else:
text += version
text += ' |
'
return text
str += package('Fulltext search',
indexer.getFulltextIndexer().getNameAndVersion(),
good='PyLucene',
help="""Installing PyLucene
http://pylucene.osafoundation.org/
is recommended for best performance.""")
str += package('HTML browser', HtmlBrowser.browserVersion,
good='Mozilla',
help="""Documancer looks best when using Mozilla. Please
install wxMozilla from
http://wxmozilla.sourceforge.net to use it.""")
str += package('wxPython', wxPython.__version__,
good='2.5',
help='wxPython >= 2.5.3 is recommended')
str += '
'
return str
# ---------------------------------------------------------------------------
# Information about loaded plugins
# ---------------------------------------------------------------------------
# Generates HTML page with brief listing of Documancer's loaded plugins:
def GetPluginsPage():
str = """
Documentation providers:
"""
def provider(name, desc=''):
text = '
%s:
' % name
if desc != '':
text += """'
return text
import providers
for p in providers.providers.values():
str += provider(p.getID(), p.getDescription())
str += '
'
return str
# ---------------------------------------------------------------------------
# About box dialog
# ---------------------------------------------------------------------------
class AboutBox(wxDialog):
def __init__(self, *args, **kwds):
# begin wxGlade: AboutBox.__init__
kwds["style"] = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
wxDialog.__init__(self, *args, **kwds)
self.notebook_1 = wxNotebook(self, -1, style=0)
self.about_panel = wxPanel(self.notebook_1, -1)
self.html_about = wxPyClickableHtmlWindow(self.about_panel, -1)
self.static_line_2 = wxStaticLine(self, -1)
self.ok = wxButton(self, wxID_OK, "&OK")
self.deps = wxPyClickableHtmlWindow(self.notebook_1, -1)
self.plugins = wxPyClickableHtmlWindow(self.notebook_1, -1)
self.__set_properties()
self.__do_layout()
# end wxGlade
try:
self.deps.SetStandardFonts()
self.plugins.SetStandardFonts()
self.html_about.SetStandardFonts()
except AttributeError:
pass # SetStandardFonts is wxPython>=2.5.3 only
self.html_about.LoadPage('data/aboutbox.html')
self.deps.SetPage(GetDependenciesPage())
self.plugins.SetPage(GetPluginsPage())
self.SetSize((600, 500))
def __set_properties(self):
# begin wxGlade: AboutBox.__set_properties
self.SetTitle("About Documancer")
# end wxGlade
def __do_layout(self):
# begin wxGlade: AboutBox.__do_layout
sizer_8 = wxBoxSizer(wxVERTICAL)
sizer_13 = wxBoxSizer(wxHORIZONTAL)
sizer_15 = wxBoxSizer(wxHORIZONTAL)
sizer_15.Add(self.html_about, 1, wxALL|wxEXPAND, 5)
self.about_panel.SetAutoLayout(1)
self.about_panel.SetSizer(sizer_15)
sizer_15.Fit(self.about_panel)
sizer_15.SetSizeHints(self.about_panel)
self.notebook_1.AddPage(self.about_panel, "About")
self.notebook_1.AddPage(self.deps, "Dependencies")
self.notebook_1.AddPage(self.plugins, "Plugins")
sizer_8.Add(wxNotebookSizer(self.notebook_1), 1, wxALL|wxEXPAND, 6)
sizer_8.Add(self.static_line_2, 0, wxLEFT|wxRIGHT|wxEXPAND, 8)
sizer_13.Add(self.ok, 0, 0, 0)
sizer_8.Add(sizer_13, 0, wxALL|wxALIGN_RIGHT, 6)
self.SetAutoLayout(1)
self.SetSizer(sizer_8)
sizer_8.Fit(self)
sizer_8.SetSizeHints(self)
self.Layout()
# end wxGlade
# end of class AboutBox