Localized default names and titles for many utility dialogs...

... Certain wrappers are put around direct usage of classes like
wxMessageDialog which did NOT localize by default.

Also consistently mention (translated) names of effects in titles of message
boxes that they display.
This commit is contained in:
Paul Licameli 2018-01-01 17:53:13 -05:00
commit 0efbf6a190
97 changed files with 673 additions and 475 deletions

View File

@ -1079,7 +1079,7 @@ void NyqBench::OnSave(wxCommandEvent & e)
if (!mScript->SaveFile(mPath.GetFullPath()))
{
wxMessageBox(_("Script was not saved."),
AudacityMessageBox(_("Script was not saved."),
_("Warning"),
wxICON_EXCLAMATION,
this);
@ -1109,7 +1109,7 @@ void NyqBench::OnSaveAs(wxCommandEvent & e)
if (!mScript->SaveFile(mPath.GetFullPath()))
{
wxMessageBox(_("Script was not saved."),
AudacityMessageBox(_("Script was not saved."),
_("Warning"),
wxICON_EXCLAMATION,
this);
@ -1484,7 +1484,7 @@ void NyqBench::OnFindDialog(wxFindDialogEvent & e)
}
if (pos == wxString::npos) {
wxMessageBox(_("No matches found"),
AudacityMessageBox(_("No matches found"),
_("Nyquist Effect Workbench"),
wxOK | wxCENTER,
e.GetDialog());
@ -1621,7 +1621,7 @@ bool NyqBench::Validate()
{
if (mScript->GetLastPosition() > 0 && mScript->IsModified()) {
int ans;
ans = wxMessageBox(_("Code has been modified. Are you sure?"),
ans = AudacityMessageBox(_("Code has been modified. Are you sure?"),
_("Warning"),
wxYES_NO | wxICON_QUESTION,
this);

View File

@ -35,7 +35,6 @@ It handles initialization and termination by subclassing wxApp.
#include <wx/window.h>
#include <wx/intl.h>
#include <wx/menu.h>
#include <wx/msgdlg.h>
#include <wx/snglinst.h>
#include <wx/splash.h>
#include <wx/stdpaths.h>
@ -802,7 +801,7 @@ bool AudacityApp::MRUOpen(const wxString &fullPathStr) {
}
else {
// File doesn't exist - remove file from history
wxMessageBox(wxString::Format(_("%s could not be found.\n\nIt has been removed from the list of recent files."),
AudacityMessageBox(wxString::Format(_("%s could not be found.\n\nIt has been removed from the list of recent files."),
fullPathStr.c_str()));
return(false);
}
@ -1008,7 +1007,7 @@ wxString AudacityApp::InitLang( const wxString & lang )
if (!lang.empty()) {
info = wxLocale::FindLanguageInfo(lang);
if (!info)
::wxMessageBox(wxString::Format(_("Language \"%s\" is unknown"), lang));
::AudacityMessageBox(wxString::Format(_("Language \"%s\" is unknown"), lang));
}
if (!info)
{
@ -1138,7 +1137,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
if (ok && rpt.Process())
{
wxTextEntryDialog dlg(NULL,
AudacityTextEntryDialog dlg(NULL,
_("Report generated to:"),
_("Audacity Support Data"),
rpt.GetCompressedFileName(),
@ -1761,9 +1760,9 @@ bool AudacityApp::InitTempDir()
if (temp == wxT("")) {
// Failed
if( !IsTempDirectoryNameOK( tempFromPrefs ) ) {
wxMessageBox(_("Audacity could not find a safe place to store temporary files.\nAudacity needs a place where automatic cleanup programs won't delete the temporary files.\nPlease enter an appropriate directory in the preferences dialog."));
AudacityMessageBox(_("Audacity could not find a safe place to store temporary files.\nAudacity needs a place where automatic cleanup programs won't delete the temporary files.\nPlease enter an appropriate directory in the preferences dialog."));
} else {
wxMessageBox(_("Audacity could not find a place to store temporary files.\nPlease enter an appropriate directory in the preferences dialog."));
AudacityMessageBox(_("Audacity could not find a place to store temporary files.\nPlease enter an appropriate directory in the preferences dialog."));
}
// Only want one page of the preferences
@ -1773,7 +1772,7 @@ bool AudacityApp::InitTempDir()
GlobalPrefsDialog dialog(NULL, factories);
dialog.ShowModal();
wxMessageBox(_("Audacity is now going to exit. Please launch Audacity again to use the new temporary directory."));
AudacityMessageBox(_("Audacity is now going to exit. Please launch Audacity again to use the new temporary directory."));
return false;
}
@ -1818,7 +1817,7 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
_("Audacity was not able to lock the temporary files directory.\nThis folder may be in use by another copy of Audacity.\n") +
runningTwoCopiesStr +
_("Do you still want to start Audacity?");
int action = wxMessageBox(prompt,
int action = AudacityMessageBox(prompt,
_("Error Locking Temporary Folder"),
wxYES_NO | wxICON_EXCLAMATION,
NULL);
@ -1912,7 +1911,7 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
_("The system has detected that another copy of Audacity is running.\n") +
runningTwoCopiesStr +
_("Use the New or Open commands in the currently running Audacity\nprocess to open multiple projects simultaneously.\n");
wxMessageBox(prompt, _("Audacity is already running"),
AudacityMessageBox(prompt, _("Audacity is already running"),
wxOK | wxICON_ERROR);
return false;
}
@ -2287,7 +2286,7 @@ void AudacityApp::AssociateFileTypes()
// Either there's no pref or user does want associations
// and they got stepped on, so ask.
int wantAssoc =
wxMessageBox(
AudacityMessageBox(
_("Audacity project (.AUP) files are not currently \nassociated with Audacity. \n\nAssociate them, so they open on double-click?"),
_("Audacity Project Files"),
wxYES_NO | wxICON_QUESTION);

View File

@ -23,7 +23,8 @@ got to show.
#include "AudacityException.h"
#include <wx/atomic.h>
#include <wx/msgdlg.h>
#include "widgets/ErrorDialog.h"
AudacityException::~AudacityException()
{
@ -100,9 +101,9 @@ void MessageBoxException::DelayedHandlerAction()
// common cause such as exhaustion of disk space so that the others
// give the user no useful added information.
if ( wxAtomicDec( sOutstandingMessages ) == 0 )
::wxMessageBox(
::AudacityMessageBox(
ErrorMessage(),
caption.IsEmpty() ? wxMessageBoxCaptionStr : caption,
caption.IsEmpty() ? AudacityMessageBoxCaptionStr() : caption,
wxICON_ERROR
);
moved = true;

View File

@ -23,11 +23,11 @@ Provides thread-safe logging based on the wxWidgets log facility.
#include <wx/log.h>
#include <wx/frame.h>
#include <wx/icon.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include "../images/AudacityLogoAlpha.xpm"
#include "Experimental.h"
#include "widgets/ErrorDialog.h"
//
// AudacityLogger class
@ -307,7 +307,7 @@ void AudacityLogger::OnSave(wxCommandEvent & WXUNUSED(e))
}
if (!mText->SaveFile(fName)) {
wxMessageBox(_("Couldn't save log to file: ") + fName,
AudacityMessageBox(_("Couldn't save log to file: ") + fName,
_("Warning"),
wxICON_EXCLAMATION,
mFrame.get());

View File

@ -428,7 +428,6 @@ TimeTrack and AudioIOListener and whether the playback is looped.
#include <wx/log.h>
#include <wx/textctrl.h>
#include <wx/msgdlg.h>
#include <wx/timer.h>
#include <wx/intl.h>
#include <wx/debug.h>
@ -450,6 +449,7 @@ TimeTrack and AudioIOListener and whether the playback is looped.
#include "toolbars/ControlToolBar.h"
#include "widgets/Meter.h"
#include "widgets/ErrorDialog.h"
#ifdef EXPERIMENTAL_MIDI_OUT
#define MIDI_SLEEP 10 /* milliseconds */
@ -1222,7 +1222,7 @@ AudioIO::AudioIO()
errStr += _("Error: ")+paErrStr;
// XXX: we are in libaudacity, popping up dialogs not allowed! A
// long-term solution will probably involve exceptions
wxMessageBox(errStr, _("Error Initializing Audio"), wxICON_ERROR|wxOK);
AudacityMessageBox(errStr, _("Error Initializing Audio"), wxICON_ERROR|wxOK);
// Since PortAudio is not initialized, all calls to PortAudio
// functions will fail. This will give reasonable behavior, since
@ -1242,7 +1242,7 @@ AudioIO::AudioIO()
errStr += _("Error: ") + pmErrStr;
// XXX: we are in libaudacity, popping up dialogs not allowed! A
// long-term solution will probably involve exceptions
wxMessageBox(errStr, _("Error Initializing Midi"), wxICON_ERROR|wxOK);
AudacityMessageBox(errStr, _("Error Initializing Midi"), wxICON_ERROR|wxOK);
// Same logic for PortMidi as described above for PortAudio
}
@ -2131,7 +2131,7 @@ int AudioIO::StartStream(const ConstWaveTrackArray &playbackTracks,
if(captureBufferSize < 100)
{
StartStreamCleanup();
wxMessageBox(_("Out of memory!"));
AudacityMessageBox(_("Out of memory!"));
return 0;
}
@ -2165,7 +2165,7 @@ int AudioIO::StartStream(const ConstWaveTrackArray &playbackTracks,
if(playbackBufferSize < 100 || playbackMixBufferSize < 100)
{
StartStreamCleanup();
wxMessageBox(_("Out of memory!"));
AudacityMessageBox(_("Out of memory!"));
return 0;
}
}
@ -2289,7 +2289,7 @@ int AudioIO::StartStream(const ConstWaveTrackArray &playbackTracks,
if (mListener && mNumCaptureChannels > 0)
mListener->OnAudioIOStopRecording();
StartStreamCleanup();
wxMessageBox(LAT1CTOWX(Pa_GetErrorText(err)));
AudacityMessageBox(LAT1CTOWX(Pa_GetErrorText(err)));
return 0;
}
}
@ -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();

View File

@ -32,6 +32,7 @@ text or binary format to a file.
#include <wx/app.h>
#include "WaveTrack.h"
#include "widgets/ErrorDialog.h"
enum {
ID_RECOVER_ALL = 10000,
@ -138,7 +139,7 @@ void AutoRecoveryDialog::OnQuitAudacity(wxCommandEvent & WXUNUSED(event))
void AutoRecoveryDialog::OnRecoverNone(wxCommandEvent & WXUNUSED(event))
{
int ret = wxMessageBox(
int ret = AudacityMessageBox(
_("Are you sure you want to discard all recoverable projects?\n\nChoosing \"Yes\" discards all recoverable projects immediately."),
_("Confirm Discard Projects"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this);
@ -158,7 +159,7 @@ static bool HaveFilesToRecover()
wxDir dir(FileNames::AutoSaveDir());
if (!dir.IsOpened())
{
wxMessageBox(_("Could not enumerate files in auto save directory."),
AudacityMessageBox(_("Could not enumerate files in auto save directory."),
_("Error"), wxICON_STOP);
return false;
}
@ -181,7 +182,7 @@ static bool RemoveAllAutoSaveFiles()
{
// I don't think this error message is actually useful.
// -dmazzoni
//wxMessageBox(wxT("Could not remove auto save file: " + files[i]),
//AudacityMessageBox(wxT("Could not remove auto save file: " + files[i]),
// _("Error"), wxICON_STOP);
return false;
}
@ -195,7 +196,7 @@ static bool RecoverAllProjects(AudacityProject** pproj)
wxDir dir(FileNames::AutoSaveDir());
if (!dir.IsOpened())
{
wxMessageBox(_("Could not enumerate files in auto save directory."),
AudacityMessageBox(_("Could not enumerate files in auto save directory."),
_("Error"), wxICON_STOP);
return false;
}

View File

@ -21,7 +21,6 @@ See also BatchCommandDialog and BatchProcessDialog.
#include <wx/defs.h>
#include <wx/dir.h>
#include <wx/msgdlg.h>
#include <wx/filedlg.h>
#include <wx/textfile.h>
@ -43,6 +42,7 @@ See also BatchCommandDialog and BatchProcessDialog.
#include "AllThemeResources.h"
#include "Track.h"
#include "widgets/ErrorDialog.h"
// KLUDGE: All commands should be on the same footing
// however, for historical reasons we distinguish between
@ -366,13 +366,13 @@ double BatchCommands::GetEndTime()
AudacityProject *project = GetActiveProject();
if( project == NULL )
{
//wxMessageBox( _("No project to process!") );
//AudacityMessageBox( _("No project to process!") );
return -1.0;
}
TrackList * tracks = project->GetTracks();
if( tracks == NULL )
{
//wxMessageBox( _("No tracks to process!") );
//AudacityMessageBox( _("No tracks to process!") );
return -1.0;
}
@ -385,14 +385,14 @@ bool BatchCommands::IsMono()
AudacityProject *project = GetActiveProject();
if( project == NULL )
{
//wxMessageBox( _("No project and no Audio to process!") );
//AudacityMessageBox( _("No project and no Audio to process!") );
return false;
}
TrackList * tracks = project->GetTracks();
if( tracks == NULL )
{
//wxMessageBox( _("No tracks to process!") );
//AudacityMessageBox( _("No tracks to process!") );
return false;
}
@ -435,7 +435,7 @@ wxString BatchCommands::BuildCleanFileName(const wxString &fileName, const wxStr
// double startTime = 0.0;
//OnSelectAll();
pathName = FileNames::FindDefaultPath(FileNames::Operation::Export);
::wxMessageBox(wxString::Format(_("Export recording to %s\n/%s/%s%s"),
::AudacityMessageBox(wxString::Format(_("Export recording to %s\n/%s/%s%s"),
pathName.c_str(), cleanedString.c_str(), justName.c_str(), extension.c_str()),
_("Export recording"),
wxOK | wxCENTRE);
@ -445,7 +445,7 @@ wxString BatchCommands::BuildCleanFileName(const wxString &fileName, const wxStr
cleanedName += cleanedString;
bool flag = ::wxFileName::FileExists(cleanedName);
if (flag == true) {
::wxMessageBox(_("Cannot create directory 'cleaned'. \nFile already exists that is not a directory"));
::AudacityMessageBox(_("Cannot create directory 'cleaned'. \nFile already exists that is not a directory"));
return wxString{};
}
::wxFileName::Mkdir(cleanedName, 0777, wxPATH_MKDIR_FULL); // make sure it exists
@ -569,7 +569,7 @@ bool BatchCommands::ApplySpecialCommand(int WXUNUSED(iCommand), const wxString &
}
return mExporter.Process(project, numChannels, wxT("OGG"), filename, false, 0.0, endTime);
#else
wxMessageBox(_("Ogg Vorbis support is not included in this build of Audacity"));
AudacityMessageBox(_("Ogg Vorbis support is not included in this build of Audacity"));
return false;
#endif
} else if (command == wxT("ExportFLAC")) {
@ -581,11 +581,11 @@ bool BatchCommands::ApplySpecialCommand(int WXUNUSED(iCommand), const wxString &
}
return mExporter.Process(project, numChannels, wxT("FLAC"), filename, false, 0.0, endTime);
#else
wxMessageBox(_("FLAC support is not included in this build of Audacity"));
AudacityMessageBox(_("FLAC support is not included in this build of Audacity"));
return false;
#endif
}
wxMessageBox(wxString::Format(_("Command %s not implemented yet"),command.c_str()));
AudacityMessageBox(wxString::Format(_("Command %s not implemented yet"),command.c_str()));
return false;
}
// end CLEANSPEECH remnant
@ -639,7 +639,7 @@ bool BatchCommands::ApplyCommand(const wxString & command, const wxString & para
return ApplyEffectCommand(ID, command, params);
}
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Your batch command of %s was not recognized."), command.c_str() ));
@ -762,12 +762,12 @@ bool BatchCommands::ReportAndSkip(const wxString & command, const wxString & par
//TODO: Add a cancel button to these, and add the logic so that we can abort.
if( params != wxT("") )
{
wxMessageBox( wxString::Format(_("Apply %s with parameter(s)\n\n%s"),command.c_str(), params.c_str()),
AudacityMessageBox( wxString::Format(_("Apply %s with parameter(s)\n\n%s"),command.c_str(), params.c_str()),
_("Test Mode"));
}
else
{
wxMessageBox( wxString::Format(_("Apply %s"),command.c_str()),
AudacityMessageBox( wxString::Format(_("Apply %s"),command.c_str()),
_("Test Mode"));
}
return true;

View File

@ -30,7 +30,6 @@
#include <wx/radiobut.h>
#include <wx/button.h>
#include <wx/imaglist.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include "AudacityException.h"
@ -52,6 +51,7 @@
#include "FileDialog.h"
#include "FileNames.h"
#include "import/Import.h"
#include "widgets/ErrorDialog.h"
#define ChainsListID 7001
#define CommandsListID 7002
@ -150,7 +150,7 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event))
wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
if (item == -1) {
wxMessageBox(_("No chain selected"));
AudacityMessageBox(_("No chain selected"));
return;
}
wxString name = mChains->GetItemText(item);
@ -224,7 +224,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
if (item == -1) {
wxMessageBox(_("No chain selected"));
AudacityMessageBox(_("No chain selected"));
return;
}
@ -234,7 +234,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
AudacityProject *project = GetActiveProject();
if (!project->GetIsEmpty()) {
wxMessageBox(_("Please save and close the current project first."));
AudacityMessageBox(_("Please save and close the current project first."));
return;
}
@ -280,7 +280,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
}
auto path = FileNames::FindDefaultPath(FileNames::Operation::Open);
FileDialog dlog(this,
FileDialogWrapper dlog(this,
prompt,
path,
wxT(""),
@ -645,7 +645,7 @@ bool EditChainsDialog::ChangeOK()
title.Printf(_("%s changed"), mActiveChain.c_str());
msg = _("Do you want to save the changes?");
id = wxMessageBox(msg, title, wxYES_NO | wxCANCEL);
id = AudacityMessageBox(msg, title, wxYES_NO | wxCANCEL);
if (id == wxCANCEL) {
return false;
}
@ -779,7 +779,7 @@ void EditChainsDialog::OnChainsEndEdit(wxListEvent &event)
void EditChainsDialog::OnAdd(wxCommandEvent & WXUNUSED(event))
{
while (true) {
wxTextEntryDialog d(this,
AudacityTextEntryDialog d(this,
_("Enter name of new chain"),
_("Name of new chain"));
d.SetName(d.GetTitle());
@ -792,7 +792,7 @@ void EditChainsDialog::OnAdd(wxCommandEvent & WXUNUSED(event))
name = d.GetValue().Strip(wxString::both);
if (name.Length() == 0) {
wxMessageBox(_("Name must not be blank"),
AudacityMessageBox(_("Name must not be blank"),
GetTitle(),
wxOK | wxICON_ERROR,
this);
@ -802,7 +802,7 @@ void EditChainsDialog::OnAdd(wxCommandEvent & WXUNUSED(event))
if (name.Contains(wxFILE_SEP_PATH) ||
name.Contains(wxFILE_SEP_PATH_UNIX)) {
/*i18n-hint: The %c will be replaced with 'forbidden characters', like '/' and '\'.*/
wxMessageBox(wxString::Format(_("Names may not contain '%c' and '%c'"),
AudacityMessageBox(wxString::Format(_("Names may not contain '%c' and '%c'"),
wxFILE_SEP_PATH, wxFILE_SEP_PATH_UNIX),
GetTitle(),
wxOK | wxICON_ERROR,
@ -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(),

View File

@ -26,7 +26,6 @@ of the BlockFile system.
#include <wx/choice.h>
#include <wx/dialog.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/timer.h>
@ -42,6 +41,7 @@ of the BlockFile system.
#include "Prefs.h"
#include "FileNames.h"
#include "widgets/ErrorDialog.h"
class BenchmarkDialog final : public wxDialogWrapper
{
@ -82,7 +82,7 @@ private:
void RunBenchmark(wxWindow *parent)
{
/*
int action = wxMessageBox(
int action = AudacityMessageBox(
_("This will close all project windows (without saving)\nand open the Audacity Benchmark dialog.\n\nAre you sure you want to do this?"),
_("Benchmark"),
wxYES_NO | wxICON_EXCLAMATION,
@ -323,17 +323,17 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
mRandSeedStr.ToLong(&randSeed);
if (blockSize < 1 || blockSize > 1024) {
wxMessageBox(_("Block size should be in the range 1 - 1024 KB."));
AudacityMessageBox(_("Block size should be in the range 1 - 1024 KB."));
return;
}
if (numEdits < 1 || numEdits > 10000) {
wxMessageBox(_("Number of edits should be in the range 1 - 10000."));
AudacityMessageBox(_("Number of edits should be in the range 1 - 10000."));
return;
}
if (dataSize < 1 || dataSize > 2000) {
wxMessageBox(_("Test data size should be in the range 1 - 2000 MB."));
AudacityMessageBox(_("Test data size should be in the range 1 - 2000 MB."));
return;
}

View File

@ -54,6 +54,7 @@ AliasedFile s.
#include "ShuttleGui.h"
#include "WaveTrack.h"
#include "WaveClip.h"
#include "widgets/ErrorDialog.h"
WX_DECLARE_HASH_MAP(wxString, AliasedFile *,
wxStringHash, wxStringEqual, AliasedFileHash);
@ -523,7 +524,7 @@ void DependencyDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
if (mIsSaving)
{
int ret = wxMessageBox(
int ret = AudacityMessageBox(
_("If you proceed, your project will not be saved to disk. Is this what you want?"),
_("Cancel Save"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this);
if (ret != wxYES)
@ -568,7 +569,7 @@ _("Your project is currently self-contained; it does not depend on any external
\n\nIf you change the project to a state that has external dependencies on imported \
files, it will no longer be self-contained. If you then Save without copying those files in, \
you may lose data.");
wxMessageBox(msg,
AudacityMessageBox(msg,
_("Dependency Check"),
wxOK | wxICON_INFORMATION,
project);

View File

@ -73,7 +73,6 @@
#include <wx/log.h>
#include <wx/filefn.h>
#include <wx/hash.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/timer.h>
#include <wx/intl.h>
@ -106,6 +105,7 @@
#include "Sequence.h"
#include "widgets/Warning.h"
#include "widgets/MultiDialog.h"
#include "widgets/ErrorDialog.h"
#include "ondemand/ODManager.h"
@ -1893,7 +1893,7 @@ other projects. \
// In auto-recover mode, we didn't do any ShowMultiDialog calls above, so put up an alert.
if (bAutoRecoverMode)
::wxMessageBox(
::AudacityMessageBox(
_("Project check found file inconsistencies during automatic recovery.\n\nSelect 'Show Log...' in the Help menu to see details."),
_("Warning: Problems in Automatic Recovery"),
wxOK | wxICON_EXCLAMATION);

View File

@ -22,6 +22,7 @@ License: GPL v2. See License.txt.
#include "FileNames.h"
#include "Internat.h"
#include "widgets/HelpSystem.h"
#include "widgets/ErrorDialog.h"
#include <wx/file.h>
#include <wx/filedlg.h>
@ -99,7 +100,7 @@ void FFmpegStartup()
{
if (enabled)
{
wxMessageBox(_("FFmpeg was configured in Preferences and successfully loaded before, \
AudacityMessageBox(_("FFmpeg was configured in Preferences and successfully loaded before, \
\nbut this time Audacity failed to load it at startup. \
\n\nYou may want to go back to Preferences > Libraries and re-configure it."),
_("FFmpeg startup failed"));
@ -702,7 +703,7 @@ bool FFmpegLibs::LoadLibs(wxWindow * WXUNUSED(parent), bool showerr)
if (!ValidLibsLoaded()) {
wxString msg = _("Failed to find compatible FFmpeg libraries.");
if (showerr)
wxMessageBox(msg);
AudacityMessageBox(msg);
wxLogError(msg);
return false;
}

View File

@ -137,7 +137,6 @@ extern "C" {
#include <wx/string.h>
#include <wx/dynlib.h>
#include <wx/log.h> // for wxLogNull
#include <wx/msgdlg.h> // for wxMessageBox
#include <wx/utils.h>
#include "widgets/LinkingHtmlWindow.h"
#include "ShuttleGui.h"

View File

@ -20,6 +20,7 @@ information.
#include <wx/arrstr.h>
#include <wx/intl.h>
#include "sndfile.h"
#include "widgets/ErrorDialog.h"
#ifndef SNDFILE_1
#error Requires libsndfile 1.0 or higher
@ -285,7 +286,6 @@ OSType sf_header_mactype(int format)
#endif // __WXMAC__
#include <wx/msgdlg.h>
ODLock libSndFileMutex;
void SFFileCloser::operator() (SNDFILE *sf) const
@ -294,7 +294,7 @@ void SFFileCloser::operator() (SNDFILE *sf) const
if (err) {
char buffer[1000];
sf_error_str(sf, buffer, 1000);
wxMessageBox(wxString::Format
AudacityMessageBox(wxString::Format
/* i18n-hint: %s will be the error message from libsndfile */
(_("Error (file may not have been written): %s"),
buffer));

View File

@ -51,7 +51,6 @@ and in the spectrogram spectral selection.
#include <wx/font.h>
#include <wx/image.h>
#include <wx/dcmemory.h>
#include <wx/msgdlg.h>
#include <wx/file.h>
#include <wx/filedlg.h>
#include <wx/intl.h>
@ -84,6 +83,7 @@ and in the spectrogram spectral selection.
#include "./widgets/LinkingHtmlWindow.h"
#include "./widgets/HelpSystem.h"
#include "widgets/ErrorDialog.h"
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC);
@ -590,7 +590,7 @@ void FreqWindow::GetAudio()
}
else {
if (track->GetRate() != mRate) {
wxMessageBox(_("To plot the spectrum, all selected tracks must be the same sample rate."));
AudacityMessageBox(_("To plot the spectrum, all selected tracks must be the same sample rate."));
mData.reset();
mDataLen = 0;
return;
@ -615,7 +615,7 @@ void FreqWindow::GetAudio()
wxString msg;
msg.Printf(_("Too much audio was selected. Only the first %.1f seconds of audio will be analyzed."),
(mDataLen / mRate));
wxMessageBox(msg);
AudacityMessageBox(msg);
}
}
@ -1055,7 +1055,7 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event))
#endif
f.Open();
if (!f.IsOpened()) {
wxMessageBox(_("Couldn't write to file: ") + fName);
AudacityMessageBox(_("Couldn't write to file: ") + fName);
return;
}

View File

@ -20,7 +20,6 @@ and on Mac OS X for the filesystem.
*//*******************************************************************/
#include <wx/msgdlg.h>
#include <wx/log.h>
#include <wx/intl.h>
#include <wx/filename.h>
@ -243,7 +242,7 @@ char *Internat::VerifyFilename(const wxString &s, bool input)
wxFileName ff(name);
wxString ext;
while ((char *) (const char *)name.mb_str() == NULL) {
wxMessageBox(_("The specified filename could not be converted due to Unicode character use."));
AudacityMessageBox(_("The specified filename could not be converted due to Unicode character use."));
ext = ff.GetExt();
name = FileNames::SelectFile(FileNames::Operation::_None,

View File

@ -24,7 +24,6 @@
#include <wx/filedlg.h>
#include <wx/grid.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
@ -37,6 +36,7 @@
#include "Project.h"
#include "ViewInfo.h"
#include "widgets/NumericTextCtrl.h"
#include "widgets/ErrorDialog.h"
#include "FileNames.h"
#include <limits>
@ -603,7 +603,7 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event))
// Get at the data
f.Open(fileName);
if (!f.IsOpened()) {
wxMessageBox(_("Could not open file: ") + fileName);
AudacityMessageBox(_("Could not open file: ") + fileName);
}
else {
// Create a temporary label track and load the labels
@ -628,7 +628,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
// Silly user (could just disable the button, but that's a hassle ;-))
if (cnt == 0) {
wxMessageBox(_("No labels to export."));
AudacityMessageBox(_("No labels to export."));
return;
}
@ -671,7 +671,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
#endif
f.Open();
if (!f.IsOpened()) {
wxMessageBox(_("Couldn't write to file: ") + fName);
AudacityMessageBox(_("Couldn't write to file: ") + fName);
return;
}
@ -774,7 +774,7 @@ void LabelDialog::OnChangeTrack(wxGridEvent & WXUNUSED(event), int row, RowData
// User selected the "New..." choice so ask for a NEW name
if (mTrackNames.Index(val) == 0) {
wxTextEntryDialog d(this,
AudacityTextEntryDialog d(this,
_("New Label Track"),
_("Enter track name"),
/* i18n-hint: (noun) it's the name of a kind of track.*/

View File

@ -47,7 +47,6 @@ for drawing different aspects of the label and its text box.
#include <wx/event.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/pen.h>
#include <wx/string.h>
#include <wx/textfile.h>
@ -69,6 +68,7 @@ for drawing different aspects of the label and its text box.
#include "commands/CommandManager.h"
#include "effects/TimeWarper.h"
#include "widgets/ErrorDialog.h"
enum
{
@ -2285,7 +2285,7 @@ void LabelTrack::Import(wxTextFile & in)
catch(const LabelStruct::BadFormatException&) { error = true; }
}
if (error)
::wxMessageBox( _("One or more saved labels could not be read.") );
::AudacityMessageBox( _("One or more saved labels could not be read.") );
SortLabels();
}

View File

@ -21,7 +21,6 @@ of languages for Audacity.
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
@ -29,6 +28,7 @@ of languages for Audacity.
#include "Languages.h"
#include "ShuttleGui.h"
#include "widgets/wxPanelWrapper.h"
#include "widgets/ErrorDialog.h"
class LangChoiceDialog final : public wxDialogWrapper {
public:
@ -132,7 +132,7 @@ void LangChoiceDialog::OnOk(wxCommandEvent & WXUNUSED(event))
mLang.c_str(),
sname.c_str(),
slang.c_str());
if (wxMessageBox(msg, _("Confirm"), wxYES_NO) == wxNO) {
if (AudacityMessageBox(msg, _("Confirm"), wxYES_NO) == wxNO) {
return;
}
}

View File

@ -36,12 +36,12 @@ On failure the old version is put back in place.
#include <wx/ffile.h>
#include <wx/filefn.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/string.h>
#include <wx/textfile.h>
#include "Internat.h"
#include "Legacy.h"
#include "widgets/ErrorDialog.h"
#include "xml/XMLWriter.h"
static bool ConvertLegacyTrack(wxTextFile *f, XMLFileWriter &xmlFile)
@ -301,7 +301,7 @@ bool ConvertLegacyProjectFile(const wxFileName &filename)
xmlFile.EndTag(wxT("audacityproject"));
xmlFile.Commit();
::wxMessageBox(wxString::Format(_("Converted a 1.0 project file to the new format.\nThe old file has been saved as '%s'"), xmlFile.GetBackupName().c_str()),
::AudacityMessageBox(wxString::Format(_("Converted a 1.0 project file to the new format.\nThe old file has been saved as '%s'"), xmlFile.GetBackupName().c_str()),
_("Opening Audacity Project"));
return true;

View File

@ -42,7 +42,6 @@ simplifies construction of menu items.
#include <wx/defs.h>
#include <wx/docview.h>
#include <wx/msgdlg.h>
#include <wx/filedlg.h>
#include <wx/textfile.h>
#include <wx/textdlg.h>
@ -139,6 +138,7 @@ simplifies construction of menu items.
#include "prefs/TracksPrefs.h"
#include "widgets/Meter.h"
#include "widgets/ErrorDialog.h"
enum {
kAlignStartZero = 0,
@ -4529,7 +4529,7 @@ void AudacityProject::OnExportLabels()
}
if (numLabelTracks == 0) {
wxMessageBox(_("There are no label tracks to export."));
AudacityMessageBox(_("There are no label tracks to export."));
return;
}
@ -4565,7 +4565,7 @@ void AudacityProject::OnExportLabels()
f.Create();
f.Open();
if (!f.IsOpened()) {
wxMessageBox(_("Couldn't write to file: ") + fName);
AudacityMessageBox(_("Couldn't write to file: ") + fName);
return;
}
@ -4602,12 +4602,12 @@ void AudacityProject::OnExportMIDI(){
}
if(numNoteTracksSelected > 1) {
wxMessageBox(wxString::Format(_(
AudacityMessageBox(wxString::Format(_(
"Please select only one Note Track at a time.")));
return;
}
else if(numNoteTracksSelected < 1) {
wxMessageBox(wxString::Format(_(
AudacityMessageBox(wxString::Format(_(
"Please select a Note Track.")));
return;
}
@ -4659,7 +4659,7 @@ void AudacityProject::OnExportMIDI(){
} else {
wxString msg = _("You have selected a filename with an unrecognized file extension.\nDo you want to continue?");
wxString title = _("Export MIDI");
int id = wxMessageBox(msg, title, wxYES_NO);
int id = AudacityMessageBox(msg, title, wxYES_NO);
if (id == wxNO) {
continue;
} else if (id == wxYES) {
@ -4755,7 +4755,7 @@ void AudacityProject::OnPrint()
void AudacityProject::OnUndo()
{
if (!GetUndoManager()->UndoAvailable()) {
wxMessageBox(_("Nothing to undo"));
AudacityMessageBox(_("Nothing to undo"));
return;
}
@ -4785,7 +4785,7 @@ void AudacityProject::OnUndo()
void AudacityProject::OnRedo()
{
if (!GetUndoManager()->RedoAvailable()) {
wxMessageBox(_("Nothing to redo"));
AudacityMessageBox(_("Nothing to redo"));
return;
}
// Can't redo whilst dragging
@ -6878,7 +6878,7 @@ void AudacityProject::OnImportLabels()
f.Open(fileName);
if (!f.IsOpened()) {
wxMessageBox(_("Could not open file: ") + fileName);
AudacityMessageBox(_("Could not open file: ") + fileName);
return;
}
@ -7805,7 +7805,7 @@ void AudacityProject::OnScoreAlign()
if(numWaveTracksSelected == 0 ||
numNoteTracksSelected != 1 ||
numOtherTracksSelected != 0){
wxMessageBox(wxString::Format(wxT("Please select at least one audio track and one MIDI track.")));
AudacityMessageBox(wxString::Format(wxT("Please select at least one audio track and one MIDI track.")));
return;
}
@ -7875,13 +7875,13 @@ void AudacityProject::OnScoreAlign()
if (result == SA_SUCCESS) {
mTracks->Replace(nt, std::move(holder));
RedrawProject();
wxMessageBox(wxString::Format(
AudacityMessageBox(wxString::Format(
_("Alignment completed: MIDI from %.2f to %.2f secs, Audio from %.2f to %.2f secs."),
params.mMidiStart, params.mMidiEnd,
params.mAudioStart, params.mAudioEnd));
PushState(_("Sync MIDI with Audio"), _("Sync MIDI with Audio"));
} else if (result == SA_TOOSHORT) {
wxMessageBox(wxString::Format(
AudacityMessageBox(wxString::Format(
_("Alignment error: input too short: MIDI from %.2f to %.2f secs, Audio from %.2f to %.2f secs."),
params.mMidiStart, params.mMidiEnd,
params.mAudioStart, params.mAudioEnd));
@ -7891,7 +7891,7 @@ void AudacityProject::OnScoreAlign()
return; // no message when user cancels alignment
} else {
//GetActiveProject()->OnUndo(); // recover any changes to note track
wxMessageBox(_("Internal error reported by alignment process."));
AudacityMessageBox(_("Internal error reported by alignment process."));
}
}
#endif /* EXPERIMENTAL_SCOREALIGN */
@ -7947,7 +7947,7 @@ void AudacityProject::OnNewLabelTrack()
void AudacityProject::OnNewTimeTrack()
{
if (mTracks->GetTimeTrack()) {
wxMessageBox(_("This version of Audacity only allows one time track for each project window."));
AudacityMessageBox(_("This version of Audacity only allows one time track for each project window."));
return;
}
@ -7969,7 +7969,7 @@ void AudacityProject::OnTimerRecord()
// it is now safer to disable Timer Recording when there is more than
// one open project.
if (GetOpenProjectCount() > 1) {
wxMessageBox(_("Timer Recording cannot be used with more than one open project.\n\nPlease close any additional projects and try again."),
AudacityMessageBox(_("Timer Recording cannot be used with more than one open project.\n\nPlease close any additional projects and try again."),
_("Timer Recording"),
wxICON_INFORMATION | wxOK);
return;
@ -7980,7 +7980,7 @@ void AudacityProject::OnTimerRecord()
// preventing issues surrounding "dirty" projects when Automatic Save/Export
// is used in Timer Recording.
if ((GetUndoManager()->UnsavedChanges()) && (ProjectHasTracks() || mEmptyCanBeDirty)) {
wxMessageBox(_("Timer Recording cannot be used while you have unsaved changes.\n\nPlease save or close this project and try again."),
AudacityMessageBox(_("Timer Recording cannot be used while you have unsaved changes.\n\nPlease save or close this project and try again."),
_("Timer Recording"),
wxICON_INFORMATION | wxOK);
return;
@ -8357,7 +8357,7 @@ void AudacityProject::OnAudioDeviceInfo()
{
if (!text->SaveFile(fName))
{
wxMessageBox(_("Unable to save device info"), _("Save Device Info"));
AudacityMessageBox(_("Unable to save device info"), _("Save Device Info"));
}
}
}
@ -8398,7 +8398,7 @@ void AudacityProject::OnMidiDeviceInfo()
{
if (!text->SaveFile(fName))
{
wxMessageBox(_("Unable to save MIDI device info"), _("Save MIDI Device Info"));
AudacityMessageBox(_("Unable to save MIDI device info"), _("Save MIDI Device Info"));
}
}
}
@ -8531,7 +8531,7 @@ void AudacityProject::OnLockPlayRegion()
double start, end;
GetPlayRegion(&start, &end);
if (start >= mTracks->GetEndTime()) {
wxMessageBox(_("Cannot lock region beyond\nend of project."),
AudacityMessageBox(_("Cannot lock region beyond\nend of project."),
_("Error"));
}
else {
@ -8611,7 +8611,7 @@ void AudacityProject::OnResample()
break;
}
wxMessageBox(_("The entered value is invalid"), _("Error"),
AudacityMessageBox(_("The entered value is invalid"), _("Error"),
wxICON_ERROR, this);
}

View File

@ -27,7 +27,6 @@
#include <math.h>
#include <wx/textctrl.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/timer.h>
#include <wx/intl.h>

View File

@ -22,7 +22,6 @@ i.e. an alternative to the usual interface, for Audacity.
#include <wx/dynlib.h>
#include <wx/list.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/string.h>
#include <wx/filename.h>
@ -48,6 +47,7 @@ i.e. an alternative to the usual interface, for Audacity.
#include <wx/arrimpl.cpp>
#include "Experimental.h"
#include "widgets/ErrorDialog.h"
#define initFnName "ExtensionModuleInit"
#define versionFnName "GetVersionString"
@ -116,7 +116,7 @@ bool Module::Load()
tVersionFn versionFn = (tVersionFn)(mLib->GetSymbol(wxT(versionFnName)));
if (versionFn == NULL){
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s does not provide a version string.\nIt will not be loaded."), ShortName.c_str()), _("Module Unsuitable"));
AudacityMessageBox(wxString::Format(_("The module %s does not provide a version string.\nIt will not be loaded."), ShortName.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s does not provide a version string. It will not be loaded."), mName.c_str()));
mLib->Unload();
return false;
@ -125,7 +125,7 @@ bool Module::Load()
wxString moduleVersion = versionFn();
if( !moduleVersion.IsSameAs(AUDACITY_VERSION_STRING)) {
wxString ShortName = wxFileName( mName ).GetName();
wxMessageBox(wxString::Format(_("The module %s is matched with Audacity version %s.\n\nIt will not be loaded."), ShortName.c_str(), moduleVersion.c_str()), _("Module Unsuitable"));
AudacityMessageBox(wxString::Format(_("The module %s is matched with Audacity version %s.\n\nIt will not be loaded."), ShortName.c_str(), moduleVersion.c_str()), _("Module Unsuitable"));
wxLogMessage(wxString::Format(_("The module %s is matched with Audacity version %s. It will not be loaded."), mName.c_str(), moduleVersion.c_str()));
mLib->Unload();
return false;

View File

@ -41,6 +41,7 @@
#include "Prefs.h"
#include "ShuttleGui.h"
#include "effects/EffectManager.h"
#include "widgets/ErrorDialog.h"
#include "widgets/ProgressDialog.h"
#include "PluginManager.h"
@ -1009,7 +1010,7 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
}
}
if (!errMsgs.empty())
::wxMessageBox( wxString::Format(
AudacityMessageBox( wxString::Format(
_("Effect at %s failed to register:\n%s"),
path, errMsgs
) );
@ -1778,7 +1779,7 @@ bool PluginManager::DropFile(const wxString &fileName)
dst.SetFullName( src.GetFullName() );
if ( dst.Exists() ) {
// Query whether to overwrite
bool overwrite = (wxYES == ::wxMessageBox(
bool overwrite = (wxYES == ::AudacityMessageBox(
wxString::Format(_("Overwrite the plug-in file %s ?"),
dst.GetFullPath() ),
_("Plug-in already exists"),
@ -1803,7 +1804,7 @@ bool PluginManager::DropFile(const wxString &fileName)
}
if (!copied) {
::wxMessageBox(
::AudacityMessageBox(
_("Plug-in file is in use. Failed to overwrite"));
return true;
}
@ -1824,7 +1825,7 @@ bool PluginManager::DropFile(const wxString &fileName)
});
if ( ! nPlugIns ) {
// Unlikely after the dry run succeeded
::wxMessageBox( wxString::Format(
::AudacityMessageBox( wxString::Format(
_("Failed to register:\n%s"), errMsg ) );
return true;
}
@ -1839,7 +1840,7 @@ bool PluginManager::DropFile(const wxString &fileName)
format += wxT("\n");
for (const auto &name : names)
format += name + wxT("\n");
bool enable = (wxYES == ::wxMessageBox(
bool enable = (wxYES == ::AudacityMessageBox(
wxString::Format( format, nIds ),
_("Enable new plug-ins"),
wxYES_NO

View File

@ -53,7 +53,6 @@
#include "Audacity.h"
#include <wx/defs.h>
#include <wx/msgdlg.h>
#include <wx/app.h>
#include <wx/config.h>
#include <wx/intl.h>
@ -66,6 +65,7 @@
#include "Languages.h"
#include "Prefs.h"
#include "widgets/ErrorDialog.h"
std::unique_ptr<wxFileConfig> ugPrefs {};
wxFileConfig *gPrefs = NULL;
@ -180,7 +180,7 @@ void InitPreferences()
bool gone = wxRemoveFile(fullPath); // remove FirstTime.ini
if (!gone)
{
wxMessageBox(wxString::Format(_("Failed to remove %s"), fullPath.c_str()), _("Failed!"));
AudacityMessageBox(wxString::Format(_("Failed to remove %s"), fullPath.c_str()), _("Failed!"));
}
}
@ -198,7 +198,7 @@ void InitPreferences()
{
// pop up a dialogue
wxString prompt = _("Reset Preferences?\n\nThis is a one-time question, after an 'install' where you asked to have the Preferences reset.");
int action = wxMessageBox(prompt, _("Reset Audacity Preferences"),
int action = AudacityMessageBox(prompt, _("Reset Audacity Preferences"),
wxYES_NO, NULL);
if (action == wxYES) // reset
{

View File

@ -20,7 +20,6 @@
#include <wx/defs.h>
#include <wx/dc.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/print.h>
#include <wx/printdlg.h>
@ -29,6 +28,7 @@
#include "ViewInfo.h"
#include "WaveTrack.h"
#include "widgets/Ruler.h"
#include "widgets/ErrorDialog.h"
#include "Experimental.h"
@ -163,7 +163,7 @@ void HandlePrint(wxWindow *parent, const wxString &name, TrackList *tracks)
AudacityPrintout printout(name, tracks);
if (!printer.Print(parent, &printout, true)) {
if (wxPrinter::GetLastError() == wxPRINTER_ERROR) {
wxMessageBox(_("There was a problem printing."),
AudacityMessageBox(_("There was a problem printing."),
_("Print"), wxOK);
}
else {

View File

@ -71,7 +71,6 @@ scroll information. It also has some status flags.
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <wx/msgdlg.h>
#include <wx/notebook.h>
#include <wx/progdlg.h>
#include <wx/scrolbar.h>
@ -2539,7 +2538,7 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
{
Message += _("\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nCancel, Edit > Undo until all tracks\nare open, then File > Save Project.");
}
int result = wxMessageBox( Message,
int result = AudacityMessageBox( Message,
Title,
wxYES_NO | wxCANCEL | wxICON_QUESTION,
this);
@ -2816,7 +2815,7 @@ wxArrayString AudacityProject::ShowOpenDialog(const wxString &extraformat, const
// Construct and display the file dialog
wxArrayString selected;
FileDialog dlog(NULL,
FileDialogWrapper dlog(NULL,
_("Select one or more files"),
path,
wxT(""),
@ -2856,7 +2855,7 @@ bool AudacityProject::IsAlreadyOpen(const wxString & projPathName)
wxString::Format(_("%s is already open in another window."),
newProjPathName.GetName().c_str());
wxLogError(errMsg);
wxMessageBox(errMsg, _("Error Opening Project"), wxOK | wxCENTRE);
AudacityMessageBox(errMsg, _("Error Opening Project"), wxOK | wxCENTRE);
return true;
}
}
@ -2936,7 +2935,7 @@ bool AudacityProject::WarnOfLegacyFile( )
// Stop icon, and choose 'NO' by default.
int action =
wxMessageBox(msg,
AudacityMessageBox(msg,
_("Warning - Opening Old Project File"),
wxYES_NO | wxICON_STOP | wxNO_DEFAULT | wxCENTRE,
this);
@ -2982,7 +2981,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
// So we always refuse to open such files.
if (fileName.Lower().EndsWith(wxT(".aup.bak")))
{
wxMessageBox(
AudacityMessageBox(
_("You are trying to open an automatically created backup file.\nDoing this may result in severe data loss.\n\nPlease open the actual Audacity project file instead."),
_("Warning - Backup File Detected"),
wxOK | wxCENTRE, this);
@ -2990,7 +2989,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
}
if (!::wxFileExists(fileName)) {
wxMessageBox(_("Could not open file: ") + fileName,
AudacityMessageBox(_("Could not open file: ") + fileName,
_("Error Opening File"),
wxOK | wxCENTRE, this);
return;
@ -3005,14 +3004,14 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
{
wxFFile ff(fileName, wxT("rb"));
if (!ff.IsOpened()) {
wxMessageBox(_("Could not open file: ") + fileName,
AudacityMessageBox(_("Could not open file: ") + fileName,
_("Error opening file"),
wxOK | wxCENTRE, this);
return;
}
int numRead = ff.Read(buf, 15);
if (numRead != 15) {
wxMessageBox(wxString::Format(_("File may be invalid or corrupted: \n%s"),
AudacityMessageBox(wxString::Format(_("File may be invalid or corrupted: \n%s"),
(const wxChar*)fileName), _("Error Opening File or Project"),
wxOK | wxCENTRE, this);
ff.Close();
@ -3031,7 +3030,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
// Convert to the NEW format.
bool success = ConvertLegacyProjectFile(wxFileName{ fileName });
if (!success) {
wxMessageBox(_("Audacity was unable to convert an Audacity 1.0 project to the new project format."),
AudacityMessageBox(_("Audacity was unable to convert an Audacity 1.0 project to the new project format."),
_("Error Opening Project"),
wxOK | wxCENTRE, this);
return;
@ -3073,7 +3072,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
AutoSaveFile asf;
if (!asf.Decode(fileName))
{
wxMessageBox(_("Could not decode file: ") + fileName,
AudacityMessageBox(_("Could not decode file: ") + fileName,
_("Error decoding file"),
wxOK | wxCENTRE, this);
return;
@ -3207,7 +3206,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
this->PushState(_("Project was recovered"), _("Recover"));
if (!wxRemoveFile(fileName))
wxMessageBox(_("Could not remove old auto save file"),
AudacityMessageBox(_("Could not remove old auto save file"),
_("Error"), wxICON_STOP, this);
}
else
@ -3288,7 +3287,7 @@ void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
SetProjectTitle();
wxLogError(wxT("Could not parse file \"%s\". \nError: %s"), fileName.c_str(), xmlFile.GetErrorStr().c_str());
wxMessageBox(xmlFile.GetErrorStr(),
AudacityMessageBox(xmlFile.GetErrorStr(),
_("Error Opening Project"),
wxOK | wxCENTRE, this);
}
@ -3461,7 +3460,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
projName = GetName() + wxT("_data");
if (!mDirManager->SetProject(projPath, projName, false)) {
wxMessageBox(wxString::Format(_("Couldn't find the project data folder: \"%s\""),
AudacityMessageBox(wxString::Format(_("Couldn't find the project data folder: \"%s\""),
projName.c_str()),
_("Error Opening Project"),
wxOK | wxCENTRE, this);
@ -3520,7 +3519,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
msg.Printf(_("This file was saved using Audacity %s.\nYou are using Audacity %s. You may need to upgrade to a newer version to open this file."),
audacityVersion.c_str(),
AUDACITY_VERSION_STRING);
wxMessageBox(msg,
AudacityMessageBox(msg,
_("Can't open project file"),
wxOK | wxICON_EXCLAMATION | wxCENTRE, this);
return false;
@ -3552,7 +3551,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
// Stop icon, and choose 'NO' by default.
icon_choice = wxICON_STOP | wxNO_DEFAULT;
int action =
wxMessageBox(msg,
AudacityMessageBox(msg,
_("Warning - Opening Old Project File"),
wxYES_NO | icon_choice | wxCENTRE,
this);
@ -3781,7 +3780,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
if (!bHasTracks)
{
if (GetUndoManager()->UnsavedChanges() && mEmptyCanBeDirty) {
int result = wxMessageBox(_("Your project is now empty.\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nClick 'No', Edit > Undo until all tracks\nare open, then File > Save Project.\n\nSave anyway?"),
int result = AudacityMessageBox(_("Your project is now empty.\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nClick 'No', Edit > Undo until all tracks\nare open, then File > Save Project.\n\nSave anyway?"),
_("Warning - Empty Project"),
wxYES_NO | wxICON_QUESTION, this);
if (result == wxNO)
@ -3822,7 +3821,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
wxRemoveFile(safetyFileName);
if ( !wxRenameFile(mFileName, safetyFileName) ) {
wxMessageBox(_("Could not create safety file: ") + safetyFileName,
AudacityMessageBox(_("Could not create safety file: ") + safetyFileName,
_("Error"), wxICON_STOP, this);
return false;
}
@ -3841,7 +3840,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
// mStrOtherNamesArray is a temporary array of file names, used only when
// saving compressed
if (!success) {
wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."),
AudacityMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."),
project.c_str()),
_("Error Saving Project"),
wxICON_ERROR, this);
@ -3866,7 +3865,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
projPath = wxPathOnly(project);
if( !wxDir::Exists( projPath ) ){
wxMessageBox(wxString::Format(
AudacityMessageBox(wxString::Format(
_("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."),
projPath.c_str()),
_("Error Saving Project"),
@ -4301,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"),
@ -4402,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"),
@ -5282,7 +5281,7 @@ void AudacityProject::AutoSave()
if (!wxRenameFile(fn + wxT(".tmp"), fn + wxT(".autosave")))
{
wxMessageBox(_("Could not create autosave file: ") + fn +
AudacityMessageBox(_("Could not create autosave file: ") + fn +
wxT(".autosave"), _("Error"), wxICON_STOP, this);
return;
}
@ -5301,7 +5300,7 @@ void AudacityProject::DeleteCurrentAutoSaveFile()
{
if (!wxRemoveFile(mAutoSaveFileName))
{
wxMessageBox(_("Could not remove old autosave file: ") +
AudacityMessageBox(_("Could not remove old autosave file: ") +
mAutoSaveFileName, _("Error"), wxICON_STOP, this);
return;
}

View File

@ -531,7 +531,7 @@ void ScreenFrame::OnDirChoose(wxCommandEvent & WXUNUSED(event))
{
wxString current = mDirectoryTextBox->GetValue();
wxDirDialog dlog(this,
wxDirDialogWrapper dlog(this,
_("Choose a location to save screenshot images"),
current);

View File

@ -52,6 +52,8 @@
#include "InconsistencyException.h"
#include "widgets/ErrorDialog.h"
size_t Sequence::sMaxDiskBlockSize = 1048576;
// Sequence methods
@ -1060,7 +1062,7 @@ void Sequence::WriteXML(XMLWriter &xmlFile) const
wxString::Format(
_("Sequence has block file exceeding maximum %s samples per block.\nTruncating to this maximum length."),
Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
wxMessageBox(sMsg, _("Warning - Truncating Overlong Block File"), wxICON_EXCLAMATION | wxOK);
AudacityMessageBox(sMsg, _("Warning - Truncating Overlong Block File"), wxICON_EXCLAMATION | wxOK);
wxLogWarning(sMsg);
bb.f->SetLength(mMaxSamples);
}

View File

@ -47,6 +47,7 @@
#include "ShuttleGui.h"
#include "TranslatableStringArray.h"
#include "widgets/Grid.h"
#include "widgets/ErrorDialog.h"
#include "xml/XMLFileReader.h"
#include <wx/button.h>
@ -55,7 +56,6 @@
#include <wx/filename.h>
#include <wx/intl.h>
#include <wx/listctrl.h>
#include <wx/msgdlg.h>
#include <wx/notebook.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
@ -1112,7 +1112,7 @@ void TagsEditor::OnEdit(wxCommandEvent & WXUNUSED(event))
wxFileName fn(FileNames::DataDir(), wxT("genres.txt"));
wxFile f(fn.GetFullPath(), wxFile::write);
if (!f.IsOpened() || !f.Write(tc->GetValue())) {
wxMessageBox(_("Unable to save genre file."), _("Reset Genres"));
AudacityMessageBox(_("Unable to save genre file."), _("Reset Genres"));
return;
}
@ -1123,7 +1123,7 @@ void TagsEditor::OnEdit(wxCommandEvent & WXUNUSED(event))
void TagsEditor::OnReset(wxCommandEvent & WXUNUSED(event))
{
int id = wxMessageBox(_("Are you sure you want to reset the genre list to defaults?"),
int id = AudacityMessageBox(_("Are you sure you want to reset the genre list to defaults?"),
_("Reset Genres"),
wxYES_NO);
@ -1139,7 +1139,7 @@ void TagsEditor::OnReset(wxCommandEvent & WXUNUSED(event))
(!tf.Exists() && tf.Create());
if (!open) {
wxMessageBox(_("Unable to open genre file."), _("Reset Genres"));
AudacityMessageBox(_("Unable to open genre file."), _("Reset Genres"));
mLocal.LoadGenres();
return;
}
@ -1151,7 +1151,7 @@ void TagsEditor::OnReset(wxCommandEvent & WXUNUSED(event))
}
if (!tf.Write()) {
wxMessageBox(_("Unable to save genre file."), _("Reset Genres"));
AudacityMessageBox(_("Unable to save genre file."), _("Reset Genres"));
mLocal.LoadGenres();
return;
}
@ -1198,7 +1198,7 @@ void TagsEditor::OnLoad(wxCommandEvent & WXUNUSED(event))
XMLFileReader reader;
if (!reader.Parse(&mLocal, fn)) {
// Inform user of load failure
wxMessageBox(reader.GetErrorStr(),
AudacityMessageBox(reader.GetErrorStr(),
_("Error Loading Metadata"),
wxOK | wxCENTRE,
this);

View File

@ -66,7 +66,6 @@ can't be.
#include <wx/file.h>
#include <wx/ffile.h>
#include <wx/mstream.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include "Project.h"
@ -81,6 +80,7 @@ can't be.
#include "Prefs.h"
#include "AColor.h"
#include "ImageManipulation.h"
#include "widgets/ErrorDialog.h"
#include <wx/arrimpl.cpp>
@ -756,7 +756,7 @@ void ThemeBase::CreateImageCache( bool bBinarySave )
#if 0
if( wxFileExist( FileName ))
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
// _("Theme cache file:\n %s\nalready exists.\nAre you sure you want to replace it?"),
FileName.c_str() )
@ -774,13 +774,13 @@ void ThemeBase::CreateImageCache( bool bBinarySave )
#endif
if( !ImageCache.SaveFile( FileName, wxBITMAP_TYPE_PNG ))
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not write file:\n %s."),
FileName.c_str() ));
return;
}
wxMessageBox(
AudacityMessageBox(
wxString::Format(
/* i18n-hint: A theme is a consistent visual style across an application's
graphical user interface, including choices of colors, and similarity of images
@ -796,7 +796,7 @@ void ThemeBase::CreateImageCache( bool bBinarySave )
const wxString &FileName = FileNames::ThemeCacheAsCee( );
if( !OutStream.OpenFile( FileName ))
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not open file:\n %s\nfor writing."),
FileName.c_str() ));
@ -804,13 +804,13 @@ void ThemeBase::CreateImageCache( bool bBinarySave )
}
if( !ImageCache.SaveFile(OutStream, wxBITMAP_TYPE_PNG ) )
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not write images to file:\n %s."),
FileName.c_str() ));
return;
}
wxMessageBox(
AudacityMessageBox(
wxString::Format(
/* i18n-hint "Cee" means the C computer programming language */
_("Theme as Cee code written to:\n %s."),
@ -965,7 +965,7 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
{
if( bOkIfNotFound )
return false; // did not load the images, so return false.
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not find file:\n %s.\nTheme not loaded."),
FileName.c_str() ));
@ -974,7 +974,7 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
if( !ImageCache.LoadFile( FileName, wxBITMAP_TYPE_PNG ))
{
/* i18n-hint: Do not translate png. It is the name of a file format.*/
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not load file:\n %s.\nBad png format perhaps?"),
FileName.c_str() ));
@ -1014,7 +1014,7 @@ bool ThemeBase::ReadImageCache( teThemeType type, bool bOkIfNotFound)
// was not a valid png image.
// Most likely someone edited it by mistake,
// Or some experiment is being tried with NEW formats for it.
wxMessageBox(_("Audacity could not read its default theme.\nPlease report the problem."));
AudacityMessageBox(_("Audacity could not read its default theme.\nPlease report the problem."));
return false;
}
//wxLogDebug("Read %i by %i", ImageCache.GetWidth(), ImageCache.GetHeight() );
@ -1092,7 +1092,7 @@ void ThemeBase::LoadComponents( bool bOkIfNotFound )
if( !mImages[i].LoadFile( FileName, wxBITMAP_TYPE_PNG ))
{
/* i18n-hint: Do not translate png. It is the name of a file format.*/
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not load file:\n %s.\nBad png format perhaps?"),
FileName.c_str() ));
@ -1116,7 +1116,7 @@ void ThemeBase::LoadComponents( bool bOkIfNotFound )
{
if( bOkIfNotFound )
return;
wxMessageBox(wxString::Format(_("None of the expected theme component files\n were found in:\n %s."),
AudacityMessageBox(wxString::Format(_("None of the expected theme component files\n were found in:\n %s."),
FileNames::ThemeComponentsDir().c_str()));
}
}
@ -1138,7 +1138,7 @@ void ThemeBase::SaveComponents()
#endif
if( !wxDirExists( FileNames::ThemeComponentsDir() ))
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Could not create directory:\n %s"),
FileNames::ThemeComponentsDir().c_str() ));
@ -1166,11 +1166,11 @@ void ThemeBase::SaveComponents()
if (n > 0)
{
auto result =
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Some required files in:\n %s\nwere already present. Overwrite?"),
FileNames::ThemeComponentsDir().c_str()),
wxMessageBoxCaptionStr,
AudacityMessageBoxCaptionStr(),
wxYES_NO | wxNO_DEFAULT);
if(result == wxNO)
return;
@ -1183,7 +1183,7 @@ void ThemeBase::SaveComponents()
FileName = FileNames::ThemeComponent( mBitmapNames[i] );
if( !mImages[i].SaveFile( FileName, wxBITMAP_TYPE_PNG ))
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Audacity could not save file:\n %s"),
FileName.c_str() ));
@ -1191,7 +1191,7 @@ void ThemeBase::SaveComponents()
}
}
}
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Theme written to:\n %s."),
FileNames::ThemeComponentsDir().c_str() ));

View File

@ -32,7 +32,6 @@
#include <wx/string.h>
#include <wx/timer.h>
#include <wx/dynlib.h> //<! For windows.h
#include <wx/msgdlg.h>
#include "ShuttleGui.h"
#include "Project.h"
@ -40,6 +39,7 @@
#include "Prefs.h"
#include "widgets/NumericTextCtrl.h"
#include "widgets/HelpSystem.h"
#include "widgets/ErrorDialog.h"
#define TIMER_ID 7000
@ -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."),
@ -364,7 +364,7 @@ void TimerRecordDialog::OnOK(wxCommandEvent& WXUNUSED(event))
this->TransferDataFromWindow();
if (!m_TimeSpan_Duration.IsPositive())
{
wxMessageBox(_("Duration is zero. Nothing will be recorded."),
AudacityMessageBox(_("Duration is zero. Nothing will be recorded."),
_("Error in Duration"), wxICON_EXCLAMATION | wxOK);
return;
}
@ -373,14 +373,14 @@ void TimerRecordDialog::OnOK(wxCommandEvent& WXUNUSED(event))
wxString sTemp = m_fnAutoSaveFile.GetFullPath();
if (m_pTimerAutoSaveCheckBoxCtrl->IsChecked()) {
if (!m_fnAutoSaveFile.IsOk() || m_fnAutoSaveFile.IsDir()) {
wxMessageBox(_("Automatic Save path is invalid."),
AudacityMessageBox(_("Automatic Save path is invalid."),
_("Error in Automatic Save"), wxICON_EXCLAMATION | wxOK);
return;
}
}
if (m_pTimerAutoExportCheckBoxCtrl->IsChecked()) {
if (!m_fnAutoExportFile.IsOk() || m_fnAutoExportFile.IsDir()) {
wxMessageBox(_("Automatic Export path is invalid."),
AudacityMessageBox(_("Automatic Export path is invalid."),
_("Error in Automatic Export"), wxICON_EXCLAMATION | wxOK);
return;
}
@ -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);
@ -469,7 +469,7 @@ bool TimerRecordDialog::HaveFilesToRecover()
{
wxDir dir(FileNames::AutoSaveDir());
if (!dir.IsOpened()) {
wxMessageBox(_("Could not enumerate files in auto save directory."),
AudacityMessageBox(_("Could not enumerate files in auto save directory."),
_("Error"), wxICON_STOP);
return false;
}
@ -492,7 +492,7 @@ bool TimerRecordDialog::RemoveAllAutoSaveFiles()
{
// I don't think this error message is actually useful.
// -dmazzoni
//wxMessageBox(_("Could not remove auto save file: " + files[i]),
//AudacityMessageBox(_("Could not remove auto save file: " + files[i]),
// _("Error"), wxICON_STOP);
return false;
}
@ -648,7 +648,7 @@ int TimerRecordDialog::ExecutePostRecordActions(bool bWasStopped) {
}
// Show Error Message Box
wxMessageBox(sMessage, _("Error"), wxICON_EXCLAMATION | wxOK);
AudacityMessageBox(sMessage, _("Error"), wxICON_EXCLAMATION | wxOK);
} else {
if (bWasStopped && (iOverriddenAction != POST_TIMER_RECORD_NOTHING)) {
@ -657,7 +657,7 @@ int TimerRecordDialog::ExecutePostRecordActions(bool bWasStopped) {
m_pTimerAfterCompleteChoiceCtrl->GetString(iOverriddenAction));
}
wxMessageBox(sMessage, _("Timer Recording"), wxICON_INFORMATION | wxOK);
AudacityMessageBox(sMessage, _("Timer Recording"), wxICON_INFORMATION | wxOK);
}
}

View File

@ -22,17 +22,16 @@ or "OFF" point
#include "VoiceKey.h"
#include <wx/string.h>
#include <wx/msgdlg.h>
#include <math.h>
#include <stdio.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/textfile.h>
#include <wx/intl.h>
#include <iostream>
#include "WaveTrack.h"
#include "widgets/ErrorDialog.h"
using std::cout;
using std::endl;
@ -96,7 +95,7 @@ sampleCount VoiceKey::OnForward (
backwards by words. So 'key' is being used in the sense of an index.
This error message means that you've selected too short
a region of audio to be able to use this feature.*/
wxMessageBox(_("Selection is too small to use voice key."));
AudacityMessageBox(_("Selection is too small to use voice key."));
return start;
}
else {
@ -244,7 +243,7 @@ sampleCount VoiceKey::OnBackward (
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
AudacityMessageBox(_("Selection is too small to use voice key."));
return end;
}
else {
@ -381,7 +380,7 @@ sampleCount VoiceKey::OffForward (
{
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
AudacityMessageBox(_("Selection is too small to use voice key."));
return start;
}
@ -519,7 +518,7 @@ sampleCount VoiceKey::OffBackward (
if((mWindowSize) >= (len + 10).as_double() ){
wxMessageBox(_("Selection is too small to use voice key."));
AudacityMessageBox(_("Selection is too small to use voice key."));
return end;
}
else {
@ -817,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) }

View File

@ -24,7 +24,6 @@
#include <wx/gdicmn.h>
#include <wx/longlong.h>
#include <wx/msgdlg.h>
#include <vector>

View File

@ -83,7 +83,6 @@ CommandManager. It holds the callback for one command.
#include <wx/hash.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/tokenzr.h>
#include "../AudacityException.h"
@ -1710,7 +1709,7 @@ bool CommandManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
void CommandManager::HandleXMLEndTag(const wxChar *tag)
{
if (!wxStrcmp(tag, wxT("audacitykeyboard"))) {
wxMessageBox(wxString::Format(_("Loaded %d keyboard shortcuts\n"),
AudacityMessageBox(wxString::Format(_("Loaded %d keyboard shortcuts\n"),
mXMLKeysRead),
_("Loading Keyboard Shortcuts"),
wxOK | wxCENTRE);

View File

@ -24,11 +24,11 @@ should be reference-counted.
#include "../MemoryX.h"
#include <wx/string.h>
#include <wx/msgdlg.h>
#include <wx/statusbr.h>
#include "../widgets/ProgressDialog.h"
#include "../commands/ResponseQueue.h"
#include "../src/Project.h"
#include "../widgets/ErrorDialog.h"
/// Interface for objects that can receive command progress information
class CommandProgressTarget /* not final */
@ -96,14 +96,14 @@ public:
void Update(const wxString &) override {}
};
/// Displays messages from a command in a wxMessageBox
/// Displays messages from a command in an AudacityMessageBox
class MessageBoxTarget final : public CommandMessageTarget
{
public:
virtual ~MessageBoxTarget() {}
void Update(const wxString &message) override
{
wxMessageBox(message);
AudacityMessageBox(message);
}
};

View File

@ -26,7 +26,6 @@
#include <wx/dcmemory.h>
#include <wx/dynarray.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include "../AColor.h"
#include "../AllThemeResources.h"
@ -37,6 +36,7 @@
#include "../widgets/valnum.h"
#include "../WaveTrack.h"
#include "../widgets/ErrorDialog.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
@ -230,12 +230,12 @@ bool EffectAutoDuck::Init()
}
else
{
wxMessageBox(
Effect::MessageBox(
_("You selected a track which does not contain audio. AutoDuck can only process audio tracks."),
/* i18n-hint: Auto duck is the name of an effect that 'ducks' (reduces the volume)
* of the audio automatically when there is sound on another track. Not as
* in 'Donald-Duck'!*/
_("Auto Duck"), wxICON_ERROR, mUIParent);
wxICON_ERROR);
return false;
}
}
@ -245,9 +245,9 @@ bool EffectAutoDuck::Init()
if (!controlTrackCandidate)
{
wxMessageBox(
Effect::MessageBox(
_("Auto Duck needs a control track which must be placed below the selected track(s)."),
_("Auto Duck"), wxICON_ERROR, mUIParent);
wxICON_ERROR);
return false;
}

View File

@ -30,11 +30,11 @@
#include <math.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/valgen.h>
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "../widgets/ErrorDialog.h"
#include "../widgets/valnum.h"
#include "../WaveTrack.h"
@ -192,9 +192,8 @@ bool EffectClickRemoval::Process()
count++;
}
if (bGoodResult && !mbDidSomething) // Processing successful, but ineffective.
wxMessageBox(
Effect::MessageBox(
wxString::Format(_("Algorithm not effective on this audio. Nothing changed.")),
GetName(),
wxOK | wxICON_ERROR);
this->ReplaceProcessedTracks(bGoodResult && mbDidSomething);
@ -205,10 +204,9 @@ bool EffectClickRemoval::ProcessOne(int count, WaveTrack * track, sampleCount st
{
if (len <= windowSize / 2)
{
wxMessageBox(
Effect::MessageBox(
wxString::Format(_("Selection must be larger than %d samples."),
windowSize / 2),
GetName(),
wxOK | wxICON_ERROR);
return false;
}

View File

@ -33,7 +33,6 @@
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include "../AColor.h"
#include "../Prefs.h"

View File

@ -20,6 +20,7 @@
#include "../widgets/LinkingHtmlWindow.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/NumericTextCtrl.h"
#include "../widgets/ErrorDialog.h"
#include <cmath>
#include <limits>
@ -53,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;
}
@ -72,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;
}
@ -94,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;
}
@ -512,7 +513,7 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
#endif
f.Open();
if (!f.IsOpened()) {
wxMessageBox(_("Couldn't write to file: ") + fName);
AudacityMessageBox(_("Couldn't write to file: ") + fName);
return;
}

View File

@ -27,6 +27,7 @@
#include <wx/intl.h>
#include "../ShuttleGui.h"
#include "../widgets/ErrorDialog.h"
#include "../widgets/valnum.h"
#include "../SampleFormat.h"
@ -104,7 +105,7 @@ bool EffectEcho::ProcessInitialize(sampleCount WXUNUSED(totalLen), ChannelNames
history.reinit(histLen, true);
}
catch ( const std::bad_alloc& ) {
wxMessageBox(_("Requested value exceeds memory capacity."));
Effect::MessageBox(_("Requested value exceeds memory capacity."));
return false;
}

View File

@ -28,7 +28,6 @@ greater use in future.
#include <wx/defs.h>
#include <wx/hashmap.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/stockitem.h>
#include <wx/string.h>
@ -2646,7 +2645,7 @@ int Effect::MessageBox
title = GetTranslatedName();
else
title = wxString::Format(_("%s: %s"), GetTranslatedName(), titleStr);
return wxMessageBox(message, title, style, mUIParent);
return AudacityMessageBox(message, title, style, mUIParent);
}
BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper)
@ -3554,7 +3553,7 @@ void EffectUIHost::OnDeletePreset(wxCommandEvent & evt)
{
wxString preset = mUserPresets[evt.GetId() - kDeletePresetID];
int res = wxMessageBox(wxString::Format(_("Are you sure you want to delete \"%s\"?"), preset.c_str()),
int res = AudacityMessageBox(wxString::Format(_("Are you sure you want to delete \"%s\"?"), preset.c_str()),
_("Delete Preset"),
wxICON_QUESTION | wxYES_NO);
if (res == wxYES)
@ -3606,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();
@ -3616,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);

View File

@ -12,11 +12,11 @@
#include "../Audacity.h"
#include <algorithm>
#include <wx/msgdlg.h>
#include <wx/stopwatch.h>
#include <wx/tokenzr.h>
#include "../Experimental.h"
#include "../widgets/ErrorDialog.h"
#if defined(EXPERIMENTAL_EFFECTS_RACK)
#include "EffectRack.h"
@ -717,7 +717,7 @@ Effect *EffectManager::GetEffect(const PluginID & ID)
}
}
wxMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
PluginManager::Get().GetName(ID).c_str()),
_("Effect failed to initialize"));

View File

@ -60,7 +60,6 @@
#include <wx/bitmap.h>
#include <wx/button.h>
#include <wx/msgdlg.h>
#include <wx/brush.h>
#include <wx/button.h> // not really needed here
#include <wx/dcmemory.h>
@ -372,10 +371,9 @@ bool EffectEqualization::ValidateUI()
// we offer to save it.
while (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed")))
{
wxMessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."),
_("EQ Curve needs a different name"),
Effect::MessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."),
wxOK | wxCENTRE,
mUIParent);
_("EQ Curve needs a different name"));
return false;
}
@ -484,7 +482,7 @@ bool EffectEqualization::Init()
}
else {
if (track->GetRate() != rate) {
wxMessageBox(_("To apply Equalization, all selected tracks must have the same sample rate."));
Effect::MessageBox(_("To apply Equalization, all selected tracks must have the same sample rate."));
return(false);
}
}
@ -496,9 +494,9 @@ bool EffectEqualization::Init()
mHiFreq = rate / 2.0;
// Unlikely, but better than crashing.
if (mHiFreq <= loFreqI) {
wxMessageBox( _("Track sample rate is too low for this effect."),
_("Effect Unavailable"),
wxOK | wxCENTRE);
Effect::MessageBox( _("Track sample rate is too low for this effect."),
wxOK | wxCENTRE,
_("Effect Unavailable"));
return(false);
}
@ -1394,9 +1392,9 @@ void EffectEqualization::LoadCurves(const wxString &fileName, bool append)
/* i18n-hint: EQ stands for 'Equalization'.*/
msg.Printf(_("Error Loading EQ Curves from file:\n%s\nError message says:\n%s"), fullPath.c_str(), reader.GetErrorStr().c_str());
// Inform user of load failure
wxMessageBox( msg,
_("Error Loading EQ Curves"),
wxOK | wxCENTRE);
Effect::MessageBox( msg,
wxOK | wxCENTRE,
_("Error Loading EQ Curves"));
mCurves.Add( _("unnamed") ); // we always need a default curve to use
return;
}
@ -1790,7 +1788,9 @@ void EffectEqualization::setCurve(const wxString &curveName)
break;
if( i == mCurves.GetCount())
{
wxMessageBox( _("Requested curve not found, using 'unnamed'"), _("Curve not found"), wxOK|wxICON_ERROR );
Effect::MessageBox( _("Requested curve not found, using 'unnamed'"),
wxOK|wxICON_ERROR,
_("Curve not found") );
setCurve((int) mCurves.GetCount()-1);
}
else
@ -3220,7 +3220,9 @@ void EditCurvesDialog::OnUp(wxCommandEvent & WXUNUSED(event))
{
if ( item == mList->GetItemCount()-1)
{ // 'unnamed' always stays at the bottom
wxMessageBox(_("'unnamed' always stays at the bottom of the list"), _("'unnamed' is special")); // these could get tedious!
mEffect->Effect::MessageBox(_("'unnamed' always stays at the bottom of the list"),
Effect::DefaultMessageBoxStyle,
_("'unnamed' is special")); // these could get tedious!
return;
}
state = mList->GetItemState(item-1, wxLIST_STATE_SELECTED);
@ -3313,7 +3315,7 @@ void EditCurvesDialog::OnRename(wxCommandEvent & WXUNUSED(event))
{ // Show the dialog and bail if the user cancels
bad = false;
// build the dialog
wxTextEntryDialog dlg( this,
AudacityTextEntryDialog dlg( this,
_("Rename '") + mEditCurves[ item ].Name + _("' to..."),
_("Rename...") );
dlg.SetTextValidator( wxFILTER_EXCLUDE_CHAR_LIST );
@ -3338,11 +3340,11 @@ void EditCurvesDialog::OnRename(wxCommandEvent & WXUNUSED(event))
bad = true;
if( curve == item ) // trying to rename a curve with the same name
{
wxMessageBox( _("Name is the same as the original one"), _("Same name"), wxOK );
mEffect->Effect::MessageBox( _("Name is the same as the original one"), wxOK, _("Same name") );
break;
}
int answer = wxMessageBox( _("Overwrite existing curve '") + name +_("'?"),
_("Curve exists"), wxYES_NO );
int answer = mEffect->Effect::MessageBox( _("Overwrite existing curve '") + name +_("'?"),
wxYES_NO, _("Curve exists") );
if (answer == wxYES)
{
bad = false;
@ -3413,8 +3415,8 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
{
if(item == mList->GetItemCount()-1) //unnamed
{
wxMessageBox(_("You cannot delete the 'unnamed' curve."),
_("Can't delete 'unnamed'"), wxOK | wxCENTRE, this);
mEffect->Effect::MessageBox(_("You cannot delete the 'unnamed' curve."),
wxOK | wxCENTRE, _("Can't delete 'unnamed'"));
}
else
{
@ -3423,7 +3425,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
quest = wxString(_("Delete '")) + mEditCurves[ item-deleted ].Name + _("' ?");
// Ask for confirmation before removal
int ans = wxMessageBox( quest, _("Confirm Deletion"), wxYES_NO | wxCENTRE, this );
int ans = mEffect->Effect::MessageBox( quest, wxYES_NO | wxCENTRE, _("Confirm Deletion") );
if( ans == wxYES )
{ // Remove the curve from the array
mEditCurves.RemoveAt( item-deleted );
@ -3453,7 +3455,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
else
return;
// Ask for confirmation before removal
int ans = wxMessageBox( quest, _("Confirm Deletion"), wxYES_NO | wxCENTRE, this );
int ans = mEffect->Effect::MessageBox( quest, wxYES_NO | wxCENTRE, _("Confirm Deletion") );
if( ans == wxYES )
{ // Remove the curve(s) from the array
// Take care, mList and mEditCurves will get out of sync as curves are deleted
@ -3462,8 +3464,9 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
{
if(item == mList->GetItemCount()-1) //unnamed
{
wxMessageBox(_("You cannot delete the 'unnamed' curve, it is special."),
_("Can't delete 'unnamed'"), wxOK | wxCENTRE, this);
mEffect->Effect::MessageBox(_("You cannot delete the 'unnamed' curve, it is special."),
Effect::DefaultMessageBoxStyle,
_("Can't delete 'unnamed'"));
}
else
{
@ -3479,7 +3482,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
{
FileDialog filePicker(this, _("Choose an EQ curve file"), FileNames::DataDir(), wxT(""), _("xml files (*.xml;*.XML)|*.xml;*.XML"));
FileDialogWrapper filePicker(this, _("Choose an EQ curve file"), FileNames::DataDir(), wxT(""), _("xml files (*.xml;*.XML)|*.xml;*.XML"));
wxString fileName = wxT("");
if( filePicker.ShowModal() == wxID_CANCEL)
return;
@ -3499,7 +3502,7 @@ void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
{
FileDialog filePicker(this, _("Export EQ curves as..."), FileNames::DataDir(), wxT(""), wxT("*.XML"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
FileDialogWrapper filePicker(this, _("Export EQ curves as..."), FileNames::DataDir(), wxT(""), wxT("*.XML"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
wxString fileName = wxT("");
if( filePicker.ShowModal() == wxID_CANCEL)
return;
@ -3521,7 +3524,9 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
i++;
}
else
wxMessageBox(_("You cannot export 'unnamed' curve, it is special."), _("Cannot Export 'unnamed'"));
mEffect->Effect::MessageBox(_("You cannot export 'unnamed' curve, it is special."),
Effect::DefaultMessageBoxStyle,
_("Cannot Export 'unnamed'"));
// get next selected item
item = mList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
}
@ -3532,10 +3537,14 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
mEffect->mCurves = temp;
wxString message;
message.Printf(_("%d curves exported to %s"), i, fileName.c_str());
wxMessageBox(message, _("Curves exported"));
mEffect->Effect::MessageBox(message,
Effect::DefaultMessageBoxStyle,
_("Curves exported"));
}
else
wxMessageBox(_("No curves exported"), _("No curves exported"));
mEffect->Effect::MessageBox(_("No curves exported"),
Effect::DefaultMessageBoxStyle,
_("No curves exported"));
}
void EditCurvesDialog::OnLibrary( wxCommandEvent & WXUNUSED(event))

View File

@ -506,7 +506,7 @@ bool EffectEqualization48x::Benchmark(EffectEqualization* effectEqualization)
wxTimeSpan tsDefaultThreaded(0, 0, 0, times[3]);
wxTimeSpan tsDefault(0, 0, 0, times[4]);
wxMessageBox(wxString::Format(_("Benchmark times:\nOriginal: %s\nDefault Segmented: %s\nDefault Threaded: %s\nSSE: %s\nSSE Threaded: %s\n"),tsDefault.Format(wxT("%M:%S.%l")).c_str(),
Effect::MessageBox(wxString::Format(_("Benchmark times:\nOriginal: %s\nDefault Segmented: %s\nDefault Threaded: %s\nSSE: %s\nSSE Threaded: %s\n"),tsDefault.Format(wxT("%M:%S.%l")).c_str(),
tsDefaultEnhanced.Format(wxT("%M:%S.%l")).c_str(), tsDefaultThreaded.Format(wxT("%M:%S.%l")).c_str(),tsSSE.Format(wxT("%M:%S.%l")).c_str(),tsSSEThreaded.Format(wxT("%M:%S.%l")).c_str()));
return bBreakLoop; // return !bBreakLoop ?
}

View File

@ -28,6 +28,7 @@
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "../widgets/ErrorDialog.h"
#include "../LabelTrack.h"
#include "../WaveTrack.h"
@ -172,7 +173,7 @@ bool EffectFindClipping::ProcessOne(LabelTrack * lt,
buffer.reinit(blockSize);
}
catch( const std::bad_alloc & ) {
wxMessageBox(_("Requested value exceeds memory capacity."));
Effect::MessageBox(_("Requested value exceeds memory capacity."));
return false;
}

View File

@ -23,6 +23,7 @@
#include "TimeWarper.h"
#include "../MemoryX.h"
#include "../widgets/ErrorDialog.h"
bool Generator::Process()
{
@ -54,9 +55,10 @@ bool Generator::Process()
track->IsEmpty(mT0, mT1+1.0/track->GetRate()) &&
!track->IsEmpty(mT0, mT0+GetDuration()-(mT1-mT0)-1.0/track->GetRate()))
{
wxMessageBox(
Effect::MessageBox(
_("There is not enough room available to generate the audio"),
_("Error"), wxICON_STOP);
wxICON_STOP,
_("Error"));
Failure();
return false;
}

View File

@ -45,6 +45,7 @@
#include "../Prefs.h"
#include "../WaveTrack.h"
#include "../widgets/ErrorDialog.h"
#include <algorithm>
#include <vector>
@ -206,7 +207,7 @@ public:
bool PromptUser(EffectNoiseReduction *effect,
wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings);
bool PrefsIO(bool read);
bool Validate() const;
bool Validate(EffectNoiseReduction *effect) const;
size_t WindowSize() const { return 1u << (3 + mWindowSizeChoice); }
unsigned StepsPerWindow() const { return 1u << (1 + mStepsPerWindowChoice); }
@ -576,20 +577,20 @@ bool EffectNoiseReduction::Settings::PrefsIO(bool read)
}
}
bool EffectNoiseReduction::Settings::Validate() const
bool EffectNoiseReduction::Settings::Validate(EffectNoiseReduction *effect) const
{
if (StepsPerWindow() < windowTypesInfo[mWindowTypes].minSteps) {
::wxMessageBox(_("Steps per block are too few for the window types."));
effect->Effect::MessageBox(_("Steps per block are too few for the window types."));
return false;
}
if (StepsPerWindow() > WindowSize()) {
::wxMessageBox(_("Steps per block cannot exceed the window size."));
effect->Effect::MessageBox(_("Steps per block cannot exceed the window size."));
return false;
}
if (mMethod == DM_MEDIAN && StepsPerWindow() > 4) {
::wxMessageBox(_("Median method is not implemented for more than four steps per window."));
effect->Effect::MessageBox(_("Median method is not implemented for more than four steps per window."));
return false;
}
@ -616,12 +617,12 @@ bool EffectNoiseReduction::Process()
}
else if (mStatistics->mWindowSize != mSettings->WindowSize()) {
// possible only with advanced settings
::wxMessageBox(_("You must specify the same window size for steps 1 and 2."));
::Effect::MessageBox(_("You must specify the same window size for steps 1 and 2."));
return false;
}
else if (mStatistics->mWindowTypes != mSettings->mWindowTypes) {
// A warning only
::wxMessageBox(_("Warning: window types are not the same as for profiling."));
::Effect::MessageBox(_("Warning: window types are not the same as for profiling."));
}
Worker worker(*mSettings, mStatistics->mRate
@ -653,9 +654,9 @@ bool EffectNoiseReduction::Worker::Process
while (track) {
if (track->GetRate() != mSampleRate) {
if (mDoProfile)
::wxMessageBox(_("All noise profile data must have the same sample rate."));
effect.Effect::MessageBox(_("All noise profile data must have the same sample rate."));
else
::wxMessageBox(_("The sample rate of the noise profile must match that of the sound to be processed."));
effect.Effect::MessageBox(_("The sample rate of the noise profile must match that of the sound to be processed."));
return false;
}
@ -679,7 +680,7 @@ bool EffectNoiseReduction::Worker::Process
if (mDoProfile) {
if (statistics.mTotalWindows == 0) {
::wxMessageBox(_("Selected noise profile is too short."));
effect.Effect::MessageBox(_("Selected noise profile is too short."));
return false;
}
}
@ -1851,7 +1852,7 @@ bool EffectNoiseReduction::Dialog::TransferDataFromWindow()
wxCommandEvent dummy;
OnNoiseReductionChoice(dummy);
return mTempSettings.Validate();
return mTempSettings.Validate(m_pEffect);
}
void EffectNoiseReduction::Dialog::OnText(wxCommandEvent &event)

View File

@ -68,7 +68,6 @@
#include <wx/dcmemory.h>
#include <wx/image.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/stattext.h>

View File

@ -28,6 +28,7 @@
#include "../ShuttleGui.h"
#include "../FFT.h"
#include "../widgets/valnum.h"
#include "../widgets/ErrorDialog.h"
#include "../Prefs.h"
#include "../WaveTrack.h"
@ -255,7 +256,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
const auto stretch_buf_size = GetBufferSize(track->GetRate());
if (stretch_buf_size == 0) {
::wxMessageBox( badAllocMessage );
::Effect::MessageBox( badAllocMessage );
return false;
}
@ -268,7 +269,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
const auto minDuration = stretch_buf_size * 2 + 1;
if (minDuration < stretch_buf_size) {
// overflow!
::wxMessageBox( badAllocMessage );
::Effect::MessageBox( badAllocMessage );
return false;
}
@ -284,30 +285,30 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
if ((minDuration / mProjectRate) < defaultPreviewLen) {
::wxMessageBox (wxString::Format(_("Audio selection too short to preview.\n\n"
::Effect::MessageBox (wxString::Format(_("Audio selection too short to preview.\n\n"
"Try increasing the audio selection to at least %.1f seconds,\n"
"or reducing the 'Time Resolution' to less than %.1f seconds."),
(minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION);
wxOK | wxICON_EXCLAMATION);
}
else {
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
::wxMessageBox (wxString::Format(_("Unable to Preview.\n\n"
::Effect::MessageBox (wxString::Format(_("Unable to Preview.\n\n"
"For the current audio selection, the maximum\n"
"'Time Resolution' is %.1f seconds."),
floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION);
wxOK | wxICON_EXCLAMATION);
}
}
else {
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
::wxMessageBox (wxString::Format(_("The 'Time Resolution' is too long for the selection.\n\n"
::Effect::MessageBox (wxString::Format(_("The 'Time Resolution' is too long for the selection.\n\n"
"Try increasing the audio selection to at least %.1f seconds,\n"
"or reducing the 'Time Resolution' to less than %.1f seconds."),
(minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION);
wxOK | wxICON_EXCLAMATION);
}
return false;
@ -394,7 +395,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
return !cancelled;
}
catch ( const std::bad_alloc& ) {
::wxMessageBox( badAllocMessage );
::Effect::MessageBox( badAllocMessage );
return false;
}
};

View File

@ -26,10 +26,10 @@ the audio, rather than actually finding the clicks.
#include <math.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include "../InterpolateAudio.h"
#include "../WaveTrack.h"
#include "../widgets/ErrorDialog.h"
#include "Repair.h"
@ -91,7 +91,7 @@ bool EffectRepair::Process()
const auto repair1 = track->TimeToLongSamples(repair_t1);
const auto repairLen = repair1 - repair0;
if (repairLen > 128) {
::wxMessageBox(_("The Repair effect is intended to be used on very short sections of damaged audio (up to 128 samples).\n\nZoom in and select a tiny fraction of a second to repair."));
::Effect::MessageBox(_("The Repair effect is intended to be used on very short sections of damaged audio (up to 128 samples).\n\nZoom in and select a tiny fraction of a second to repair."));
bGoodResult = false;
break;
}
@ -108,7 +108,7 @@ bool EffectRepair::Process()
const auto len = s1 - s0;
if (s0 == repair0 && s1 == repair1) {
::wxMessageBox(_("Repair works by using audio data outside the selection region.\n\nPlease select a region that has audio touching at least one side of it.\n\nThe more surrounding audio, the better it performs."));
::Effect::MessageBox(_("Repair works by using audio data outside the selection region.\n\nPlease select a region that has audio touching at least one side of it.\n\nThe more surrounding audio, the better it performs."));
/// The Repair effect needs some data to go on.\n\nPlease select an area to repair with some audio on at least one side (the more the better)."));
bGoodResult = false;
break;

View File

@ -41,7 +41,6 @@ a graph for EffectScienFilter.
#include <wx/brush.h>
#include <wx/dcmemory.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include <wx/utils.h>
#include <wx/valgen.h>
@ -55,6 +54,7 @@ a graph for EffectScienFilter.
#include "../Theme.h"
#include "../WaveTrack.h"
#include "../widgets/valnum.h"
#include "../widgets/ErrorDialog.h"
#include "Equalization.h" // For SliderAx
@ -348,7 +348,7 @@ bool EffectScienFilter::Init()
{
if (t->GetRate() != rate)
{
wxMessageBox(_("To apply a filter, all selected tracks must have the same sample rate."));
Effect::MessageBox(_("To apply a filter, all selected tracks must have the same sample rate."));
return false;
}
}

View File

@ -34,7 +34,6 @@ It \TODO: description
#include <wx/choice.h>
#include <wx/image.h>
#include <wx/dcmemory.h>
#include <wx/msgdlg.h>
#include <wx/file.h>
#include <wx/filedlg.h>
#include <wx/intl.h>

View File

@ -32,6 +32,7 @@
#include "../ShuttleGui.h"
#include "../WaveTrack.h"
#include "../widgets/valnum.h"
#include "../widgets/ErrorDialog.h"
// Declaration of RegionList
class RegionList : public std::list < Region > {};
@ -288,7 +289,7 @@ bool EffectTruncSilence::ProcessIndependently()
if (track2->GetKind() == Track::Wave &&
!(track2 == track || track2 == link) &&
track2->GetSelected()) {
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
::Effect::MessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
return false;
}
}

View File

@ -59,7 +59,6 @@
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/module.h>
#include <wx/msgdlg.h>
#include <wx/process.h>
#include <wx/progdlg.h>
#include <wx/recguard.h>
@ -91,6 +90,7 @@
#include "../../widgets/NumericTextCtrl.h"
#include "../../widgets/wxPanelWrapper.h"
#include "../../widgets/valnum.h"
#include "../../widgets/ErrorDialog.h"
#include "../../xml/XMLFileReader.h"
#include "../../xml/XMLWriter.h"
@ -1874,7 +1874,7 @@ void VSTEffect::ExportPresets()
else
{
// This shouldn't happen, but complain anyway
wxMessageBox(_("Unrecognized file extension."),
AudacityMessageBox(_("Unrecognized file extension."),
_("Error Saving VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -1926,7 +1926,7 @@ void VSTEffect::ImportPresets()
else
{
// This shouldn't happen, but complain anyway
wxMessageBox(_("Unrecognized file extension."),
AudacityMessageBox(_("Unrecognized file extension."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -1936,7 +1936,7 @@ void VSTEffect::ImportPresets()
if (!success)
{
wxMessageBox(_("Unable to load presets file."),
AudacityMessageBox(_("Unable to load presets file."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3040,7 +3040,7 @@ bool VSTEffect::LoadFXB(const wxFileName & fn)
ArrayOf<unsigned char> data{ size_t(f.Length()) };
if (!data)
{
wxMessageBox(_("Unable to allocate memory when loading presets file."),
AudacityMessageBox(_("Unable to allocate memory when loading presets file."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3054,7 +3054,7 @@ bool VSTEffect::LoadFXB(const wxFileName & fn)
ssize_t len = f.Read((void *) bptr, f.Length());
if (f.Error())
{
wxMessageBox(_("Unable to read presets file."),
AudacityMessageBox(_("Unable to read presets file."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3211,7 +3211,7 @@ bool VSTEffect::LoadFXP(const wxFileName & fn)
ArrayOf<unsigned char> data{ size_t(f.Length()) };
if (!data)
{
wxMessageBox(_("Unable to allocate memory when loading presets file."),
AudacityMessageBox(_("Unable to allocate memory when loading presets file."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3225,7 +3225,7 @@ bool VSTEffect::LoadFXP(const wxFileName & fn)
ssize_t len = f.Read((void *) bptr, f.Length());
if (f.Error())
{
wxMessageBox(_("Unable to read presets file."),
AudacityMessageBox(_("Unable to read presets file."),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3421,7 +3421,7 @@ bool VSTEffect::LoadXML(const wxFileName & fn)
if (!ok)
{
// Inform user of load failure
wxMessageBox(reader.GetErrorStr(),
AudacityMessageBox(reader.GetErrorStr(),
_("Error Loading VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3438,7 +3438,7 @@ void VSTEffect::SaveFXB(const wxFileName & fn)
wxFFile f(fullPath, wxT("wb"));
if (!f.IsOpened())
{
wxMessageBox(wxString::Format(_("Could not open file: \"%s\""), fullPath.c_str()),
AudacityMessageBox(wxString::Format(_("Could not open file: \"%s\""), fullPath.c_str()),
_("Error Saving VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3505,7 +3505,7 @@ void VSTEffect::SaveFXB(const wxFileName & fn)
if (f.Error())
{
wxMessageBox(wxString::Format(_("Error writing to file: \"%s\""), fullPath.c_str()),
AudacityMessageBox(wxString::Format(_("Error writing to file: \"%s\""), fullPath.c_str()),
_("Error Saving VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3523,7 +3523,7 @@ void VSTEffect::SaveFXP(const wxFileName & fn)
wxFFile f(fullPath, wxT("wb"));
if (!f.IsOpened())
{
wxMessageBox(wxString::Format(_("Could not open file: \"%s\""), fullPath.c_str()),
AudacityMessageBox(wxString::Format(_("Could not open file: \"%s\""), fullPath.c_str()),
_("Error Saving VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3538,7 +3538,7 @@ void VSTEffect::SaveFXP(const wxFileName & fn)
f.Write(buf.GetData(), buf.GetDataLen());
if (f.Error())
{
wxMessageBox(wxString::Format(_("Error writing to file: \"%s\""), fullPath.c_str()),
AudacityMessageBox(wxString::Format(_("Error writing to file: \"%s\""), fullPath.c_str()),
_("Error Saving VST Presets"),
wxOK | wxCENTRE,
mParent);
@ -3733,7 +3733,7 @@ bool VSTEffect::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
{
wxString msg;
msg.Printf(_("This parameter file was saved from %s. Continue?"), value);
int result = wxMessageBox(msg, wxT("Confirm"), wxYES_NO, mParent);
int result = AudacityMessageBox(msg, wxT("Confirm"), wxYES_NO, mParent);
if (result == wxNO)
{
return false;

View File

@ -37,7 +37,6 @@ effects from this one class.
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/slider.h>
#include <wx/statbox.h>

View File

@ -25,7 +25,6 @@
#include <wx/evtloop.h>
#endif
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/tokenzr.h>
@ -38,6 +37,7 @@
#include "../../ShuttleGui.h"
#include "../../widgets/valnum.h"
#include "../../widgets/wxPanelWrapper.h"
#include "../../widgets/ErrorDialog.h"
#include "lilv/lilv.h"
#include "suil/suil.h"
@ -1034,7 +1034,7 @@ bool LV2Effect::PopulateUI(wxWindow *parent)
mMaster = InitInstance(mSampleRate);
if (mMaster == NULL)
{
wxMessageBox(_("Couldn't instantiate effect"));
AudacityMessageBox(_("Couldn't instantiate effect"));
return false;
}

View File

@ -36,7 +36,6 @@ effects from this one class.
#include <wx/datetime.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/sstream.h>
#include <wx/textdlg.h>
#include <wx/txtstrm.h>
@ -55,6 +54,7 @@ effects from this one class.
#include "../../WaveClip.h"
#include "../../WaveTrack.h"
#include "../../widgets/valnum.h"
#include "../../widgets/ErrorDialog.h"
#include "../../Prefs.h"
#include "../../prefs/WaveformSettings.h"
@ -451,10 +451,10 @@ bool NyquistEffect::Init()
}
if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
wxMessageBox(_("To use 'Spectral effects', enable 'Spectral Selection'\n"
Effect::MessageBox(_("To use 'Spectral effects', enable 'Spectral Selection'\n"
"in the track Spectrogram settings and select the\n"
"frequency range for the effect to act on."),
_("Error"), wxOK | wxICON_EXCLAMATION | wxCENTRE);
wxOK | wxICON_EXCLAMATION | wxCENTRE, _("Error"));
return false;
}
@ -665,9 +665,8 @@ bool NyquistEffect::Process()
mCurTrack[1] = (WaveTrack *)iter.Next();
if (mCurTrack[1]->GetRate() != mCurTrack[0]->GetRate()) {
wxMessageBox(_("Sorry, cannot apply effect on stereo tracks where the tracks don't match."),
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(_("Sorry, cannot apply effect on stereo tracks where the tracks don't match."),
wxOK | wxCENTRE);
success = false;
goto finish;
}
@ -690,7 +689,7 @@ bool NyquistEffect::Process()
_("Selection too long for Nyquist code.\nMaximum allowed selection is %ld samples\n(about %.1f hours at 44100 Hz sample rate)."),
(long)NYQ_MAX_LEN, hours
);
wxMessageBox(message, _("Nyquist Error"), wxOK | wxCENTRE);
Effect::MessageBox(message, wxOK | wxCENTRE, _("Nyquist Error"));
if (!mProjectChanged)
em.SetSkipStateFlag(true);
return false;
@ -1213,7 +1212,7 @@ bool NyquistEffect::ProcessOne()
if (rval == nyx_string) {
wxString msg = NyquistToWxString(nyx_get_string());
if (!msg.IsEmpty()) // Not currently a documented feature, but could be useful as a No-Op.
wxMessageBox(msg, mName, wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(msg);
// True if not process type.
// If not returning audio from process effect,
@ -1226,8 +1225,7 @@ bool NyquistEffect::ProcessOne()
wxString str;
str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %f")),
nyx_get_double());
wxMessageBox(str, wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(str);
return (GetType() != EffectTypeProcess || mIsPrompt);
}
@ -1235,8 +1233,7 @@ bool NyquistEffect::ProcessOne()
wxString str;
str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %d")),
nyx_get_int());
wxMessageBox(str, wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(str);
return (GetType() != EffectTypeProcess || mIsPrompt);
}
@ -1275,23 +1272,17 @@ bool NyquistEffect::ProcessOne()
int outChannels = nyx_get_audio_num_channels();
if (outChannels > (int)mCurNumChannels) {
wxMessageBox(_("Nyquist returned too many audio channels.\n"),
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(_("Nyquist returned too many audio channels.\n"));
return false;
}
if (outChannels == -1) {
wxMessageBox(_("Nyquist returned one audio channel as an array.\n"),
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(_("Nyquist returned one audio channel as an array.\n"));
return false;
}
if (outChannels == 0) {
wxMessageBox(_("Nyquist returned an empty array.\n"),
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(_("Nyquist returned an empty array.\n"));
return false;
}
@ -1340,9 +1331,7 @@ bool NyquistEffect::ProcessOne()
mOutputTime = outputTrack[i]->GetEndTime();
if (mOutputTime <= 0) {
wxMessageBox(_("Nyquist returned nil audio.\n"),
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
Effect::MessageBox(_("Nyquist returned nil audio.\n"));
return true;
}
}
@ -1740,7 +1729,7 @@ void NyquistEffect::Parse(const wxString &line)
tokens[3].c_str(), mFileName.GetFullPath().c_str());
// Too disturbing to show alert before Audacity frame is up.
// wxMessageBox(str, wxT("Nyquist Warning"), wxOK | wxICON_EXCLAMATION);
// Effect::MessageBox(str, wxT("Nyquist Warning"), wxOK | wxICON_EXCLAMATION);
// Note that the AudacityApp's mLogger has not yet been created,
// so this brings up an alert box, but after the Audacity frame is up.
@ -1854,11 +1843,11 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
{
/* i1n-hint: SAL and LISP are names for variant syntaxes for the
Nyquist programming language. Leave them, and 'return', untranslated. */
wxMessageBox(_("Your code looks like SAL syntax, but there is no \'return\' statement.\n\
Effect::MessageBox(_("Your code looks like SAL syntax, but there is no \'return\' statement.\n\
For SAL, use a return statement such as:\n\treturn *track* * 0.1\n\
or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n ."),
_("Error in Nyquist code"),
wxOK | wxCENTRE);
Effect::DefaultMessageBoxStyle,
_("Error in Nyquist code"));
/* i18n-hint: refers to programming "languages" */
mInitError = _("Could not determine language");
return false;
@ -2311,15 +2300,14 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
{
if (mCommandText->IsModified())
{
if (wxMessageBox(_("Current program has been modified.\nDiscard changes?"),
GetName(),
if (Effect::MessageBox(_("Current program has been modified.\nDiscard changes?"),
wxYES_NO) == wxNO)
{
return;
}
}
FileDialog dlog(mUIParent,
FileDialogWrapper dlog(mUIParent,
_("Load Nyquist script"),
mFileName.GetPath(),
wxEmptyString,
@ -2335,13 +2323,13 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
if (!mCommandText->LoadFile(mFileName.GetFullPath()))
{
wxMessageBox(_("File could not be loaded"), GetName());
Effect::MessageBox(_("File could not be loaded"));
}
}
void NyquistEffect::OnSave(wxCommandEvent & WXUNUSED(evt))
{
FileDialog dlog(mUIParent,
FileDialogWrapper dlog(mUIParent,
_("Save Nyquist script"),
mFileName.GetPath(),
mFileName.GetFullName(),
@ -2357,7 +2345,7 @@ void NyquistEffect::OnSave(wxCommandEvent & WXUNUSED(evt))
if (!mCommandText->SaveFile(mFileName.GetFullPath()))
{
wxMessageBox(_("File could not be saved"), GetName());
Effect::MessageBox(_("File could not be saved"));
}
}

View File

@ -25,7 +25,6 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/combobox.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/slider.h>
#include <wx/statbox.h>
@ -39,6 +38,7 @@
#include "../../ShuttleGui.h"
#include "../../widgets/valnum.h"
#include "../../widgets/ErrorDialog.h"
#include "../../LabelTrack.h"
#include "../../WaveTrack.h"
@ -324,7 +324,7 @@ bool VampEffect::Init()
if (left->GetRate() != right->GetRate())
{
wxMessageBox(_("Sorry, Vamp Plug-ins cannot be run on stereo tracks where the individual channels of the track do not match."));
Effect::MessageBox(_("Sorry, Vamp Plug-ins cannot be run on stereo tracks where the individual channels of the track do not match."));
return false;
}
}
@ -343,7 +343,7 @@ bool VampEffect::Init()
mPlugin.reset(loader->loadPlugin(mKey, mRate, Vamp::HostExt::PluginLoader::ADAPT_ALL));
if (!mPlugin)
{
wxMessageBox(_("Sorry, failed to load Vamp Plug-in."));
Effect::MessageBox(_("Sorry, failed to load Vamp Plug-in."));
return false;
}
@ -437,7 +437,7 @@ bool VampEffect::Process()
{
if (!mPlugin->initialise(channels, step, block))
{
wxMessageBox(_("Sorry, Vamp Plug-in failed to initialize."));
Effect::MessageBox(_("Sorry, Vamp Plug-in failed to initialize."));
return false;
}
}

View File

@ -34,7 +34,6 @@
#include <wx/dynarray.h>
#include <wx/file.h>
#include <wx/filename.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/sizer.h>
#include <wx/slider.h>
@ -66,6 +65,7 @@
#include "../Project.h"
#include "../ShuttleGui.h"
#include "../WaveTrack.h"
#include "../widgets/ErrorDialog.h"
#include "../widgets/Warning.h"
#include "../AColor.h"
#include "../Dependencies.h"
@ -474,7 +474,7 @@ bool Exporter::ExamineTracks()
message = _("All selected audio is muted.");
else
message = _("All audio is muted.");
wxMessageBox(message,
AudacityMessageBox(message,
_("Unable to export"),
wxOK | wxICON_INFORMATION);
return false;
@ -537,7 +537,7 @@ bool Exporter::GetFilename()
auto useFileName = mFilename;
if (!useFileName.HasExt())
useFileName.SetExt(defext);
FileDialog fd(mProject,
FileDialogWrapper fd(mProject,
mFileDialogTitle,
mFilename.GetPath(),
useFileName.GetFullName(),
@ -599,7 +599,7 @@ bool Exporter::GetFilename()
mFilename.GetFullName() +
wxT("\"?\n");
int action = wxMessageBox(prompt,
int action = AudacityMessageBox(prompt,
_("Warning"),
wxYES_NO | wxICON_EXCLAMATION);
if (action != wxYES) {
@ -620,7 +620,7 @@ bool Exporter::GetFilename()
mFilename.GetFullName().c_str(),
defext.c_str());
int action = wxMessageBox(prompt,
int action = AudacityMessageBox(prompt,
_("Warning"),
wxYES_NO | wxICON_EXCLAMATION);
if (action != wxYES) {
@ -629,7 +629,7 @@ bool Exporter::GetFilename()
}
if (mFilename.GetFullPath().Length() >= 256) {
wxMessageBox(_("Sorry, pathnames longer than 256 characters not supported."));
AudacityMessageBox(_("Sorry, pathnames longer than 256 characters not supported."));
continue;
}
@ -646,7 +646,7 @@ bool Exporter::GetFilename()
if (mFilename.GetFullPath() == aliasedFile.mFileName.GetFullPath() &&
!mFilename.FileExists()) {
// Warn and return to the dialog
wxMessageBox(_("You are attempting to overwrite an aliased file that is missing.\n\
AudacityMessageBox(_("You are attempting to overwrite an aliased file that is missing.\n\
The file cannot be written because the path is needed to restore the original audio to the project.\n\
Choose File > Check Dependencies to view the locations of all missing files.\n\
If you still wish to export, please choose a different filename or folder."));
@ -663,7 +663,7 @@ bool Exporter::GetFilename()
prompt.Printf(_("A file named \"%s\" already exists. Replace?"),
mFilename.GetFullPath().c_str());
int action = wxMessageBox(prompt,
int action = AudacityMessageBox(prompt,
_("Warning"),
wxYES_NO | wxICON_EXCLAMATION);
if (action != wxYES) {

View File

@ -21,7 +21,7 @@
#include "../SampleFormat.h"
#include "../widgets/wxPanelWrapper.h"
class FileDialog;
class FileDialogWrapper;
class wxFileCtrlEvent;
class wxMemoryDC;
class wxStaticText;
@ -187,7 +187,7 @@ private:
private:
wxString mFormatName;
FileDialog *mDialog;
FileDialogWrapper *mDialog;
wxString mFileDialogTitle;
AudacityProject *mProject;
std::unique_ptr<MixerSpec> mMixerSpec;

View File

@ -20,7 +20,6 @@
#include <wx/combobox.h>
#include <wx/filedlg.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/process.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
@ -33,6 +32,7 @@
#include "../Internat.h"
#include "../float_cast.h"
#include "../widgets/FileHistory.h"
#include "../widgets/ErrorDialog.h"
#include "../Track.h"
@ -370,7 +370,7 @@ ProgressResult ExportCL::Export(AudacityProject *project,
}
if (!rc) {
wxMessageBox(wxString::Format(_("Cannot export audio to %s"),
AudacityMessageBox(wxString::Format(_("Cannot export audio to %s"),
fName.c_str()));
process.Detach();
process.CloseOutput();

View File

@ -25,7 +25,6 @@ function.
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/timer.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/string.h>
#include <wx/textctrl.h>
@ -41,6 +40,7 @@ function.
#include "../Project.h"
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/ErrorDialog.h"
#include "Export.h"
#include "ExportFFmpeg.h"
@ -63,7 +63,7 @@ static bool CheckFFmpegPresence(bool quiet = false)
{
if (!quiet)
{
wxMessageBox(_("Properly configured FFmpeg is required to proceed.\nYou can configure it at Preferences > Libraries."));
AudacityMessageBox(_("Properly configured FFmpeg is required to proceed.\nYou can configure it at Preferences > Libraries."));
}
result = false;
}
@ -279,7 +279,7 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, const T
// and the default video/audio codecs that the format uses.
if ((mEncFormatDesc = av_guess_format(shortname, OSINPUT(mName), NULL)) == NULL)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't determine format description for file \"%s\"."), mName.c_str()),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't determine format description for file \"%s\"."), mName.c_str()),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -288,7 +288,7 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, const T
mEncFormatCtx.reset(avformat_alloc_context());
if (!mEncFormatCtx)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't allocate output format context.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't allocate output format context.")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -301,7 +301,7 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, const T
// At the moment Audacity can export only one audio stream
if ((mEncAudioStream = avformat_new_stream(mEncFormatCtx.get(), NULL)) == NULL)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't add audio stream to output file \"%s\"."), mName.c_str()),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't add audio stream to output file \"%s\"."), mName.c_str()),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -326,7 +326,7 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, const T
{
if ((err = ufile_fopen(&mEncFormatCtx->pb, mName, AVIO_FLAG_WRITE)) < 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't open output file \"%s\" to write. Error code is %d."), mName.c_str(), err),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't open output file \"%s\" to write. Error code is %d."), mName.c_str(), err),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -352,7 +352,7 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, const T
// Write headers to the output file.
if ((err = avformat_write_header(mEncFormatCtx.get(), NULL)) < 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't write headers to output file \"%s\". Error code is %d."), mName.c_str(),err),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't write headers to output file \"%s\". Error code is %d."), mName.c_str(),err),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -492,7 +492,7 @@ bool ExportFFmpeg::InitCodecs(AudacityProject *project)
// Is the required audio codec compiled into libavcodec?
if (codec == NULL)
{
wxMessageBox(wxString::Format(_("FFmpeg cannot find audio codec 0x%x.\nSupport for this codec is probably not compiled in."), (unsigned int) mEncAudioCodecCtx->codec_id),
AudacityMessageBox(wxString::Format(_("FFmpeg cannot find audio codec 0x%x.\nSupport for this codec is probably not compiled in."), (unsigned int) mEncAudioCodecCtx->codec_id),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -525,7 +525,7 @@ bool ExportFFmpeg::InitCodecs(AudacityProject *project)
// Open the codec.
if (avcodec_open2(mEncAudioCodecCtx.get(), codec, &options) < 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't open audio codec 0x%x."),mEncAudioCodecCtx->codec_id),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't open audio codec 0x%x."),mEncAudioCodecCtx->codec_id),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -546,7 +546,7 @@ bool ExportFFmpeg::InitCodecs(AudacityProject *project)
mEncAudioFifoOutBuf.reset(static_cast<int16_t*>(av_malloc(mEncAudioFifoOutBufSiz)));
if (!mEncAudioFifoOutBuf)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't allocate buffer to read into from audio FIFO.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't allocate buffer to read into from audio FIFO.")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -576,13 +576,13 @@ static int encode_audio(AVCodecContext *avctx, AVPacket *pkt, int16_t *audio_sam
buffer_size = av_samples_get_buffer_size(NULL, avctx->channels, frame->nb_samples,
avctx->sample_fmt, 0);
if (buffer_size < 0) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not get sample buffer size")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not get sample buffer size")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return buffer_size;
}
samples.reset(static_cast<uint8_t*>(av_malloc(buffer_size)));
if (!samples) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not allocate bytes for samples buffer")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not allocate bytes for samples buffer")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return AVERROR(ENOMEM);
}
@ -590,7 +590,7 @@ static int encode_audio(AVCodecContext *avctx, AVPacket *pkt, int16_t *audio_sam
ret = avcodec_fill_audio_frame(frame.get(), avctx->channels, avctx->sample_fmt,
samples.get(), buffer_size, 0);
if (ret < 0) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not setup audio frame")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Could not setup audio frame")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return ret;
}
@ -638,7 +638,7 @@ static int encode_audio(AVCodecContext *avctx, AVPacket *pkt, int16_t *audio_sam
ret = avcodec_encode_audio2(avctx, pkt, frame.get(), &got_output);
if (ret < 0) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - encoding frame failed")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - encoding frame failed")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return ret;
}
@ -664,7 +664,7 @@ bool ExportFFmpeg::Finalize()
int nAudioFrameSizeOut = default_frame_size * mEncAudioCodecCtx->channels * sizeof(int16_t);
if (nAudioFrameSizeOut > mEncAudioFifoOutBufSiz || nFifoBytes > mEncAudioFifoOutBufSiz) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Too much remaining data.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Too much remaining data.")),
_("FFmpeg Error"), wxOK | wxCENTER | wxICON_EXCLAMATION);
return false;
}
@ -727,7 +727,7 @@ bool ExportFFmpeg::Finalize()
if (av_interleaved_write_frame(mEncFormatCtx.get(), &pkt) != 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Couldn't write last audio frame to output file.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Couldn't write last audio frame to output file.")),
_("FFmpeg Error"), wxOK | wxCENTER | wxICON_EXCLAMATION);
break;
}
@ -777,7 +777,7 @@ bool ExportFFmpeg::EncodeAudioFrame(int16_t *pFrame, size_t frameSize)
return false;
if (nAudioFrameSizeOut > mEncAudioFifoOutBufSiz) {
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - nAudioFrameSizeOut too large.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - nAudioFrameSizeOut too large.")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -795,7 +795,7 @@ bool ExportFFmpeg::EncodeAudioFrame(int16_t *pFrame, size_t frameSize)
default_frame_size);
if (ret < 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't encode audio frame.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Can't encode audio frame.")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -814,7 +814,7 @@ bool ExportFFmpeg::EncodeAudioFrame(int16_t *pFrame, size_t frameSize)
// Write the encoded audio frame to the output file.
if ((ret = av_interleaved_write_frame(mEncFormatCtx.get(), &pkt)) < 0)
{
wxMessageBox(wxString::Format(_("FFmpeg : ERROR - Failed to write audio frame to file.")),
AudacityMessageBox(wxString::Format(_("FFmpeg : ERROR - Failed to write audio frame to file.")),
_("FFmpeg Error"), wxOK|wxCENTER|wxICON_EXCLAMATION);
return false;
}
@ -834,7 +834,7 @@ ProgressResult ExportFFmpeg::Export(AudacityProject *project,
mSubFormat = AdjustFormatIndex(subformat);
if (channels > ExportFFmpegOptions::fmts[mSubFormat].maxchannels)
{
wxMessageBox(
AudacityMessageBox(
wxString::Format(
_("Attempted to export %d channels, but maximum number of channels for selected output format is %d"),
channels,

View File

@ -44,7 +44,6 @@
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/timer.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/string.h>
#include <wx/textctrl.h>
@ -62,6 +61,7 @@
#include "../Project.h"
#include "../Tags.h"
#include "../TranslatableStringArray.h"
#include "../widgets/ErrorDialog.h"
#include "Export.h"
@ -568,7 +568,7 @@ void FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name)
if (preset)
{
wxString query = wxString::Format(_("Overwrite preset '%s'?"),name.c_str());
int action = wxMessageBox(query,_("Confirm Overwrite"),wxYES_NO | wxCENTRE);
int action = AudacityMessageBox(query,_("Confirm Overwrite"),wxYES_NO | wxCENTRE);
if (action == wxNO) return;
}
@ -579,7 +579,7 @@ void FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name)
lb = dynamic_cast<wxListBox*>(wnd);
if (lb->GetSelection() < 0)
{
wxMessageBox(_("Please select format before saving a profile"));
AudacityMessageBox(_("Please select format before saving a profile"));
return;
}
format = lb->GetStringSelection();
@ -588,7 +588,7 @@ void FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name)
lb = dynamic_cast<wxListBox*>(wnd);
if (lb->GetSelection() < 0)
{
wxMessageBox(_("Please select codec before saving a profile"));
AudacityMessageBox(_("Please select codec before saving a profile"));
return;
}
codec = lb->GetStringSelection();
@ -661,7 +661,7 @@ void FFmpegPresets::LoadPreset(ExportFFmpegOptions *parent, wxString &name)
FFmpegPreset *preset = FindPreset(name);
if (!preset)
{
wxMessageBox(wxString::Format(_("Preset '%s' does not exist."),name.c_str()));
AudacityMessageBox(wxString::Format(_("Preset '%s' does not exist."),name.c_str()));
return;
}
@ -763,7 +763,7 @@ bool FFmpegPresets::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
if (mPreset)
{
wxString query = wxString::Format(_("Replace preset '%s'?"), value.c_str());
int action = wxMessageBox(query, _("Confirm Overwrite"), wxYES_NO | wxCANCEL | wxCENTRE);
int action = AudacityMessageBox(query, _("Confirm Overwrite"), wxYES_NO | wxCANCEL | wxCENTRE);
if (action == wxCANCEL)
{
mAbortImport = true;
@ -1791,12 +1791,12 @@ void ExportFFmpegOptions::OnDeletePreset(wxCommandEvent& WXUNUSED(event))
wxString presetname = preset->GetValue();
if (presetname.IsEmpty())
{
wxMessageBox(_("You can't delete a preset without name"));
AudacityMessageBox(_("You can't delete a preset without name"));
return;
}
wxString query = wxString::Format(_("Delete preset '%s'?"),presetname.c_str());
int action = wxMessageBox(query,_("Confirm Deletion"),wxYES_NO | wxCENTRE);
int action = AudacityMessageBox(query,_("Confirm Deletion"),wxYES_NO | wxCENTRE);
if (action == wxNO) return;
mPresets->DeletePreset(presetname);
@ -1814,7 +1814,7 @@ void ExportFFmpegOptions::OnSavePreset(wxCommandEvent& WXUNUSED(event))
wxString name = preset->GetValue();
if (name.IsEmpty())
{
wxMessageBox(_("You can't save a preset without name"));
AudacityMessageBox(_("You can't save a preset without name"));
return;
}
mPresets->SavePreset(this,name);
@ -1856,7 +1856,7 @@ void ExportFFmpegOptions::OnLoadPreset(wxCommandEvent& WXUNUSED(event))
void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
{
wxString path;
FileDialog dlg(this,
FileDialogWrapper dlg(this,
_("Select xml file with presets to import"),
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
wxEmptyString,
@ -1875,7 +1875,7 @@ void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
{
wxString path;
FileDialog dlg(this,
FileDialogWrapper dlg(this,
_("Select xml file to export presets into"),
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
wxEmptyString,

View File

@ -28,7 +28,6 @@ and libvorbis examples, Monty <monty@xiph.org>
#include <wx/progdlg.h>
#include <wx/ffile.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include "FLAC++/encoder.h"
@ -42,6 +41,7 @@ and libvorbis examples, Monty <monty@xiph.org>
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/ErrorDialog.h"
//----------------------------------------------------------------------------
// ExportFLACOptions Class
@ -301,7 +301,7 @@ ProgressResult ExportFLAC::Export(AudacityProject *project,
#else
wxFFile f; // will be closed when it goes out of scope
if (!f.Open(fName, wxT("w+b"))) {
wxMessageBox(wxString::Format(_("FLAC export couldn't open %s"), fName.c_str()));
AudacityMessageBox(wxString::Format(_("FLAC export couldn't open %s"), fName.c_str()));
return ProgressResult::Cancelled;
}
@ -310,7 +310,7 @@ ProgressResult ExportFLAC::Export(AudacityProject *project,
// libflac can't (under Windows).
int status = encoder.init(f.fp());
if (status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
wxMessageBox(wxString::Format(_("FLAC encoder failed to initialize\nStatus: %d"), status));
AudacityMessageBox(wxString::Format(_("FLAC encoder failed to initialize\nStatus: %d"), status));
return ProgressResult::Cancelled;
}
#endif

View File

@ -40,7 +40,6 @@
#include <wx/defs.h>
#include <wx/textctrl.h>
#include <wx/dynlib.h>
#include <wx/msgdlg.h>
#include <wx/utils.h>
#include <wx/timer.h>
#include <wx/window.h>
@ -56,6 +55,7 @@
#include "../ShuttleGui.h"
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/ErrorDialog.h"
#define LIBTWOLAME_STATIC
#include "twolame.h"
@ -226,7 +226,7 @@ ProgressResult ExportMP2::Export(AudacityProject *project,
if (twolame_init_params(encodeOptions) != 0)
{
wxMessageBox(_("Cannot export MP2 with this sample rate and bit rate"),
AudacityMessageBox(_("Cannot export MP2 with this sample rate and bit rate"),
_("Error"), wxICON_STOP);
return ProgressResult::Cancelled;
}
@ -237,7 +237,7 @@ ProgressResult ExportMP2::Export(AudacityProject *project,
FileIO outFile(fName, FileIO::Output);
if (!outFile.IsOpened()) {
wxMessageBox(_("Unable to open target file for writing"));
AudacityMessageBox(_("Unable to open target file for writing"));
return ProgressResult::Cancelled;
}

View File

@ -73,7 +73,6 @@
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/mimetype.h>
#include <wx/msgdlg.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
@ -92,6 +91,7 @@
#include "../Track.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/LinkingHtmlWindow.h"
#include "../widgets/ErrorDialog.h"
#include "Export.h"
@ -1027,7 +1027,7 @@ bool MP3Exporter::LoadLibrary(wxWindow *parent, AskUser askuser)
if (!ValidLibraryLoaded()) {
#if defined(__WXMSW__)
if (askuser && !mBladeVersion.IsEmpty()) {
wxMessageBox(mBladeVersion);
AudacityMessageBox(mBladeVersion);
}
#endif
wxLogMessage(wxT("Failed to locate LAME library"));
@ -1642,7 +1642,7 @@ bool ExportMP3::CheckFileName(wxFileName & WXUNUSED(filename), int WXUNUSED(form
MP3Exporter exporter;
if (!exporter.LoadLibrary(wxTheApp->GetTopWindow(), MP3Exporter::Maybe)) {
wxMessageBox(_("Could not open MP3 encoding library!"));
AudacityMessageBox(_("Could not open MP3 encoding library!"));
gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT("")));
gPrefs->Flush();
@ -1681,7 +1681,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
#ifdef DISABLE_DYNAMIC_LOADING_LAME
if (!exporter.InitLibrary(wxT(""))) {
wxMessageBox(_("Could not initialize MP3 encoding library!"));
AudacityMessageBox(_("Could not initialize MP3 encoding library!"));
gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT("")));
gPrefs->Flush();
@ -1689,7 +1689,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
}
#else
if (!exporter.LoadLibrary(parent, MP3Exporter::Maybe)) {
wxMessageBox(_("Could not open MP3 encoding library!"));
AudacityMessageBox(_("Could not open MP3 encoding library!"));
gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT("")));
gPrefs->Flush();
@ -1697,7 +1697,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
}
if (!exporter.ValidLibraryLoaded()) {
wxMessageBox(_("Not a valid or supported MP3 encoding library!"));
AudacityMessageBox(_("Not a valid or supported MP3 encoding library!"));
gPrefs->Write(wxT("/MP3/MP3LibPath"), wxString(wxT("")));
gPrefs->Flush();
@ -1781,7 +1781,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
auto inSamples = exporter.InitializeStream(channels, rate);
if (((int)inSamples) < 0) {
wxMessageBox(_("Unable to initialize MP3 stream"));
AudacityMessageBox(_("Unable to initialize MP3 stream"));
return ProgressResult::Cancelled;
}
@ -1792,7 +1792,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
// Open file for writing
wxFFile outFile(fName, wxT("w+b"));
if (!outFile.IsOpened()) {
wxMessageBox(_("Unable to open target file for writing"));
AudacityMessageBox(_("Unable to open target file for writing"));
return ProgressResult::Cancelled;
}
@ -1875,7 +1875,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
if (bytes < 0) {
wxString msg;
msg.Printf(_("Error %ld returned from MP3 encoder"), bytes);
wxMessageBox(msg);
AudacityMessageBox(msg);
updateResult = ProgressResult::Cancelled;
break;
}

View File

@ -30,7 +30,6 @@
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
@ -50,6 +49,7 @@
#include "../Tags.h"
#include "../WaveTrack.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/ErrorDialog.h"
/* define our dynamic array of export settings */
@ -180,7 +180,7 @@ int ExportMultiple::ShowModal()
// Cannot export if all audio tracks are muted.
if (mNumWaveTracks == 0)
{
::wxMessageBox(_("All audio is muted."),
::AudacityMessageBox(_("All audio is muted."),
_("Cannot Export Multiple"),
wxOK | wxCENTRE, this);
return wxID_CANCEL;
@ -188,7 +188,7 @@ int ExportMultiple::ShowModal()
if ((mNumWaveTracks == 1) && (mNumLabels < 1))
{
::wxMessageBox(_(
::AudacityMessageBox(_(
"You have only one unmuted Audio Track and no applicable \
\nlabels, so you cannot export to separate audio files."),
_("Cannot Export Multiple"),
@ -472,7 +472,7 @@ void ExportMultiple::OnCreate(wxCommandEvent& WXUNUSED(event))
return;
}
::wxMessageBox(wxString::Format(_("\"%s\" successfully created."),
::AudacityMessageBox(wxString::Format(_("\"%s\" successfully created."),
fn.GetPath().c_str()),
_("Export Multiple"),
wxOK | wxCENTRE, this);
@ -480,7 +480,7 @@ void ExportMultiple::OnCreate(wxCommandEvent& WXUNUSED(event))
void ExportMultiple::OnChoose(wxCommandEvent& WXUNUSED(event))
{
wxDirDialog dlog(this,
wxDirDialogWrapper dlog(this,
_("Choose a location to save the exported files"),
mDir->GetValue());
dlog.ShowModal();
@ -626,7 +626,7 @@ bool ExportMultiple::DirOk()
prompt.Printf(_("\"%s\" doesn't exist.\n\nWould you like to create it?"),
fn.GetFullPath().c_str());
int action = wxMessageBox(prompt,
int action = AudacityMessageBox(prompt,
wxT("Warning"),
wxYES_NO | wxICON_EXCLAMATION);
if (action != wxYES) {
@ -1006,7 +1006,7 @@ wxString ExportMultiple::MakeFileName(const wxString &input)
excluded.c_str());
}
wxTextEntryDialog dlg( this, msg, _("Save As..."), newname );
AudacityTextEntryDialog dlg( this, msg, _("Save As..."), newname );
// And tell the validator about excluded chars

View File

@ -23,7 +23,6 @@
#include "Export.h"
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <wx/slider.h>
#include <vorbis/vorbisenc.h>
@ -37,6 +36,7 @@
#include "../Internat.h"
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/ErrorDialog.h"
//----------------------------------------------------------------------------
// ExportOGGOptions
@ -179,7 +179,7 @@ ProgressResult ExportOGG::Export(AudacityProject *project,
FileIO outFile(fName, FileIO::Output);
if (!outFile.IsOpened()) {
wxMessageBox(_("Unable to open target file for writing"));
AudacityMessageBox(_("Unable to open target file for writing"));
return ProgressResult::Cancelled;
}

View File

@ -18,7 +18,6 @@
#include <wx/filename.h>
#include <wx/intl.h>
#include <wx/timer.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/string.h>
#include <wx/textctrl.h>
@ -36,6 +35,7 @@
#include "../Tags.h"
#include "../Track.h"
#include "../ondemand/ODManager.h"
#include "../widgets/ErrorDialog.h"
#include "Export.h"
@ -440,7 +440,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
if (!sf_format_check(&info))
info.format = (info.format & SF_FORMAT_TYPEMASK);
if (!sf_format_check(&info)) {
wxMessageBox(_("Cannot export audio in this format."));
AudacityMessageBox(_("Cannot export audio in this format."));
return ProgressResult::Cancelled;
}
@ -454,7 +454,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
}
if (!sf) {
wxMessageBox(wxString::Format(_("Cannot export audio to %s"),
AudacityMessageBox(wxString::Format(_("Cannot export audio to %s"),
fName.c_str()));
return ProgressResult::Cancelled;
}
@ -513,7 +513,7 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
if (samplesWritten != numSamples) {
char buffer2[1000];
sf_error_str(sf.get(), buffer2, 1000);
wxMessageBox(wxString::Format(
AudacityMessageBox(wxString::Format(
/* i18n-hint: %s will be the error message from libsndfile, which
* is usually something unhelpful (and untranslated) like "system
* error" */

View File

@ -42,7 +42,6 @@ and ImportLOF.cpp.
#include "ImportPlugin.h"
#include <wx/textctrl.h>
#include <wx/msgdlg.h>
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/log.h>

View File

@ -306,7 +306,7 @@ std::unique_ptr<ImportFileHandle> FFmpegImportPlugin::Open(const wxString &filen
//officially supported by this plugin.
//If we don't have FFmpeg configured - tell the user about it.
//Since this will be happening often, use disableable "FFmpeg not found" dialog
//insdead of usual wxMessageBox()
//insdead of usual AudacityMessageBox()
bool newsession = false;
gPrefs->Read(wxT("/NewImportingSession"), &newsession);
if (!FFmpegLibsInst()->ValidLibsLoaded())

View File

@ -955,7 +955,7 @@ GStreamerImportFileHandle::Init()
// Add the decoder to the pipeline
if (!gst_bin_add(GST_BIN(mPipeline.get()), mDec))
{
wxMessageBox(_("Unable to add decoder to pipeline"),
AudacityMessageBox(_("Unable to add decoder to pipeline"),
_("GStreamer Importer"));
// Cleanup expected to occur in destructor
@ -966,7 +966,7 @@ GStreamerImportFileHandle::Init()
GstStateChangeReturn state = gst_element_set_state(mPipeline.get(), GST_STATE_PAUSED);
if (state == GST_STATE_CHANGE_FAILURE)
{
wxMessageBox(_("Unable to set stream state to paused."),
AudacityMessageBox(_("Unable to set stream state to paused."),
_("GStreamer Importer"));
return false;
}
@ -1095,7 +1095,7 @@ GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
// Can't do much if we don't have any streams to process
if (!haveStreams)
{
wxMessageBox(_("File doesn't contain any audio streams."),
AudacityMessageBox(_("File doesn't contain any audio streams."),
_("GStreamer Importer"));
return ProgressResult::Failed;
}
@ -1104,7 +1104,7 @@ GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
GstStateChangeReturn state = gst_element_set_state(mPipeline.get(), GST_STATE_PLAYING);
if (state == GST_STATE_CHANGE_FAILURE)
{
wxMessageBox(_("Unable to import file, state change failed."),
AudacityMessageBox(_("Unable to import file, state change failed."),
_("GStreamer Importer"));
return ProgressResult::Failed;
}
@ -1235,7 +1235,7 @@ GStreamerImportFileHandle::ProcessBusMessage(bool & success)
debug ? wxT("\n") : wxT(""),
debug ? wxString::FromUTF8(debug.get()).c_str() : wxT(""));
#if defined(_DEBUG)
wxMessageBox(wxString::Format(_("GStreamer Error: %s"), m));
AudacityMessageBox(wxString::Format(_("GStreamer Error: %s"), m));
#else
wxLogMessage(wxT("GStreamer Error: %s"), m.c_str());
#endif

View File

@ -76,7 +76,6 @@
#include <wx/utils.h>
#include <wx/intl.h>
#include <wx/textfile.h>
#include <wx/msgdlg.h>
#include <wx/tokenzr.h>
#ifdef USE_MIDI
@ -91,6 +90,7 @@
#include "../FileFormats.h"
#include "../Prefs.h"
#include "../Internat.h"
#include "../widgets/ErrorDialog.h"
#define BINARY_FILE_CHECK_BUFFER_SIZE 1024
@ -332,7 +332,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
wxMessageBox(_("Invalid window offset in LOF file."),
AudacityMessageBox(_("Invalid window offset in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
_("LOF Error"), wxOK | wxCENTRE);
}
@ -353,7 +353,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
wxMessageBox(_("Invalid duration in LOF file."),
AudacityMessageBox(_("Invalid duration in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
_("LOF Error"), wxOK | wxCENTRE);
}
@ -449,7 +449,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
if (targetfile.AfterLast(wxT('.')).IsSameAs(wxT("mid"), false) ||
targetfile.AfterLast(wxT('.')).IsSameAs(wxT("midi"), false))
{
wxMessageBox(_("MIDI tracks cannot be offset individually, only audio files can be."),
AudacityMessageBox(_("MIDI tracks cannot be offset individually, only audio files can be."),
_("LOF Error"), wxOK | wxCENTRE);
}
else
@ -473,7 +473,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
wxMessageBox(_("Invalid track offset in LOF file."),
AudacityMessageBox(_("Invalid track offset in LOF file."),
_("LOF Error"), wxOK | wxCENTRE);
}
} // End if statement for "offset" parameters

View File

@ -12,7 +12,6 @@
#include "ImportMIDI.h"
#include <wx/defs.h>
#include <wx/msgdlg.h>
#include <wx/ffile.h>
#include <wx/intl.h>
@ -24,11 +23,14 @@
#include "../Internat.h"
#include "../NoteTrack.h"
#include "../widgets/ErrorDialog.h"
bool ImportMIDI(const wxString &fName, NoteTrack * dest)
{
if (fName.Length() <= 4){
wxMessageBox( _("Could not open file ") + fName + _(": Filename too short."));
AudacityMessageBox(
_("Could not open file ") + fName + _(": Filename too short.")
);
return false;
}
@ -36,13 +38,17 @@ bool ImportMIDI(const wxString &fName, NoteTrack * dest)
if (fName.Right(4).CmpNoCase(wxT(".mid")) == 0 || fName.Right(5).CmpNoCase(wxT(".midi")) == 0)
is_midi = true;
else if(fName.Right(4).CmpNoCase(wxT(".gro")) != 0) {
wxMessageBox( _("Could not open file ") + fName + _(": Incorrect filetype."));
AudacityMessageBox(
_("Could not open file ") + fName + _(": Incorrect filetype.")
);
return false;
}
wxFFile mf(fName, wxT("rb"));
if (!mf.IsOpened()) {
wxMessageBox( _("Could not open file ") + fName + wxT("."));
AudacityMessageBox(
_("Could not open file ") + fName + wxT(".")
);
return false;
}
@ -51,7 +57,9 @@ bool ImportMIDI(const wxString &fName, NoteTrack * dest)
//Should we also check if(seq->tracks() == 0) ?
if(new_seq->get_read_error() == alg_error_open){
wxMessageBox( _("Could not open file ") + fName + wxT("."));
AudacityMessageBox(
_("Could not open file ") + fName + wxT(".")
);
mf.Close();
return false;
}

View File

@ -71,7 +71,6 @@ void GetMP3ImportPlugin(ImportPluginList &importPluginList,
#include <wx/textctrl.h>
#include <wx/file.h>
#include <wx/thread.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <wx/string.h>
#include <wx/timer.h>

View File

@ -16,6 +16,7 @@
#include "../Audacity.h"
#include "ImportQT.h"
#include "ImportPlugin.h"
#include "../widgets/ErrorDialog.h"
#define DESC _("QuickTime files")
@ -43,8 +44,6 @@ void GetQTImportPlugin(ImportPluginList &importPluginList,
#else /* USE_QUICKTIME */
#include <wx/msgdlg.h>
// There's a name collision between our Track and QuickTime's...workaround it
#define Track XTrack
@ -259,7 +258,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
{
err = MovieAudioExtractionBegin(mMovie, 0, &maer);
if (err != noErr) {
wxMessageBox(_("Unable to start QuickTime extraction"));
AudacityMessageBox(_("Unable to start QuickTime extraction"));
break;
}
@ -269,7 +268,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
sizeof(quality),
&quality);
if (err != noErr) {
wxMessageBox(_("Unable to set QuickTime render quality"));
AudacityMessageBox(_("Unable to set QuickTime render quality"));
break;
}
@ -279,7 +278,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
sizeof(discrete),
&discrete);
if (err != noErr) {
wxMessageBox(_("Unable to set QuickTime discrete channels property"));
AudacityMessageBox(_("Unable to set QuickTime discrete channels property"));
break;
}
@ -290,7 +289,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
&maxSampleSize,
NULL);
if (err != noErr) {
wxMessageBox(_("Unable to get QuickTime sample size property"));
AudacityMessageBox(_("Unable to get QuickTime sample size property"));
break;
}
@ -301,7 +300,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
&desc,
NULL);
if (err != noErr) {
wxMessageBox(_("Unable to retrieve stream description"));
AudacityMessageBox(_("Unable to retrieve stream description"));
break;
}
@ -370,7 +369,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
abl.get(),
&flags);
if (err != noErr) {
wxMessageBox(_("Unable to get fill buffer"));
AudacityMessageBox(_("Unable to get fill buffer"));
break;
}

View File

@ -45,7 +45,6 @@ and sample size to help you importing data of an unknown format.
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/panel.h>
#include <wx/progdlg.h>
#include <wx/sizer.h>

View File

@ -29,13 +29,13 @@
#include <wx/event.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/msgdlg.h>
#include <wx/utils.h>
#include "../Prefs.h"
#include "../AudacityApp.h"
#include "../Internat.h"
#include "../ShuttleGui.h"
#include "../widgets/ErrorDialog.h"
#include "DirectoriesPrefs.h"
enum {
@ -135,7 +135,7 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e)
if( !AudacityApp::IsTempDirectoryNameOK( oldTempDir ) )
oldTempDir = wxGetApp().defaultTempDir;
wxDirDialog dlog(this,
wxDirDialogWrapper dlog(this,
_("Choose a location to place the temporary directory"),
oldTempDir );
int retval = dlog.ShowModal();
@ -205,7 +205,7 @@ bool DirectoriesPrefs::Validate()
wxString path{tempDir.GetPath()};
if( !AudacityApp::IsTempDirectoryNameOK( path ) ) {
wxMessageBox(
AudacityMessageBox(
wxString::Format(_("Directory %s is not suitable (at risk of being cleaned out)"),
path.c_str()),
_("Error"),
@ -213,7 +213,7 @@ bool DirectoriesPrefs::Validate()
return false;
}
if (!tempDir.DirExists()) {
int ans = wxMessageBox(
int ans = AudacityMessageBox(
wxString::Format(_("Directory %s does not exist. Create it?"),
path.c_str()),
_("New Temporary Directory"),
@ -234,7 +234,7 @@ bool DirectoriesPrefs::Validate()
tempDir.AppendDir(wxT("canicreate"));
path = tempDir.GetPath();
if (!tempDir.Mkdir(0755)) {
wxMessageBox(
AudacityMessageBox(
wxString::Format(_("Directory %s is not writable"),
path.c_str()),
_("Error"),
@ -248,7 +248,7 @@ bool DirectoriesPrefs::Validate()
wxFileName oldDir;
oldDir.SetPath(gPrefs->Read(wxT("/Directories/TempDir")));
if (tempDir != oldDir) {
wxMessageBox(
AudacityMessageBox(
_("Changes to temporary directory will not take effect until Audacity is restarted"),
_("Temp Directory Update"),
wxOK | wxCENTRE | wxICON_INFORMATION);

View File

@ -19,12 +19,12 @@
#include <wx/defs.h>
#include <wx/listctrl.h>
#include <wx/msgdlg.h>
#include <wx/dnd.h>
#include "../Audacity.h"
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "../widgets/ErrorDialog.h"
#define EXTIMPORT_MIME_SUPPORT 0
@ -506,7 +506,7 @@ void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event)
{
if (!askedAboutSpaces)
{
fixSpaces = wxMessageBox(_(
fixSpaces = AudacityMessageBox(_(
"There are space characters (spaces, newlines, tabs or linefeeds) in one of \
the items. They are likely to break the pattern matching. Unless you know \
what you are doing, it is recommended to trim spaces. Do you want \
@ -597,7 +597,7 @@ void ExtImportPrefs::OnDelRule(wxCommandEvent& WXUNUSED(event))
return;
auto &items = Importer::Get().GetImportItems();
int msgres = wxMessageBox (_("Do you really want to delete selected rule?"),
int msgres = AudacityMessageBox (_("Do you really want to delete selected rule?"),
_("Rule deletion confirmation"), wxYES_NO, RuleTable);
if (msgres == wxNO || msgres != wxYES)
return;

View File

@ -28,7 +28,6 @@ KeyConfigPrefs and MousePrefs use.
#include <wx/intl.h>
#include <wx/filedlg.h>
#include <wx/button.h>
#include <wx/msgdlg.h>
#include "../Prefs.h"
#include "../Project.h"
@ -42,6 +41,7 @@ KeyConfigPrefs and MousePrefs use.
#include "../FileNames.h"
#include "../widgets/KeyView.h"
#include "../widgets/ErrorDialog.h"
//
// KeyConfigPrefs
@ -348,7 +348,7 @@ void KeyConfigPrefs::OnImport(wxCommandEvent & WXUNUSED(event))
XMLFileReader reader;
if (!reader.Parse(mManager, file)) {
wxMessageBox(reader.GetErrorStr(),
AudacityMessageBox(reader.GetErrorStr(),
_("Error Importing Keyboard Shortcuts"),
wxOK | wxCENTRE, this);
}
@ -585,7 +585,7 @@ void KeyConfigPrefs::SetKeyForSelected(const wxString & key)
if (!mView->CanSetKey(mCommandSelected))
{
wxMessageBox(_("You may not assign a key to this entry"),
AudacityMessageBox(_("You may not assign a key to this entry"),
_("Error"), wxICON_ERROR | wxCENTRE, this);
return;
}
@ -599,7 +599,7 @@ void KeyConfigPrefs::SetKeyForSelected(const wxString & key)
void KeyConfigPrefs::OnSet(wxCommandEvent & WXUNUSED(event))
{
if (mCommandSelected == wxNOT_FOUND) {
wxMessageBox(_("You must select a binding before assigning a shortcut"),
AudacityMessageBox(_("You must select a binding before assigning a shortcut"),
_("Error"), wxICON_WARNING | wxCENTRE, this);
return;
}
@ -619,7 +619,7 @@ void KeyConfigPrefs::OnSet(wxCommandEvent & WXUNUSED(event))
mManager->GetPrefixedLabelFromName(oldname);
wxString newlabel = mManager->GetCategoryFromName(newname) + wxT(" - ") +
mManager->GetPrefixedLabelFromName(newname);
if (wxMessageBox(
if (AudacityMessageBox(
wxString::Format(
_("The keyboard shortcut '%s' is already assigned to:\n\n\t'%s'\n\nClick OK to assign the shortcut to\n\n\t'%s'\n\ninstead. Otherwise, click Cancel."),
key.c_str(),

View File

@ -26,6 +26,7 @@ MP3 and FFmpeg encoding libraries.
#include "../export/ExportMP3.h"
#include "../widgets/LinkingHtmlWindow.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/ErrorDialog.h"
#include "LibraryPrefs.h"
@ -207,7 +208,7 @@ void LibraryPrefs::OnFFmpegFindButton(wxCommandEvent & WXUNUSED(event))
// Libs are fine, don't show "locate" dialog unless user really wants it
if (!locate) {
int response = wxMessageBox(_("Audacity has automatically detected valid FFmpeg libraries.\nDo you still want to locate them manually?"),
int response = AudacityMessageBox(_("Audacity has automatically detected valid FFmpeg libraries.\nDo you still want to locate them manually?"),
wxT("Success"),
wxCENTRE | wxYES_NO | wxNO_DEFAULT |wxICON_QUESTION);
if (response == wxYES) {

View File

@ -39,6 +39,7 @@ other settings.
#include "../Prefs.h"
#include "../Project.h"
#include "../ShuttleGui.h"
#include "../widgets/ErrorDialog.h"
#include "MidiIOPrefs.h"
@ -281,7 +282,7 @@ bool MidiIOPrefs::Validate()
{
long latency;
if (!mLatency->GetValue().ToLong(&latency)) {
wxMessageBox(_("The MIDI Synthesizer Latency must be an integer"));
AudacityMessageBox(_("The MIDI Synthesizer Latency must be an integer"));
return false;
}
return true;

View File

@ -25,7 +25,6 @@
#include <wx/gdicmn.h>
#include <wx/intl.h>
#include <wx/listbox.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/listbook.h>

View File

@ -19,7 +19,6 @@ Paul Licameli
#include "../TranslatableStringArray.h"
#include <algorithm>
#include <wx/msgdlg.h>
#include "../FFT.h"
#include "../Prefs.h"
@ -28,6 +27,7 @@ Paul Licameli
#include <cmath>
#include "../Experimental.h"
#include "../widgets/ErrorDialog.h"
SpectrogramSettings::Globals::Globals()
{
@ -186,7 +186,7 @@ bool SpectrogramSettings::Validate(bool quiet)
{
if (!quiet &&
maxFreq < 100) {
wxMessageBox(_("Maximum frequency must be 100 Hz or above"));
AudacityMessageBox(_("Maximum frequency must be 100 Hz or above"));
return false;
}
else
@ -194,7 +194,7 @@ bool SpectrogramSettings::Validate(bool quiet)
if (!quiet &&
minFreq < 0) {
wxMessageBox(_("Minimum frequency must be at least 0 Hz"));
AudacityMessageBox(_("Minimum frequency must be at least 0 Hz"));
return false;
}
else
@ -202,7 +202,7 @@ bool SpectrogramSettings::Validate(bool quiet)
if (!quiet &&
maxFreq <= minFreq) {
wxMessageBox(_("Minimum frequency must be less than maximum frequency"));
AudacityMessageBox(_("Minimum frequency must be less than maximum frequency"));
return false;
}
else
@ -210,7 +210,7 @@ bool SpectrogramSettings::Validate(bool quiet)
if (!quiet &&
range <= 0) {
wxMessageBox(_("The range must be at least 1 dB"));
AudacityMessageBox(_("The range must be at least 1 dB"));
return false;
}
else
@ -218,12 +218,12 @@ bool SpectrogramSettings::Validate(bool quiet)
if (!quiet &&
frequencyGain < 0) {
wxMessageBox(_("The frequency gain cannot be negative"));
AudacityMessageBox(_("The frequency gain cannot be negative"));
return false;
}
else if (!quiet &&
frequencyGain > 60) {
wxMessageBox(_("The frequency gain must be no more than 60 dB/dec"));
AudacityMessageBox(_("The frequency gain must be no more than 60 dB/dec"));
return false;
}
else

View File

@ -19,7 +19,6 @@
#include <wx/defs.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/checkbox.h>
#include "../FFT.h"
@ -32,6 +31,7 @@
#include <algorithm>
#include "../Experimental.h"
#include "../widgets/ErrorDialog.h"
SpectrumPrefs::SpectrumPrefs(wxWindow * parent, WaveTrack *wt)
: PrefsPanel(parent, wt ? _("Spectrogram Settings") : _("Spectrograms"))
@ -314,48 +314,48 @@ bool SpectrumPrefs::Validate()
long maxFreq;
if (!mMaxFreq->GetValue().ToLong(&maxFreq)) {
wxMessageBox(_("The maximum frequency must be an integer"));
AudacityMessageBox(_("The maximum frequency must be an integer"));
return false;
}
long minFreq;
if (!mMinFreq->GetValue().ToLong(&minFreq)) {
wxMessageBox(_("The minimum frequency must be an integer"));
AudacityMessageBox(_("The minimum frequency must be an integer"));
return false;
}
long gain;
if (!mGain->GetValue().ToLong(&gain)) {
wxMessageBox(_("The gain must be an integer"));
AudacityMessageBox(_("The gain must be an integer"));
return false;
}
long range;
if (!mRange->GetValue().ToLong(&range)) {
wxMessageBox(_("The range must be a positive integer"));
AudacityMessageBox(_("The range must be a positive integer"));
return false;
}
long frequencygain;
if (!mFrequencyGain->GetValue().ToLong(&frequencygain)) {
wxMessageBox(_("The frequency gain must be an integer"));
AudacityMessageBox(_("The frequency gain must be an integer"));
return false;
}
#ifdef EXPERIMENTAL_FIND_NOTES
long findNotesMinA;
if (!mFindNotesMinA->GetValue().ToLong(&findNotesMinA)) {
wxMessageBox(_("The minimum amplitude (dB) must be an integer"));
AudacityMessageBox(_("The minimum amplitude (dB) must be an integer"));
return false;
}
long findNotesN;
if (!mFindNotesN->GetValue().ToLong(&findNotesN)) {
wxMessageBox(_("The maximum number of notes must be an integer"));
AudacityMessageBox(_("The maximum number of notes must be an integer"));
return false;
}
if (findNotesN < 1 || findNotesN > 128) {
wxMessageBox(_("The maximum number of notes must be in the range 1..128"));
AudacityMessageBox(_("The maximum number of notes must be in the range 1..128"));
return false;
}
#endif //EXPERIMENTAL_FIND_NOTES

View File

@ -43,6 +43,7 @@
#include "../Theme.h"
#include "../widgets/Grabber.h"
#include "../DeviceManager.h"
#include "../widgets/ErrorDialog.h"
IMPLEMENT_CLASS(DeviceToolBar, ToolBar);
@ -777,7 +778,7 @@ void DeviceToolBar::ShowChannelsDialog()
void DeviceToolBar::ShowComboDialog(wxChoice *combo, const wxString &title)
{
if (!combo || combo->GetCount() == 0) {
wxMessageBox(_("Device information is not available."));
AudacityMessageBox(_("Device information is not available."));
return;
}

View File

@ -27,6 +27,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../ViewInfo.h"
#include "../../../../WaveTrack.h"
#include "../../../../../images/Cursors.h"
#include "../../../../widgets/ErrorDialog.h"
static const int SMOOTHING_KERNEL_RADIUS = 3;
@ -183,7 +184,7 @@ namespace {
const int display = wt->GetDisplay();
if (WaveTrack::Waveform != display)
{
wxMessageBox(_(
AudacityMessageBox(_(
"To use Draw, choose 'Waveform' or 'Waveform (dB)' in the Track Dropdown Menu."),
_("Draw Tool"));
return false;
@ -193,7 +194,7 @@ namespace {
const double time = adjustTime(wt, viewInfo.PositionToTime(event.m_x, rect.x));
if (!SampleResolutionTest(viewInfo, wt, time, width))
{
wxMessageBox(_(
AudacityMessageBox(_(
"To use Draw, zoom in further until you can see the individual samples."),
_("Draw Tool"));
return false;

View File

@ -29,6 +29,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../../prefs/SpectrumPrefs.h"
#include "../../../../prefs/TracksBehaviorsPrefs.h"
#include "../../../../prefs/WaveformPrefs.h"
#include "../../../../widgets/ErrorDialog.h"
#include <wx/combobox.h>
@ -533,7 +534,7 @@ void RateMenuTable::OnRateOther(wxCommandEvent &)
break;
}
wxMessageBox(_("The entered value is invalid"), _("Error"),
AudacityMessageBox(_("The entered value is invalid"), _("Error"),
wxICON_ERROR, mpData->pParent);
}
@ -781,7 +782,7 @@ void WaveTrackMenuTable::OnSpectrogramSettings(wxCommandEvent &)
};
if (gAudioIO->IsBusy()){
wxMessageBox(_("To change Spectrogram Settings, stop any\n"
AudacityMessageBox(_("To change Spectrogram Settings, stop any\n"
"playing or recording first."),
_("Stop the Audio First"), wxOK | wxICON_EXCLAMATION | wxCENTRE);
return;

View File

@ -45,7 +45,6 @@ or ASlider.
#include <wx/dcmemory.h>
#include <wx/graphics.h>
#include <wx/image.h>
#include <wx/msgdlg.h>
#include <wx/panel.h>
#include <wx/tooltip.h>
#include <wx/debug.h>

View File

@ -232,3 +232,8 @@ void ShowAliasMissingDialog(AudacityProject *parent,
// PRL: answer is that the parent window guarantees destruction of the dialog
// but in practice Destroy() in OnOK does that
}
extern wxString AudacityMessageBoxCaptionStr()
{
return _("Message");
}

View File

@ -14,7 +14,9 @@
#include "../Audacity.h"
#include <wx/defs.h>
#include <wx/msgdlg.h>
#include <wx/window.h>
#include "LinkingHtmlWindow.h"
#include "wxPanelWrapper.h"
class AudacityProject;
@ -84,4 +86,51 @@ void ShowAliasMissingDialog(AudacityProject *parent,
const wxString &helpPage,
const bool Close = true);
extern wxString AudacityMessageBoxCaptionStr();
// Do not use wxMessageBox!! Its default window title does not translate!
inline int AudacityMessageBox(const wxString& message,
const wxString& caption = AudacityMessageBoxCaptionStr(),
long style = wxOK | wxCENTRE,
wxWindow *parent = NULL,
int x = wxDefaultCoord, int y = wxDefaultCoord)
{
return ::wxMessageBox(message, caption, style, parent, x, y);
}
// Similarly wrap wxTextEntryDialog, to prohibit the default,
// unlocalized caption
#include <wx/textdlg.h>
class AudacityTextEntryDialog : public wxTabTraversalWrapper< wxTextEntryDialog >
{
public:
AudacityTextEntryDialog(
wxWindow *parent,
const wxString& message,
const wxString& caption, // don't use = wxGetTextFromUserPromptStr,
const wxString& value = wxEmptyString,
long style = wxTextEntryDialogStyle,
const wxPoint& pos = wxDefaultPosition)
: wxTabTraversalWrapper< wxTextEntryDialog>
{ parent, message, caption, value, style, pos }
{}
};
// 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__

View File

@ -55,7 +55,6 @@
#include <wx/numdlg.h>
#include <wx/radiobut.h>
#include <wx/tooltip.h>
#include <wx/msgdlg.h>
#include <math.h>

View File

@ -41,6 +41,7 @@
#include <wx/evtloop.h>
#include <wx/frame.h>
#include <wx/intl.h>
#include <wx/msgdlg.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/sound.h>
@ -48,6 +49,7 @@
#include <wx/window.h>
#include "ProgressDialog.h"
#include "ErrorDialog.h"
#include "../Prefs.h"
// This really should be a Preferences setting
@ -1572,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);

View File

@ -26,7 +26,6 @@
#include <wx/gauge.h>
#include <wx/stattext.h>
#include <wx/utils.h>
#include <wx/msgdlg.h>
#include "wxPanelWrapper.h"

View File

@ -24,6 +24,7 @@
#include "../Audacity.h"
#include "valnum.h"
#include "ErrorDialog.h"
#ifdef __BORLANDC__
#pragma hdrstop
@ -32,7 +33,6 @@
#if wxUSE_VALIDATORS && wxUSE_TEXTCTRL
#ifndef WX_PRECOMP
#include <wx/msgdlg.h>
#include <wx/textctrl.h>
#endif
@ -91,7 +91,7 @@ bool NumValidatorBase::Validate(wxWindow *parent)
if ( !res )
{
wxMessageBox(errmsg, _("Validation error"),
AudacityMessageBox(errmsg, _("Validation error"),
wxOK | wxICON_ERROR, parent);
wxTextEntry *te = GetTextEntry();
if ( te )

View File

@ -32,10 +32,150 @@ public:
}
};
class wxPanel;
using wxPanelWrapper = wxTabTraversalWrapper<wxPanel>;
class wxPanelWrapper : public wxTabTraversalWrapper<wxPanel>
{
public:
// Constructors
wxPanelWrapper() {}
class wxDialog;
using wxDialogWrapper = wxTabTraversalWrapper<wxDialog>;
wxPanelWrapper(
wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
// Important: default window name localizes!
const wxString& name = _("Panel"))
: wxTabTraversalWrapper<wxPanel> { parent, winid, pos, size, style, name }
{}
// Pseudo ctor
bool Create(
wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
// Important: default window name localizes!
const wxString& name = _("Panel"))
{
return wxTabTraversalWrapper<wxPanel>::Create(
parent, winid, pos, size, style, name
);
}
};
class wxDialogWrapper : public wxTabTraversalWrapper<wxDialog>
{
public:
// Constructors
wxDialogWrapper() {}
// Constructor with no modal flag - the new convention.
wxDialogWrapper(
wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
// Important: default window name localizes!
const wxString& name = _("Dialog"))
: wxTabTraversalWrapper<wxDialog>
{ parent, id, title, pos, size, style, name }
{}
// Pseudo ctor
bool Create(
wxWindow *parent, wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
// Important: default window name localizes!
const wxString& name = _("Dialog"))
{
return wxTabTraversalWrapper<wxDialog>::Create(
parent, id, title, pos, size, style, name
);
}
};
#include <wx/dirdlg.h>
class wxDirDialogWrapper : public wxTabTraversalWrapper<wxDirDialog>
{
public:
wxDirDialogWrapper() {}
// Constructor with no modal flag - the new convention.
wxDirDialogWrapper(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("Directory Dialog"))
: wxTabTraversalWrapper<wxDirDialog>
{ parent, message, defaultPath, style, pos, size, name }
{}
void Create(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("Directory Dialog"))
{
return wxTabTraversalWrapper<wxDirDialog>::Create(
parent, message, defaultPath, style, pos, size, name
);
}
};
#include "../lib-src/FileDialog/FileDialog.h"
class FileDialogWrapper : public wxTabTraversalWrapper<FileDialog>
{
public:
FileDialogWrapper() {}
// Constructor with no modal flag - the new convention.
FileDialogWrapper(
wxWindow *parent,
const wxString& message = _("Select a file"),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("File Dialog"))
: wxTabTraversalWrapper<FileDialog>
{ parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name }
{}
void Create(
wxWindow *parent,
const wxString& message = _("Select a file"),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("File Dialog"))
{
return wxTabTraversalWrapper<FileDialog>::Create(
parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name
);
}
};
#endif