mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +02:00
Change the text of the checkmark for the dropout warning
This commit is contained in:
parent
b0cb3868c3
commit
8077c1db04
@ -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
|
||||
|
@ -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)
|
||||
|
@ -15,15 +15,19 @@
|
||||
#include <wx/defs.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
/// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user