1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-10 16:35:32 +01:00

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

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