diff --git a/src/Project.cpp b/src/Project.cpp index bc805ce8c..c4a7db3fb 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -5404,7 +5404,9 @@ Other applications are competing with Audacity for processor time\n\ \n\ You are saving directly to a slow external storage device\n\ " - )); + ), + false, + _("Turn off dropout detection")); } // Add to history diff --git a/src/widgets/Warning.cpp b/src/widgets/Warning.cpp index ea77c35ab..41345b0f0 100644 --- a/src/widgets/Warning.cpp +++ b/src/widgets/Warning.cpp @@ -37,7 +37,8 @@ class WarningDialog final : public wxDialogWrapper public: // constructors and destructors WarningDialog(wxWindow *parent, - wxString message, + const wxString &message, + const wxString &footer, bool showCancelButton); private: @@ -52,7 +53,14 @@ BEGIN_EVENT_TABLE(WarningDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, WarningDialog::OnOK) END_EVENT_TABLE() -WarningDialog::WarningDialog(wxWindow *parent, wxString message, bool showCancelButton) +const wxString &DefaultWarningFooter() +{ + return _("Don't show this warning again"); +} + +WarningDialog::WarningDialog(wxWindow *parent, const wxString &message, + const wxString &footer, + bool showCancelButton) : wxDialogWrapper(parent, wxID_ANY, (wxString)_("Warning"), wxDefaultPosition, wxDefaultSize, (showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX. @@ -66,7 +74,7 @@ WarningDialog::WarningDialog(wxWindow *parent, wxString message, bool showCancel S.StartVerticalLay(false); { S.AddUnits(message); - mCheckBox = S.AddCheckBox(_("Don't show this warning again"), wxT("false")); + mCheckBox = S.AddCheckBox(footer, wxT("false")); } S.SetBorder(0); @@ -84,14 +92,15 @@ void WarningDialog::OnOK(wxCommandEvent& WXUNUSED(event)) int ShowWarningDialog(wxWindow *parent, const wxString &internalDialogName, const wxString &message, - bool showCancelButton) + bool showCancelButton, + const wxString &footer) { auto key = WarningDialogKey(internalDialogName); if (!gPrefs->Read(key, (long) true)) { return wxID_OK; } - WarningDialog dlog(parent, message, showCancelButton); + WarningDialog dlog(parent, message, footer, showCancelButton); int retCode = dlog.ShowModal(); if (retCode == wxID_CANCEL) diff --git a/src/widgets/Warning.h b/src/widgets/Warning.h index fff09136f..ce08b5742 100644 --- a/src/widgets/Warning.h +++ b/src/widgets/Warning.h @@ -15,15 +15,19 @@ #include #include -/// Displays a warning dialog with a check box that says -/// "Don't show this warning again". If the user checks +// "Don't show this warning again" + const wxString &DefaultWarningFooter(); + +/// Displays a warning dialog with a check box. If the user checks /// the box, the internalDialogName is noted in the /// preferences. The internalDialogName is never seen by /// the user; it should be unique to each message. int ShowWarningDialog(wxWindow *parent, const wxString &internalDialogName, const wxString &message, - bool showCancelButton = false); + bool showCancelButton = false, + // This message appears by the checkbox: + const wxString &footer = DefaultWarningFooter()); /// Return the config file key associated with a warning dialog identified /// by internalDialogName. When the box is checked, the value at the key