1
/**********************************************************************
3
Audacity: A Digital Audio Editor
9
*******************************************************************//*!
12
\brief Glue code to connect to html help controller.
14
Audacity uses the wxWindows HTML help controller and gets the
15
HTML files from a zip archive with a "htb" extension, which
16
is supposed to stand for "HTML Book". It expects the help
17
file to be called "audacity-1.2-help.htb".
19
If you want to edit the help file, unzip audacity-1.2-help.htb
20
(rename it to audacity-1.2-help.zip first if you have to), edit
21
the files, and then zip them again. Audacity asks the user
22
for the location of the help file the first time (if necessary)
23
and then remembers it from then on.
25
*//*******************************************************************/
30
#include <wx/filedlg.h>
31
#include <wx/msgdlg.h>
32
#include <wx/textdlg.h>
33
#include <wx/html/helpctrl.h>
36
#include "AudacityApp.h"
41
wxHtmlHelpController *gHelp = NULL;
43
void InitHelp(wxWindow * parent)
47
wxArrayString helpFiles;
49
wxGetApp().FindFilesInPathList(wxT("audacity-1.2-help.htb"),
50
wxGetApp().audacityPathList,
54
if (helpFiles.GetCount() > 0)
55
defaultLoc = helpFiles[0];
57
defaultLoc = wxT(INSTALL_PREFIX);
58
defaultLoc += wxT("/share/audacity/audacity-1.2-help.htb");
61
wxString helpFilePath =
62
gPrefs->Read(wxT("/Help/HelpFilePath1.2"), defaultLoc);
64
if (!::wxFileExists(helpFilePath)) {
65
helpFilePath = defaultLoc;
67
if (!::wxFileExists(helpFilePath)) {
68
helpFilePath = wxFileSelector(_("Where is audacity-1.2-help.htb?"), NULL,
69
wxT("audacity-1.2-help.htb"), // Name
71
_("HTML Help Books (*.htb)|*.htb"),
73
if (helpFilePath == wxT(""))
77
gHelp = new wxHtmlHelpController();
78
if (!gHelp->AddBook(helpFilePath)) {
79
wxMessageBox(_("Couldn't open the Audacity Help file."));
84
gPrefs->Write(wxT("/Help/HelpFilePath1.2"), helpFilePath);
88
void ShowHelp(wxWindow * parent)
93
gHelp->Display(wxT("contents.htm"));
96
void ShowHelpIndex(wxWindow * parent)
101
gHelp->DisplayIndex();
104
void ShowHelp(wxWindow * parent, wxString topic)
109
gHelp->KeywordSearch(topic);
112
void SearchHelp(wxWindow * parent)
117
wxString key = wxGetTextFromUser(_("Search for?"),
118
_("Search help for keyword"),
123
gHelp->KeywordSearch(key);
135
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
136
// version control system. Please do not modify past this point.
140
// indent-tabs-mode: nil
143
// vim: et sts=3 sw=3
144
// arch-tag: 6165cbc3-295a-4e52-b76c-825123aa7935