Pass TranslatableString to help, warning, and error dialogs

This commit is contained in:
Paul Licameli 2019-12-05 13:38:07 -05:00
parent 5909f67fdb
commit 2007346551
20 changed files with 72 additions and 68 deletions

View File

@ -1056,7 +1056,7 @@ void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event))
window.Iconize(false); window.Iconize(false);
window.Raise(); window.Raise();
wxString errorMessage = wxString::Format(_( auto errorMessage = XO(
"One or more external audio files could not be found.\n\ "One or more external audio files could not be found.\n\
It is possible they were moved, deleted, or the drive they \ It is possible they were moved, deleted, or the drive they \
were on was unmounted.\n\ were on was unmounted.\n\
@ -1065,7 +1065,7 @@ The first detected missing file is:\n\
%s\n\ %s\n\
There may be additional missing files.\n\ There may be additional missing files.\n\
Choose Help > Diagnostics > Check Dependencies to view a list of \ Choose Help > Diagnostics > Check Dependencies to view a list of \
locations of the missing files."), missingFileName); locations of the missing files.").Format( missingFileName ) ;
// if an old dialog exists, raise it if it is // if an old dialog exists, raise it if it is
if ( auto dialog = MissingAliasFilesDialog::Find( *offendingProject ) ) if ( auto dialog = MissingAliasFilesDialog::Find( *offendingProject ) )

View File

@ -1435,7 +1435,8 @@ void AudioIO::StartMonitoring( const AudioIOStartStreamOptions &options )
captureFormat); captureFormat);
if (!success) { if (!success) {
wxString msg = wxString::Format(_("Error opening recording device.\nError code: %s"), Get()->LastPaErrorString()); auto msg = XO("Error opening recording device.\nError code: %s")
.Format( Get()->LastPaErrorString() );
ShowErrorDialog( FindProjectFrame( mOwningProject ), ShowErrorDialog( FindProjectFrame( mOwningProject ),
XO("Error"), msg, wxT("Error_opening_sound_device")); XO("Error"), msg, wxT("Error_opening_sound_device"));
return; return;

View File

@ -432,7 +432,7 @@ DirManager::DirManager()
if (wxGetDiskSpace(globaltemp, NULL, &freeSpace)) { if (wxGetDiskSpace(globaltemp, NULL, &freeSpace)) {
if (freeSpace < wxLongLong(wxLL(100 * 1048576))) { if (freeSpace < wxLongLong(wxLL(100 * 1048576))) {
ShowWarningDialog(NULL, wxT("DiskSpaceWarning"), ShowWarningDialog(NULL, wxT("DiskSpaceWarning"),
_("There is very little free disk space left on this volume.\nPlease select another temporary directory in Preferences.")); XO("There is very little free disk space left on this volume.\nPlease select another temporary directory in Preferences."));
} }
} }
} }

View File

@ -737,6 +737,6 @@ void MenuManager::TellUserWhyDisallowed(
ShowErrorDialog( ShowErrorDialog(
NULL, NULL,
untranslatedTitle, untranslatedTitle,
reason.Translation(), reason,
helpPage); helpPage);
} }

View File

@ -26,7 +26,7 @@ class MissingAliasFileDialog final : public ErrorDialog
public: public:
MissingAliasFileDialog(wxWindow *parent, MissingAliasFileDialog(wxWindow *parent,
const TranslatableString & dlogTitle, const TranslatableString & dlogTitle,
const wxString & message, const TranslatableString & message,
const wxString & helpURL, const wxString & helpURL,
const bool Close = true, const bool modal = true); const bool Close = true, const bool modal = true);
virtual ~MissingAliasFileDialog(); virtual ~MissingAliasFileDialog();
@ -35,7 +35,7 @@ class MissingAliasFileDialog final : public ErrorDialog
MissingAliasFileDialog::MissingAliasFileDialog(wxWindow *parent, MissingAliasFileDialog::MissingAliasFileDialog(wxWindow *parent,
const TranslatableString & dlogTitle, const TranslatableString & dlogTitle,
const wxString & message, const TranslatableString & message,
const wxString & helpURL, const wxString & helpURL,
const bool Close, const bool modal) const bool Close, const bool modal)
: ErrorDialog( parent, : ErrorDialog( parent,
@ -66,7 +66,7 @@ namespace MissingAliasFilesDialog {
void Show(AudacityProject *project, void Show(AudacityProject *project,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
const bool Close) const bool Close)
{ {

View File

@ -5,6 +5,7 @@ class AliasBlockFile;
class AudacityProject; class AudacityProject;
class TranslatableString; class TranslatableString;
class wxDialog; class wxDialog;
class TranslatableString;
#include <memory> #include <memory>
#include <utility> #include <utility>
@ -34,7 +35,7 @@ bool ShouldShow();
/// Displays a custom modeless error dialog for aliased file errors /// Displays a custom modeless error dialog for aliased file errors
void Show(AudacityProject *parent, void Show(AudacityProject *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
const bool Close = true); const bool Close = true);

View File

@ -259,7 +259,7 @@ int ProjectAudioManager::PlayPlayRegion(const SelectedRegion &selectedRegion,
window.CallAfter( [&]{ window.CallAfter( [&]{
// Show error message if stream could not be opened // Show error message if stream could not be opened
ShowErrorDialog(&window, XO("Error"), ShowErrorDialog(&window, XO("Error"),
_("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."), XO("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
wxT("Error_opening_sound_device")); wxT("Error_opening_sound_device"));
}); });
} }
@ -711,7 +711,8 @@ bool ProjectAudioManager::DoRecord(AudacityProject &project,
CancelRecording(); CancelRecording();
// Show error message if stream could not be opened // Show error message if stream could not be opened
wxString msg = wxString::Format(_("Error opening recording device.\nError code: %s"), gAudioIO->LastPaErrorString()); auto msg = XO("Error opening recording device.\nError code: %s")
.Format( gAudioIO->LastPaErrorString() );
ShowErrorDialog(&GetProjectFrame( mProject ), ShowErrorDialog(&GetProjectFrame( mProject ),
XO("Error"), msg, wxT("Error_opening_sound_device")); XO("Error"), msg, wxT("Error_opening_sound_device"));
} }
@ -858,7 +859,7 @@ void ProjectAudioManager::OnAudioIOStopRecording()
SelectedRegion{ interval.first, SelectedRegion{ interval.first,
interval.first + interval.second }, interval.first + interval.second },
wxString::Format(wxT("%ld"), counter++)); wxString::Format(wxT("%ld"), counter++));
ShowWarningDialog(&window, wxT("DropoutDetected"), _("\ ShowWarningDialog(&window, wxT("DropoutDetected"), XO("\
Recorded audio was lost at the labeled locations. Possible causes:\n\ Recorded audio was lost at the labeled locations. Possible causes:\n\
\n\ \n\
Other applications are competing with Audacity for processor time\n\ Other applications are competing with Audacity for processor time\n\
@ -867,7 +868,7 @@ You are saving directly to a slow external storage device\n\
" "
), ),
false, false,
_("Turn off dropout detection")); XO("Turn off dropout detection"));
} }
auto &history = ProjectHistory::Get( project ); auto &history = ProjectHistory::Get( project );

View File

@ -798,14 +798,14 @@ bool ProjectFileManager::SaveAs(bool bWantSaveCopy /*= false*/, bool bLossless /
} }
TranslatableString title; TranslatableString title;
wxString message; TranslatableString message;
if (bWantSaveCopy) if (bWantSaveCopy)
{ {
if (bLossless) if (bLossless)
{ {
title = XO("%sSave Lossless Copy of Project \"%s\" As...") title = XO("%sSave Lossless Copy of Project \"%s\" As...")
.Format( Restorer.sProjNumber,Restorer.sProjName ); .Format( Restorer.sProjNumber,Restorer.sProjName );
message = _("\ message = XO("\
'Save Lossless Copy of Project' is for an Audacity project, not an audio file.\n\ 'Save Lossless Copy of Project' is for an Audacity project, not an audio file.\n\
For an audio file that will open in other apps, use 'Export'.\n\n\ For an audio file that will open in other apps, use 'Export'.\n\n\
\ \
@ -816,7 +816,7 @@ with no loss of quality, but the projects are large.\n");
{ {
title = XO("%sSave Compressed Copy of Project \"%s\" As...") title = XO("%sSave Compressed Copy of Project \"%s\" As...")
.Format( Restorer.sProjNumber, Restorer.sProjName ); .Format( Restorer.sProjNumber, Restorer.sProjName );
message = _("\ message = XO("\
'Save Compressed Copy of Project' is for an Audacity project, not an audio file.\n\ 'Save Compressed Copy of Project' is for an Audacity project, not an audio file.\n\
For an audio file that will open in other apps, use 'Export'.\n\n\ For an audio file that will open in other apps, use 'Export'.\n\n\
\ \
@ -828,7 +828,7 @@ but they have some loss of fidelity.\n");
{ {
title = XO("%sSave Project \"%s\" As...") title = XO("%sSave Project \"%s\" As...")
.Format( Restorer.sProjNumber, Restorer.sProjName ); .Format( Restorer.sProjNumber, Restorer.sProjName );
message = _("\ message = XO("\
'Save Project' is for an Audacity project, not an audio file.\n\ 'Save Project' is for an Audacity project, not an audio file.\n\
For an audio file that will open in other apps, use 'Export'.\n"); For an audio file that will open in other apps, use 'Export'.\n");
} }
@ -1561,7 +1561,7 @@ void ProjectFileManager::OpenFile(const FilePath &fileNameArg, bool addtohistory
ShowErrorDialog( ShowErrorDialog(
&window, &window,
XO("Error Opening Project"), XO("Error Opening Project"),
errorStr.Translation(), errorStr,
results.helpUrl); results.helpUrl);
} }
} }
@ -1703,7 +1703,7 @@ bool ProjectFileManager::Import(
// Error message derived from Importer::Import // Error message derived from Importer::Import
// Additional help via a Help button links to the manual. // Additional help via a Help button links to the manual.
ShowErrorDialog(&GetProjectFrame( project ), XO("Error Importing"), ShowErrorDialog(&GetProjectFrame( project ), XO("Error Importing"),
errorMessage.Translation(), wxT("Importing_Audio")); errorMessage, wxT("Importing_Audio"));
} }
if (!success) if (!success)
return false; return false;

View File

@ -2441,7 +2441,7 @@ void Effect::Preview(bool dryOnly)
} }
else { else {
ShowErrorDialog(FocusDialog, XO("Error"), ShowErrorDialog(FocusDialog, XO("Error"),
_("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."), XO("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
wxT("Error_opening_sound_device")); wxT("Error_opening_sound_device"));
} }
} }

View File

@ -1777,9 +1777,9 @@ bool EffectEqualization::GetDefaultFileName(wxFileName &fileName)
if( !fileName.FileExists() ) if( !fileName.FileExists() )
{ {
// LLL: Is there really a need for an error message at all??? // LLL: Is there really a need for an error message at all???
//wxString errorMessage; //auto errorMessage = XO("EQCurves.xml and EQDefaultCurves.xml were not found on your system.\nPlease press 'help' to visit the download page.\n\nSave the curves at %s")
//errorMessage.Printf(_("EQCurves.xml and EQDefaultCurves.xml were not found on your system.\nPlease press 'help' to visit the download page.\n\nSave the curves at %s"), FileNames::DataDir()); // .Format( FileNames::DataDir() );
//ShowErrorDialog(mUIParent, _("EQCurves.xml and EQDefaultCurves.xml missing"), //ShowErrorDialog(mUIParent, XO("EQCurves.xml and EQDefaultCurves.xml missing"),
// errorMessage, wxT("http://wiki.audacityteam.org/wiki/EQCurvesDownload"), false); // errorMessage, wxT("http://wiki.audacityteam.org/wiki/EQCurvesDownload"), false);
// Have another go at finding EQCurves.xml in the data dir, in case 'help' helped // Have another go at finding EQCurves.xml in the data dir, in case 'help' helped

View File

@ -883,21 +883,21 @@ bool Exporter::CheckMix()
if (exportedChannels == 1) { if (exportedChannels == 1) {
if (ShowWarningDialog(pWindow, if (ShowWarningDialog(pWindow,
wxT("MixMono"), wxT("MixMono"),
_("Your tracks will be mixed down and exported as one mono file."), XO("Your tracks will be mixed down and exported as one mono file."),
true) == wxID_CANCEL) true) == wxID_CANCEL)
return false; return false;
} }
else if (exportedChannels == 2) { else if (exportedChannels == 2) {
if (ShowWarningDialog(pWindow, if (ShowWarningDialog(pWindow,
wxT("MixStereo"), wxT("MixStereo"),
_("Your tracks will be mixed down and exported as one stereo file."), XO("Your tracks will be mixed down and exported as one stereo file."),
true) == wxID_CANCEL) true) == wxID_CANCEL)
return false; return false;
} }
else { else {
if (ShowWarningDialog(pWindow, if (ShowWarningDialog(pWindow,
wxT("MixUnknownChannels"), wxT("MixUnknownChannels"),
_("Your tracks will be mixed down to one exported file according to the encoder settings."), XO("Your tracks will be mixed down to one exported file according to the encoder settings."),
true) == wxID_CANCEL) true) == wxID_CANCEL)
return false; return false;
} }

View File

@ -606,16 +606,16 @@ void ExportMultipleDialog::OnExport(wxCommandEvent& WXUNUSED(event))
// Give 'em the result // Give 'em the result
auto cleanup = finally( [&] auto cleanup = finally( [&]
{ {
wxString msg; auto msg = (ok == ProgressResult::Success
msg.Printf( ? XO("Successfully exported the following %lld file(s).")
ok == ProgressResult::Success ? _("Successfully exported the following %lld file(s).") : ok == ProgressResult::Failed
: (ok == ProgressResult::Failed ? _("Something went wrong after exporting the following %lld file(s).") ? XO("Something went wrong after exporting the following %lld file(s).")
: (ok == ProgressResult::Cancelled ? _("Export canceled after exporting the following %lld file(s).") : ok == ProgressResult::Cancelled
: (ok == ProgressResult::Stopped ? _("Export stopped after exporting the following %lld file(s).") ? XO("Export canceled after exporting the following %lld file(s).")
: _("Something went really wrong after exporting the following %lld file(s).") : ok == ProgressResult::Stopped
) ? XO("Export stopped after exporting the following %lld file(s).")
) : XO("Something went really wrong after exporting the following %lld file(s).")
), (long long) mExported.size()); ).Format((long long) mExported.size());
wxString FileList; wxString FileList;
for (size_t i = 0; i < mExported.size(); i++) { for (size_t i = 0; i < mExported.size(); i++) {

View File

@ -401,8 +401,8 @@ ExportPCM::ExportPCM()
void ExportPCM::ReportTooBigError(wxWindow * pParent) void ExportPCM::ReportTooBigError(wxWindow * pParent)
{ {
//Temporary translation hack, to say 'WAV or AIFF' rather than 'WAV' //Temporary translation hack, to say 'WAV or AIFF' rather than 'WAV'
wxString message = auto message =
_("You have attempted to Export a WAV or AIFF file which would be greater than 4GB.\n" XO("You have attempted to Export a WAV or AIFF file which would be greater than 4GB.\n"
"Audacity cannot do this, the Export was abandoned."); "Audacity cannot do this, the Export was abandoned.");
ShowErrorDialog(pParent, XO("Error Exporting"), message, ShowErrorDialog(pParent, XO("Error Exporting"), message,
@ -412,7 +412,7 @@ void ExportPCM::ReportTooBigError(wxWindow * pParent)
// compute the size in advance. // compute the size in advance.
#if 0 #if 0
ShowErrorDialog(pParent, XO("Error Exporting"), ShowErrorDialog(pParent, XO("Error Exporting"),
_("Your exported WAV file has been truncated as Audacity cannot export WAV\n" XO("Your exported WAV file has been truncated as Audacity cannot export WAV\n"
"files bigger than 4GB."), "files bigger than 4GB."),
wxT("Size_limits_for_WAV_files")); wxT("Size_limits_for_WAV_files"));
#endif #endif

View File

@ -364,11 +364,10 @@ void OnPunchAndRoll(const CommandContext &context)
std::max(0L, gPrefs->Read(wxT("/AudioIO/RecordChannels"), 2)); std::max(0L, gPrefs->Read(wxT("/AudioIO/RecordChannels"), 2));
auto message = auto message =
(recordingChannels == 1) (recordingChannels == 1)
? _("Please select in a mono track.") ? XO("Please select in a mono track.")
: (recordingChannels == 2) : (recordingChannels == 2)
? _("Please select in a stereo track.") ? XO("Please select in a stereo track.")
: wxString::Format( : XO("Please select at least %d channels.").Format( recordingChannels );
_("Please select at least %d channels."), recordingChannels);
ShowErrorDialog(&window, XO("Error"), message, url); ShowErrorDialog(&window, XO("Error"), message, url);
return; return;
} }
@ -410,7 +409,7 @@ void OnPunchAndRoll(const CommandContext &context)
} }
if (error) { if (error) {
auto message = _("Please select a time within a clip."); auto message = XO("Please select a time within a clip.");
ShowErrorDialog( &window, XO("Error"), message, url); ShowErrorDialog( &window, XO("Error"), message, url);
return; return;
} }

View File

@ -43,7 +43,7 @@ END_EVENT_TABLE()
ErrorDialog::ErrorDialog( ErrorDialog::ErrorDialog(
wxWindow *parent, wxWindow *parent,
const TranslatableString & dlogTitle, const TranslatableString & dlogTitle,
const wxString & message, const TranslatableString & message,
const wxString & helpPage, const wxString & helpPage,
const bool Close, const bool modal): const bool Close, const bool modal):
wxDialogWrapper(parent, (wxWindowID)-1, dlogTitle) wxDialogWrapper(parent, (wxWindowID)-1, dlogTitle)
@ -63,7 +63,7 @@ ErrorDialog::ErrorDialog(
S.StartVerticalLay(); S.StartVerticalLay();
{ {
S.SetBorder( 20 ); S.SetBorder( 20 );
S.AddFixedText( message ); S.AddFixedText( message.Translation() );
S.SetBorder( 2 ); S.SetBorder( 2 );
S.AddStandardButtons( buttonMask ); S.AddStandardButtons( buttonMask );
} }
@ -104,7 +104,7 @@ void ErrorDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
void ShowErrorDialog(wxWindow *parent, void ShowErrorDialog(wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
const bool Close) const bool Close)
{ {
@ -117,7 +117,7 @@ void ShowErrorDialog(wxWindow *parent,
// unused. // unused.
void ShowModelessErrorDialog(wxWindow *parent, void ShowModelessErrorDialog(wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
const bool Close) const bool Close)
{ {

View File

@ -28,7 +28,7 @@ public:
// constructors and destructors // constructors and destructors
ErrorDialog(wxWindow *parent, ErrorDialog(wxWindow *parent,
const TranslatableString & dlogTitle, const TranslatableString & dlogTitle,
const wxString & message, const TranslatableString & message,
const wxString & helpPage, const wxString & helpPage,
const bool Close = true, const bool modal = true); const bool Close = true, const bool modal = true);
@ -47,14 +47,14 @@ private:
/// Displays an error dialog with a button that offers help /// Displays an error dialog with a button that offers help
void ShowErrorDialog(wxWindow *parent, void ShowErrorDialog(wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
bool Close = true); bool Close = true);
/// Displays a modeless error dialog with a button that offers help /// Displays a modeless error dialog with a button that offers help
void ShowModelessErrorDialog(wxWindow *parent, void ShowModelessErrorDialog(wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &message, const TranslatableString &message,
const wxString &helpPage, const wxString &helpPage,
bool Close = true); bool Close = true);

View File

@ -91,7 +91,7 @@ public:
/// handled by having the code in one place. /// handled by having the code in one place.
void HelpSystem::ShowInfoDialog( wxWindow *parent, void HelpSystem::ShowInfoDialog( wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &shortMsg, const TranslatableString &shortMsg,
const wxString &message, const wxString &message,
const int xSize, const int ySize) const int xSize, const int ySize)
{ {
@ -105,7 +105,7 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent,
S.StartVerticalLay(1); S.StartVerticalLay(1);
{ {
S.AddTitle( shortMsg); S.AddTitle( shortMsg.Translation() );
S.Style( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | S.Style( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL ) wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL )
.AddTextWindow(message); .AddTextWindow(message);

View File

@ -38,10 +38,10 @@ class AudacityProject;
class HelpSystem class HelpSystem
{ {
public: public:
/// Displays cutable information in a text ctrl, with an OK button. /// Displays cuttable information in a text ctrl, with an OK button.
static void ShowInfoDialog( wxWindow *parent, static void ShowInfoDialog( wxWindow *parent,
const TranslatableString &dlogTitle, const TranslatableString &dlogTitle,
const wxString &shortMsg, const TranslatableString &shortMsg,
const wxString &message, const wxString &message,
const int xSize, const int ySize); const int xSize, const int ySize);

View File

@ -35,8 +35,8 @@ class WarningDialog final : public wxDialogWrapper
public: public:
// constructors and destructors // constructors and destructors
WarningDialog(wxWindow *parent, WarningDialog(wxWindow *parent,
const wxString &message, const TranslatableString &message,
const wxString &footer, const TranslatableString &footer,
bool showCancelButton); bool showCancelButton);
private: private:
@ -51,13 +51,14 @@ BEGIN_EVENT_TABLE(WarningDialog, wxDialogWrapper)
EVT_BUTTON(wxID_OK, WarningDialog::OnOK) EVT_BUTTON(wxID_OK, WarningDialog::OnOK)
END_EVENT_TABLE() END_EVENT_TABLE()
const wxString &DefaultWarningFooter() const TranslatableString &DefaultWarningFooter()
{ {
return _("Don't show this warning again"); static auto result = XO("Don't show this warning again");
return result;
} }
WarningDialog::WarningDialog(wxWindow *parent, const wxString &message, WarningDialog::WarningDialog(wxWindow *parent, const TranslatableString &message,
const wxString &footer, const TranslatableString &footer,
bool showCancelButton) bool showCancelButton)
: wxDialogWrapper(parent, wxID_ANY, XO("Warning"), : wxDialogWrapper(parent, wxID_ANY, XO("Warning"),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
@ -71,8 +72,8 @@ WarningDialog::WarningDialog(wxWindow *parent, const wxString &message,
S.SetBorder(10); S.SetBorder(10);
S.StartVerticalLay(false); S.StartVerticalLay(false);
{ {
S.AddFixedText(message); S.AddFixedText(message.Translation());
mCheckBox = S.AddCheckBox(footer, false); mCheckBox = S.AddCheckBox(footer.Translation(), false);
} }
S.EndVerticalLay(); S.EndVerticalLay();
@ -90,9 +91,9 @@ void WarningDialog::OnOK(wxCommandEvent& WXUNUSED(event))
int ShowWarningDialog(wxWindow *parent, int ShowWarningDialog(wxWindow *parent,
const wxString &internalDialogName, const wxString &internalDialogName,
const wxString &message, const TranslatableString &message,
bool showCancelButton, bool showCancelButton,
const wxString &footer) const TranslatableString &footer)
{ {
auto key = WarningDialogKey(internalDialogName); auto key = WarningDialogKey(internalDialogName);
if (!gPrefs->Read(key, (long) true)) { if (!gPrefs->Read(key, (long) true)) {

View File

@ -15,9 +15,10 @@
#include <wx/defs.h> #include <wx/defs.h>
class wxString; class wxString;
class TranslatableString;
// "Don't show this warning again" // "Don't show this warning again"
const wxString &DefaultWarningFooter(); const TranslatableString &DefaultWarningFooter();
/// Displays a warning dialog with a check box. If the user checks /// Displays a warning dialog with a check box. If the user checks
/// the box, the internalDialogName is noted in the /// the box, the internalDialogName is noted in the
@ -25,9 +26,9 @@ class wxString;
/// the user; it should be unique to each message. /// the user; it should be unique to each message.
int ShowWarningDialog(wxWindow *parent, int ShowWarningDialog(wxWindow *parent,
const wxString &internalDialogName, const wxString &internalDialogName,
const wxString &message, const TranslatableString &message,
bool showCancelButton = false, bool showCancelButton = false,
// This message appears by the checkbox: // This message appears by the checkbox:
const wxString &footer = DefaultWarningFooter()); const TranslatableString &footer = DefaultWarningFooter());
#endif // __AUDACITY_WARNING__ #endif // __AUDACITY_WARNING__