XMLFileWriter takes TranslatableString caption

This commit is contained in:
Paul Licameli 2019-12-19 14:36:37 -05:00
parent 5e26ef1eba
commit 3a633e4fd8
10 changed files with 14 additions and 14 deletions

View File

@ -529,7 +529,7 @@ bool AutoSaveFile::Decode(const FilePath & fileName)
// PRL: Yes, now we are doing GuardedCall everywhere that XMLFileWriter is
// used.
return GuardedCall< bool >( [&] {
XMLFileWriter out{ fileName, _("Error Decoding File") };
XMLFileWriter out{ fileName, XO("Error Decoding File") };
IdMap mIds;
std::vector<IdMap> mIdStack;

View File

@ -259,7 +259,7 @@ bool ConvertLegacyProjectFile(const wxFileName &filename)
return false;
return GuardedCall< bool >( [&] {
XMLFileWriter xmlFile{ name, _("Error Converting Legacy Project File") };
XMLFileWriter xmlFile{ name, XO("Error Converting Legacy Project File") };
xmlFile.Write(wxT("<?xml version=\"1.0\"?>\n"));

View File

@ -483,7 +483,7 @@ bool ProjectFileManager::DoSave (const bool fromSaveAs,
// And that cleanup is done by the destructor of saveFile, if PostCommit() is
// not done.
// (SetProject, when it fails, cleans itself up.)
XMLFileWriter saveFile{ fileName, _("Error Saving Project") };
XMLFileWriter saveFile{ fileName, XO("Error Saving Project") };
success = GuardedCall< bool >( [&] {
projectFileIO.WriteXMLHeader(saveFile);
projectFileIO.WriteXML(saveFile, bWantSaveCopy ? &strOtherNamesArray : nullptr);

View File

@ -1314,7 +1314,7 @@ void TagsEditorDialog::OnSave(wxCommandEvent & WXUNUSED(event))
GuardedCall( [&] {
// Create/Open the file
XMLFileWriter writer{ fn, _("Error Saving Tags File") };
XMLFileWriter writer{ fn, XO("Error Saving Tags File") };
// Remember title and track in case they're read only
wxString title = mLocal.GetTag(TAG_TITLE);

View File

@ -1816,7 +1816,7 @@ void EffectEqualization::SaveCurves(const wxString &fileName)
GuardedCall( [&] {
// Create/Open the file
const wxString fullPath{ fn.GetFullPath() };
XMLFileWriter eqFile{ fullPath, _("Error Saving Equalization Curves") };
XMLFileWriter eqFile{ fullPath, XO("Error Saving Equalization Curves") };
// Write the curves
WriteXML( eqFile );

View File

@ -3629,7 +3629,7 @@ void VSTEffect::SaveFXProgram(wxMemoryBuffer & buf, int index)
void VSTEffect::SaveXML(const wxFileName & fn)
// may throw
{
XMLFileWriter xmlFile{ fn.GetFullPath(), _("Error Saving Effect Presets") };
XMLFileWriter xmlFile{ fn.GetFullPath(), XO("Error Saving Effect Presets") };
xmlFile.StartTag(wxT("vstprogrampersistence"));
xmlFile.WriteAttr(wxT("version"), wxT("2"));

View File

@ -608,7 +608,7 @@ FFmpegPresets::~FFmpegPresets()
GuardedCall( [&] {
wxFileName xmlFileName{ FileNames::DataDir(), wxT("ffmpeg_presets.xml") };
XMLFileWriter writer{
xmlFileName.GetFullPath(), _("Error Saving FFmpeg Presets") };
xmlFileName.GetFullPath(), XO("Error Saving FFmpeg Presets") };
WriteXMLHeader(writer);
WriteXML(writer);
writer.Commit();
@ -632,7 +632,7 @@ void FFmpegPresets::ImportPresets(wxString &filename)
void FFmpegPresets::ExportPresets(wxString &filename)
{
GuardedCall( [&] {
XMLFileWriter writer{ filename, _("Error Saving FFmpeg Presets") };
XMLFileWriter writer{ filename, XO("Error Saving FFmpeg Presets") };
WriteXMLHeader(writer);
WriteXML(writer);
writer.Commit();

View File

@ -384,7 +384,7 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
}
GuardedCall( [&] {
XMLFileWriter prefFile{ file, _("Error Exporting Keyboard Shortcuts") };
XMLFileWriter prefFile{ file, XO("Error Exporting Keyboard Shortcuts") };
mManager->WriteXML(prefFile);
prefFile.Commit();
} );

View File

@ -292,8 +292,8 @@ wxString XMLWriter::XMLEsc(const wxString & s)
///
/// XMLFileWriter class
///
XMLFileWriter::XMLFileWriter
( const FilePath &outputPath, const wxString &caption, bool keepBackup )
XMLFileWriter::XMLFileWriter(
const FilePath &outputPath, const TranslatableString &caption, bool keepBackup )
: mOutputPath{ outputPath }
, mCaption{ caption }
, mKeepBackup{ keepBackup }

View File

@ -84,9 +84,9 @@ class AUDACITY_DLL_API XMLFileWriter final : private wxFFile, public XMLWriter {
/// The caption is for message boxes to show in case of errors.
/// Might throw.
XMLFileWriter
( const FilePath &outputPath, const wxString &caption,
bool keepBackup = false );
XMLFileWriter(
const FilePath &outputPath, const TranslatableString &caption,
bool keepBackup = false );
virtual ~XMLFileWriter();