1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-10 17:11:17 +02:00

Bug 169 - Welcome Message: Local links to "Quick Help" and "Manual" do nothing if help is not installed.

This commit is contained in:
James Crook 2019-08-20 22:29:18 +01:00
parent efc95152d5
commit 80ef424338
2 changed files with 21 additions and 12 deletions

View File

@ -210,9 +210,8 @@ static wxString HelpTextBuiltIn( const wxString & Key )
if (Key == wxT("welcome")) if (Key == wxT("welcome"))
{ {
/// TO-DO: Make the links to help here use the widgets/HelpSystem mechanism /* i18n-hint: Preserve '[[help:Quick_Help|' as it's the name of a link.*/
/// so that they are consistent /* i18n-hint: Preserve '[[help:Main_Page|' as it's the name of a link.*/
/* i18n-hint: Preserve [[file:quick_help.html as it's the name of a file.*/
wxString result = wxString result =
wxString(wxT("")) + wxString(wxT("")) +
#if defined(IS_ALPHA) || defined(IS_BETA) #if defined(IS_ALPHA) || defined(IS_BETA)
@ -244,8 +243,8 @@ static wxString HelpTextBuiltIn( const wxString & Key )
wxT("<center><h3>Audacity ") + AUDACITY_VERSION_STRING + wxT("</h3><h3>") + wxT("<center><h3>Audacity ") + AUDACITY_VERSION_STRING + wxT("</h3><h3>") +
_("How to get help") + wxT("</h3></center>") + _("How to get help") + wxT("</h3></center>") +
_("These are our support methods:") + wxT("<p><ul><li>") + _("These are our support methods:") + wxT("<p><ul><li>") +
_(" [[file:quick_help.html|Quick Help]] - if not installed locally, [[https://manual.audacityteam.org/quick_help.html|view online]]") + wxT("</li><li>") + _("[[help:Quick_Help|Quick Help]] - if not installed locally, [[https://manual.audacityteam.org/quick_help.html|view online]]") + wxT("</li><li>") +
_(" [[file:index.html|Manual]] - if not installed locally, [[https://manual.audacityteam.org/|view online]]") + wxT("</li><li>") + _(" [[help:Main_Page|Manual]] - if not installed locally, [[https://manual.audacityteam.org/|view online]]") + wxT("</li><li>") +
_(" [[https://forum.audacityteam.org/|Forum]] - ask your question directly, online.") + wxT("</li></ul></p><p>") + wxT("<b>") + _(" [[https://forum.audacityteam.org/|Forum]] - ask your question directly, online.") + wxT("</li></ul></p><p>") + wxT("<b>") +
_("More:</b> Visit our [[https://wiki.audacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.") + wxT("</p>"); _("More:</b> Visit our [[https://wiki.audacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.") + wxT("</p>");
#endif #endif

View File

@ -524,7 +524,13 @@ LinkingHtmlWindow::LinkingHtmlWindow(wxWindow *parent, wxWindowID id /*= -1*/,
void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{ {
wxString href = link.GetHref(); wxString href = link.GetHref();
if( href.StartsWith(wxT("innerlink:")) )
if( href.StartsWith( wxT("innerlink:help:")))
{
HelpSystem::ShowHelp(this, href.Mid( 15 ), true );
return;
}
else if( href.StartsWith(wxT("innerlink:")) )
{ {
wxString FileName = wxString FileName =
wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath(); wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath();
@ -553,10 +559,14 @@ void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
OpenInDefaultBrowser(link); OpenInDefaultBrowser(link);
return; return;
} }
BrowserDialog * pDlg = wxDynamicCast( wxFrame * pFrame = GetRelatedFrame();
GetRelatedFrame()->FindWindow(BrowserDialog::ID), BrowserDialog ); if( !pFrame )
if( pDlg ) return;
{ wxWindow * pWnd = pFrame->FindWindow(BrowserDialog::ID);
pDlg->UpdateButtons(); if( !pWnd )
}; return;
BrowserDialog * pDlg = wxDynamicCast( pWnd , BrowserDialog );
if( !pDlg )
return;
pDlg->UpdateButtons();
} }