1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-09 16:41:14 +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"))
{
/// TO-DO: Make the links to help here use the widgets/HelpSystem mechanism
/// so that they are consistent
/* i18n-hint: Preserve [[file:quick_help.html as it's the name of a file.*/
/* i18n-hint: Preserve '[[help:Quick_Help|' as it's the name of a link.*/
/* i18n-hint: Preserve '[[help:Main_Page|' as it's the name of a link.*/
wxString result =
wxString(wxT("")) +
#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>") +
_("How to get help") + wxT("</h3></center>") +
_("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>") +
_(" [[file:index.html|Manual]] - if not installed locally, [[https://manual.audacityteam.org/|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>") +
_(" [[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>") +
_("More:</b> Visit our [[https://wiki.audacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.") + wxT("</p>");
#endif

View File

@ -524,7 +524,13 @@ LinkingHtmlWindow::LinkingHtmlWindow(wxWindow *parent, wxWindowID id /*= -1*/,
void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{
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 =
wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath();
@ -553,10 +559,14 @@ void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
OpenInDefaultBrowser(link);
return;
}
BrowserDialog * pDlg = wxDynamicCast(
GetRelatedFrame()->FindWindow(BrowserDialog::ID), BrowserDialog );
if( pDlg )
{
pDlg->UpdateButtons();
};
wxFrame * pFrame = GetRelatedFrame();
if( !pFrame )
return;
wxWindow * pWnd = pFrame->FindWindow(BrowserDialog::ID);
if( !pWnd )
return;
BrowserDialog * pDlg = wxDynamicCast( pWnd , BrowserDialog );
if( !pDlg )
return;
pDlg->UpdateButtons();
}