1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-13 08:06:32 +01:00

Use alpha or released or local manual for "help on selection".

Previously this was hard coded to use the online alphamanual.
Some other help-on-errors paths were hardcoded to use the online manual, and did not use local help even if available, so these were changed too.

Also two naming changes in the code:
ShowHelpDialog() became ShowHelp() because it typically shows the help in your browser, only showing the help in a dialog under certain circumstances.
The helpURL parameter became helpPage since it is usually a page name that is then elaborated into a url.
The Link() function became InnerLink().

Some careful http -> https changes made too.
This commit is contained in:
James Crook
2017-08-25 13:54:37 +01:00
parent 4a0a7efd84
commit ce9938787c
18 changed files with 74 additions and 75 deletions

View File

@@ -95,6 +95,7 @@ CommandManager. It holds the callback for one command.
#include "../effects/EffectManager.h"
#include "../widgets/LinkingHtmlWindow.h"
#include "../widgets/ErrorDialog.h"
#include "../widgets/HelpSystem.h"
// On wxGTK, there may be many many many plugins, but the menus don't automatically
// allow for scrolling, so we build sub-menus. If the menu gets longer than
@@ -1232,7 +1233,7 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
wxString reason = _("There was a problem with your last action. If you think\nthis is a bug, please tell us exactly where it occurred.");
// The default title string is 'Disallowed'.
wxString title = _("Disallowed");
wxString help_url ="";
wxString helpPage ="";
auto missingFlags = flagsRequired & (~flagsGot );
if( missingFlags & AudioIONotBusyFlag )
@@ -1263,7 +1264,7 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
), Name );
#endif
#endif
help_url = "http://alphamanual.audacityteam.org/man/Selecting_Audio_-_the_basics";
helpPage = "Selecting_Audio_-_the_basics";
}
else if( missingFlags & WaveTracksSelectedFlag)
reason = _("You must first select some audio to perform this action.\n(Selecting other kinds of track won't work.)");
@@ -1277,30 +1278,13 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
else if( missingFlags == TrackPanelHasFocus )
return;
#if 0
// Does not have the warning icon...
ShowErrorDialog(
NULL,
title,
reason,
help_url,
helpPage,
false);
#endif
// JKC: I tried building a custom error dialog with the warning icon, and a
// help button linking to our html (without closing).
// In the end I decided it was easier (more portable across different
// OS's) to use the stock one.
int result = ::wxMessageBox(reason, title, wxICON_WARNING | wxOK |
(help_url.IsEmpty() ? 0 : wxHELP) );
// if they click help, we fetch that help, and pop the dialog (without a
// help button) up again.
if( result == wxHELP ){
wxHtmlLinkInfo link( help_url );
OpenInDefaultBrowser(link);
::wxMessageBox(reason, title, wxICON_WARNING | wxOK );
}
}
wxString CommandManager::DescribeCommandsAndShortcuts