Fix manual path generation

Originally committed to SVN as r6935.
This commit is contained in:
Thomas Goyne 2012-07-14 16:54:15 +00:00
parent 1ff1a57bdc
commit 291a4050d8
1 changed files with 5 additions and 3 deletions

View File

@ -59,9 +59,9 @@ static void init_static() {
pages = new std::map<wxString, wxString>; pages = new std::map<wxString, wxString>;
std::map<wxString, wxString> &page = *pages; std::map<wxString, wxString> &page = *pages;
page["Attachment Manager"] = "Attachment_Manager"; page["Attachment Manager"] = "Attachment_Manager";
page["Automation Manager"] = "Automation_Manager"; page["Automation Manager"] = "Automation/Manager";
page["Colour Picker"] = "Colour_Picker"; page["Colour Picker"] = "Colour_Picker";
page["Dummy Video"] = "Dummy_video"; page["Dummy Video"] = "Video#dummyvideo";
page["Export"] = "Exporting"; page["Export"] = "Exporting";
page["Fonts Collector"] = "Fonts_Collector"; page["Fonts Collector"] = "Fonts_Collector";
page["Kanji Timer"] = "Kanji_Timer"; page["Kanji Timer"] = "Kanji_Timer";
@ -95,6 +95,8 @@ void HelpButton::OpenPage(wxString const& pageID) {
init_static(); init_static();
wxString page = (*pages)[pageID]; wxString page = (*pages)[pageID];
wxString section;
page = page.BeforeFirst('#', &section);
wxFileName docFile(StandardPaths::DecodePath("?data/docs/"), page, "html", wxPATH_NATIVE); wxFileName docFile(StandardPaths::DecodePath("?data/docs/"), page, "html", wxPATH_NATIVE);
@ -106,7 +108,7 @@ void HelpButton::OpenPage(wxString const& pageID) {
// is safe with everything everyone uses. Blame Microsoft. // is safe with everything everyone uses. Blame Microsoft.
url = wxString("file://") + docFile.GetFullPath(wxPATH_NATIVE); url = wxString("file://") + docFile.GetFullPath(wxPATH_NATIVE);
else else
url = wxString::Format("http://docs.aegisub.org/manual/%s", page); url = wxString::Format("http://docs.aegisub.org/manual/%s/#%s", page, section);
wxLaunchDefaultBrowser(url); wxLaunchDefaultBrowser(url);
} }