diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index b9a5f21ce..9ae32da03 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -2754,7 +2754,7 @@ void AudioIO::StopStream() // Bug 96: Only warn for the first track. if( i==0 ) { - wxMessageDialog m(NULL, _( + AudacityMessageDialog m(NULL, _( "Latency Correction setting has caused the recorded audio to be hidden before zero.\nAudacity has brought it back to start at zero.\nYou may have to use the Time Shift Tool (<---> or F5) to drag the track to the right place."), _("Latency problem"), wxOK); m.ShowModal(); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 5035048a8..aa0053e30 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -831,7 +831,7 @@ void EditChainsDialog::OnRemove(wxCommandEvent & WXUNUSED(event)) } wxString name = mChains->GetItemText(item); - wxMessageDialog m(this, + AudacityMessageDialog m(this, /*i18n-hint: %s will be replaced by the name of a file.*/ wxString::Format(_("Are you sure you want to delete %s?"), name.c_str()), GetTitle(), diff --git a/src/Project.cpp b/src/Project.cpp index 60e1cc351..b4898f54e 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -4300,7 +4300,7 @@ bool AudacityProject::SaveAs(const wxString & newFileName, bool bWantSaveCompres //We should only overwrite it if this project already has the same name, where the user //simply chose to use the save as command although the save command would have the effect. if( !bOwnsNewAupName && wxFileExists(newFileName)) { - wxMessageDialog m( + AudacityMessageDialog m( NULL, _("The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."), _("Error Saving Project"), @@ -4401,7 +4401,7 @@ For an audio file that will open in other apps, use 'Export'.\n"), //We should only overwrite it if this project already has the same name, where the user //simply chose to use the save as command although the save command would have the effect. if (!bOwnsNewAupName && filename.FileExists()) { - wxMessageDialog m( + AudacityMessageDialog m( NULL, _("The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."), _("Error Saving Project"), diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 2431639dc..5a0b9bd25 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -309,7 +309,7 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even // If project already exists then abort - we do not allow users to overwrite an existing project // unless it is the current project. if (wxFileExists(fName) && (pProject->GetFileName() != fName)) { - wxMessageDialog m( + AudacityMessageDialog m( NULL, _("The selected file name could not be used\nfor Timer Recording because it \ would overwrite another project.\nPlease try again and select an original name."), @@ -416,7 +416,7 @@ void TimerRecordDialog::OnOK(wxCommandEvent& WXUNUSED(event)) sPlannedTime, sRemainingTime); - wxMessageDialog dlgMessage(NULL, + AudacityMessageDialog dlgMessage(NULL, sMessage, _("Timer Recording Disk Space Warning"), wxYES_NO | wxNO_DEFAULT | wxICON_WARNING); diff --git a/src/VoiceKey.cpp b/src/VoiceKey.cpp index 580c9e680..1a77b1b14 100644 --- a/src/VoiceKey.cpp +++ b/src/VoiceKey.cpp @@ -816,7 +816,7 @@ void VoiceKey::CalibrateNoise(const WaveTrack & t, sampleCount start, sampleCoun text += wxString::Format(_("Energy -- mean: %1.4f sd: (%1.4f)\n"),mEnergyMean,mEnergySD); text+= wxString::Format(_("Sign Changes -- mean: %1.4f sd: (%1.4f)\n"),mSignChangesMean,mSignChangesSD); text += wxString::Format(_("Direction Changes -- mean: %1.4f sd: (%1.4f)\n"), mDirectionChangesMean, mDirectionChangesSD); - wxMessageDialog{ NULL, text, + AudacityMessageDialog{ NULL, text, _("Calibration Complete"), wxOK | wxICON_INFORMATION, wxPoint(-1, -1) } diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 41d44de00..b5b3ab7a8 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -54,7 +54,7 @@ bool ContrastDialog::GetDB(float &dB) while (t) { numberSelecteTracks++; if (numberSelecteTracks > 1 && !isStereo) { - wxMessageDialog m(NULL, _("You can only measure one track at a time."), _("Error"), wxOK); + AudacityMessageDialog m(NULL, _("You can only measure one track at a time."), _("Error"), wxOK); m.ShowModal(); return false; } @@ -73,14 +73,14 @@ bool ContrastDialog::GetDB(float &dB) if(SelT0 > SelT1) { - wxMessageDialog m(NULL, _("Invalid audio selection.\nPlease ensure that audio is selected."), _("Error"), wxOK); + AudacityMessageDialog m(NULL, _("Invalid audio selection.\nPlease ensure that audio is selected."), _("Error"), wxOK); m.ShowModal(); return false; } if(SelT0 == SelT1) { - wxMessageDialog m(NULL, _("Nothing to measure.\nPlease select a section of a track."), _("Error"), wxOK); + AudacityMessageDialog m(NULL, _("Nothing to measure.\nPlease select a section of a track."), _("Error"), wxOK); m.ShowModal(); return false; } @@ -95,7 +95,7 @@ bool ContrastDialog::GetDB(float &dB) rms = (meanSq > 0.0)? sqrt(meanSq/(double)numberSelecteTracks) : 0.0; if(numberSelecteTracks == 0) { - wxMessageDialog m(NULL, _("Please select an audio track."), _("Error"), wxOK); + AudacityMessageDialog m(NULL, _("Please select an audio track."), _("Error"), wxOK); m.ShowModal(); return false; } diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 12d1aea01..8d1b58ca9 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -3605,7 +3605,7 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt)) name = text->GetValue(); if (name.IsEmpty()) { - wxMessageDialog md(this, + AudacityMessageDialog md(this, _("You must specify a name"), _("Save Preset")); md.Center(); @@ -3615,7 +3615,7 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt)) if (mUserPresets.Index(name) != wxNOT_FOUND) { - wxMessageDialog md(this, + AudacityMessageDialog md(this, _("Preset already exists.\n\nReplace?"), _("Save Preset"), wxYES_NO | wxCANCEL | wxICON_EXCLAMATION); diff --git a/src/widgets/ErrorDialog.h b/src/widgets/ErrorDialog.h index 5f6e1150b..83d20f559 100644 --- a/src/widgets/ErrorDialog.h +++ b/src/widgets/ErrorDialog.h @@ -117,4 +117,20 @@ public: {} }; +// Similarly wrap wxMessageDialog, to prohibit the default, +// unlocalized caption +class AudacityMessageDialog : public wxTabTraversalWrapper< wxMessageDialog > +{ +public: + AudacityMessageDialog( + wxWindow *parent, + const wxString& message, + const wxString& caption, // don't use = wxMessageBoxCaptionStr, + long style = wxOK|wxCENTRE, + const wxPoint& pos = wxDefaultPosition) + : wxTabTraversalWrapper< wxMessageDialog> + { parent, message, caption, style, pos } + {} +}; + #endif // __AUDACITY_ERRORDIALOG__ diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index fc4ac734a..5469058a4 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -49,6 +49,7 @@ #include #include "ProgressDialog.h" +#include "ErrorDialog.h" #include "../Prefs.h" // This really should be a Preferences setting @@ -1573,7 +1574,7 @@ bool ProgressDialog::ConfirmAction(const wxString & sPrompt, return true; } - wxMessageDialog dlgMessage(this, + AudacityMessageDialog dlgMessage(this, sPrompt, sTitle, wxYES_NO | wxICON_QUESTION | wxNO_DEFAULT | wxSTAY_ON_TOP);