mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
More TranslatableString in dialog wrapper classes...
... All of the dialog names, and the messages for File and directory dialog wrappers
This commit is contained in:
parent
e3ea93a624
commit
1b726f4f09
@ -336,7 +336,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
||||
return;
|
||||
}
|
||||
|
||||
wxString prompt = _("Select file(s) for batch processing...");
|
||||
auto prompt = XO("Select file(s) for batch processing...");
|
||||
|
||||
FormatList l;
|
||||
wxString filter;
|
||||
|
@ -1094,11 +1094,11 @@ wxArrayString ProjectFileManager::ShowOpenDialog(const wxString &extraformat, co
|
||||
wxArrayString selected;
|
||||
|
||||
FileDialogWrapper dlog(NULL,
|
||||
_("Select one or more files"),
|
||||
path,
|
||||
wxT(""),
|
||||
mask,
|
||||
wxFD_OPEN | wxFD_MULTIPLE | wxRESIZE_BORDER);
|
||||
XO("Select one or more files"),
|
||||
path,
|
||||
wxT(""),
|
||||
mask,
|
||||
wxFD_OPEN | wxFD_MULTIPLE | wxRESIZE_BORDER);
|
||||
|
||||
dlog.SetFilterIndex(index);
|
||||
|
||||
|
@ -557,8 +557,8 @@ void ScreenshotBigDialog::OnDirChoose(wxCommandEvent & WXUNUSED(event))
|
||||
wxString current = mDirectoryTextBox->GetValue();
|
||||
|
||||
wxDirDialogWrapper dlog(this,
|
||||
_("Choose a location to save screenshot images"),
|
||||
current);
|
||||
XO("Choose a location to save screenshot images"),
|
||||
current);
|
||||
|
||||
dlog.ShowModal();
|
||||
if (!dlog.GetPath().empty()) {
|
||||
|
@ -3678,7 +3678,9 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
|
||||
|
||||
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
FileDialogWrapper filePicker(this, _("Choose an EQ curve file"), FileNames::DataDir(), wxT(""), _("xml files (*.xml;*.XML)|*.xml;*.XML"));
|
||||
FileDialogWrapper filePicker(this,
|
||||
XO("Choose an EQ curve file"), FileNames::DataDir(), wxT(""),
|
||||
_("xml files (*.xml;*.XML)|*.xml;*.XML"));
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
@ -3698,7 +3700,9 @@ void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
||||
|
||||
void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
FileDialogWrapper filePicker(this, _("Export EQ curves as..."), FileNames::DataDir(), wxT(""), wxT("*.XML"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
||||
FileDialogWrapper filePicker(this, XO("Export EQ curves as..."),
|
||||
FileNames::DataDir(), wxT(""), wxT("*.XML"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
|
@ -2788,12 +2788,13 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
|
||||
}
|
||||
}
|
||||
|
||||
FileDialogWrapper dlog(mUIParent,
|
||||
_("Load Nyquist script"),
|
||||
mFileName.GetPath(),
|
||||
wxEmptyString,
|
||||
_("Nyquist scripts (*.ny)|*.ny|Lisp scripts (*.lsp)|*.lsp|Text files (*.txt)|*.txt|All files|*"),
|
||||
wxFD_OPEN | wxRESIZE_BORDER);
|
||||
FileDialogWrapper dlog(
|
||||
mUIParent,
|
||||
XO("Load Nyquist script"),
|
||||
mFileName.GetPath(),
|
||||
wxEmptyString,
|
||||
_("Nyquist scripts (*.ny)|*.ny|Lisp scripts (*.lsp)|*.lsp|Text files (*.txt)|*.txt|All files|*"),
|
||||
wxFD_OPEN | wxRESIZE_BORDER);
|
||||
|
||||
if (dlog.ShowModal() != wxID_OK)
|
||||
{
|
||||
@ -2810,12 +2811,13 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
|
||||
|
||||
void NyquistEffect::OnSave(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
FileDialogWrapper dlog(mUIParent,
|
||||
_("Save Nyquist script"),
|
||||
mFileName.GetPath(),
|
||||
mFileName.GetFullName(),
|
||||
_("Nyquist scripts (*.ny)|*.ny|Lisp scripts (*.lsp)|*.lsp|All files|*"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER);
|
||||
FileDialogWrapper dlog(
|
||||
mUIParent,
|
||||
XO("Save Nyquist script"),
|
||||
mFileName.GetPath(),
|
||||
mFileName.GetFullName(),
|
||||
_("Nyquist scripts (*.ny)|*.ny|Lisp scripts (*.lsp)|*.lsp|All files|*"),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER);
|
||||
|
||||
if (dlog.ShowModal() != wxID_OK)
|
||||
{
|
||||
|
@ -331,7 +331,7 @@ Exporter::Exporter()
|
||||
}
|
||||
);
|
||||
|
||||
SetFileDialogTitle( _("Export Audio") );
|
||||
SetFileDialogTitle( XO("Export Audio") );
|
||||
}
|
||||
|
||||
Exporter::~Exporter()
|
||||
@ -361,7 +361,7 @@ void Exporter::OnHelp(wxCommandEvent& WXUNUSED(evt))
|
||||
HelpSystem::ShowHelp(pWin, wxT("File_Export_Dialog"), true);
|
||||
}
|
||||
|
||||
void Exporter::SetFileDialogTitle( const wxString & DialogTitle )
|
||||
void Exporter::SetFileDialogTitle( const TranslatableString & DialogTitle )
|
||||
{
|
||||
// The default title is "Export File"
|
||||
mFileDialogTitle = DialogTitle;
|
||||
|
@ -184,7 +184,7 @@ public:
|
||||
Exporter();
|
||||
virtual ~Exporter();
|
||||
|
||||
void SetFileDialogTitle( const wxString & DialogTitle );
|
||||
void SetFileDialogTitle( const TranslatableString & DialogTitle );
|
||||
void SetDefaultFormat( const wxString & Format ){ mFormatName = Format;};
|
||||
|
||||
bool Process(AudacityProject *project, bool selectedOnly,
|
||||
@ -229,7 +229,7 @@ private:
|
||||
private:
|
||||
wxString mFormatName;
|
||||
FileDialogWrapper *mDialog;
|
||||
wxString mFileDialogTitle;
|
||||
TranslatableString mFileDialogTitle;
|
||||
AudacityProject *mProject;
|
||||
std::unique_ptr<MixerSpec> mMixerSpec;
|
||||
|
||||
|
@ -1988,11 +1988,11 @@ void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString path;
|
||||
FileDialogWrapper dlg(this,
|
||||
_("Select xml file with presets to import"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
wxString(_("XML files (*.xml)|*.xml|All files|*")),
|
||||
wxFD_OPEN);
|
||||
XO("Select xml file with presets to import"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
wxString(_("XML files (*.xml)|*.xml|All files|*")),
|
||||
wxFD_OPEN);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
mPresets->ImportPresets(path);
|
||||
@ -2021,11 +2021,11 @@ void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
wxString path;
|
||||
FileDialogWrapper dlg(this,
|
||||
_("Select xml file to export presets into"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
wxString(_("XML files (*.xml)|*.xml|All files|*")),
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
XO("Select xml file to export presets into"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
wxString(_("XML files (*.xml)|*.xml|All files|*")),
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
mPresets->ExportPresets(path);
|
||||
|
@ -509,8 +509,8 @@ void ExportMultipleDialog::OnCreate(wxCommandEvent& WXUNUSED(event))
|
||||
void ExportMultipleDialog::OnChoose(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxDirDialogWrapper dlog(this,
|
||||
_("Choose a location to save the exported files"),
|
||||
mDir->GetValue());
|
||||
XO("Choose a location to save the exported files"),
|
||||
mDir->GetValue());
|
||||
dlog.ShowModal();
|
||||
if (!dlog.GetPath().empty())
|
||||
mDir->SetValue(dlog.GetPath());
|
||||
|
@ -205,7 +205,7 @@ void OnExportSelection(const CommandContext &context)
|
||||
Exporter e;
|
||||
|
||||
MissingAliasFilesDialog::SetShouldShow(true);
|
||||
e.SetFileDialogTitle( _("Export Selected Audio") );
|
||||
e.SetFileDialogTitle( XO("Export Selected Audio") );
|
||||
e.Process(&project, true, selectedRegion.t0(),
|
||||
selectedRegion.t1());
|
||||
}
|
||||
|
@ -159,8 +159,8 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e)
|
||||
oldTempDir = FileNames::DefaultTempDir();
|
||||
|
||||
wxDirDialogWrapper dlog(this,
|
||||
_("Choose a location to place the temporary directory"),
|
||||
oldTempDir );
|
||||
XO("Choose a location to place the temporary directory"),
|
||||
oldTempDir );
|
||||
int retval = dlog.ShowModal();
|
||||
if (retval != wxID_CANCEL && !dlog.GetPath().empty()) {
|
||||
wxFileName tmpDirPath;
|
||||
|
@ -91,9 +91,9 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
// Important: default window name localizes!
|
||||
const wxString& name = _("Dialog"))
|
||||
: wxTabTraversalWrapper<wxDialog>
|
||||
( parent, id, title.Translation(), pos, size, style, name )
|
||||
const TranslatableString& name = XO("Dialog"))
|
||||
: wxTabTraversalWrapper<wxDialog>(
|
||||
parent, id, title.Translation(), pos, size, style, name.Translation() )
|
||||
{}
|
||||
|
||||
// Pseudo ctor
|
||||
@ -104,10 +104,10 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
// Important: default window name localizes!
|
||||
const wxString& name = _("Dialog"))
|
||||
const TranslatableString& name = XO("Dialog"))
|
||||
{
|
||||
return wxTabTraversalWrapper<wxDialog>::Create(
|
||||
parent, id, title.Translation(), pos, size, style, name
|
||||
parent, id, title.Translation(), pos, size, style, name.Translation()
|
||||
);
|
||||
}
|
||||
|
||||
@ -121,43 +121,46 @@ public:
|
||||
|
||||
#include <wx/dirdlg.h> // to inherit
|
||||
|
||||
class AUDACITY_DLL_API wxDirDialogWrapper : public wxTabTraversalWrapper<wxDirDialog>
|
||||
class AUDACITY_DLL_API wxDirDialogWrapper
|
||||
: public wxTabTraversalWrapper<wxDirDialog>
|
||||
{
|
||||
public:
|
||||
// Constructor with no modal flag - the new convention.
|
||||
wxDirDialogWrapper(
|
||||
wxWindow *parent,
|
||||
const wxString& message = _("Select a directory"),
|
||||
const TranslatableString& message = XO("Select a directory"),
|
||||
const wxString& defaultPath = {},
|
||||
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 )
|
||||
const TranslatableString& name = XO("Directory Dialog"))
|
||||
: wxTabTraversalWrapper<wxDirDialog>(
|
||||
parent, message.Translation(), defaultPath, style, pos, size,
|
||||
name.Translation() )
|
||||
{}
|
||||
|
||||
// Pseudo ctor
|
||||
void Create(
|
||||
wxWindow *parent,
|
||||
const wxString& message = _("Select a directory"),
|
||||
const TranslatableString& message = XO("Select a directory"),
|
||||
const wxString& defaultPath = {},
|
||||
long style = wxDD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
// Important: default window name localizes!
|
||||
const wxString& name = _("Directory Dialog"))
|
||||
const TranslatableString& name = XO("Directory Dialog"))
|
||||
{
|
||||
wxTabTraversalWrapper<wxDirDialog>::Create(
|
||||
parent, message, defaultPath, style, pos, size, name
|
||||
);
|
||||
parent, message.Translation(), defaultPath, style, pos, size,
|
||||
name.Translation() );
|
||||
}
|
||||
};
|
||||
|
||||
#include "../lib-src/FileDialog/FileDialog.h"
|
||||
|
||||
class AUDACITY_DLL_API FileDialogWrapper : public wxTabTraversalWrapper<FileDialog>
|
||||
class AUDACITY_DLL_API FileDialogWrapper
|
||||
: public wxTabTraversalWrapper<FileDialog>
|
||||
{
|
||||
public:
|
||||
FileDialogWrapper() {}
|
||||
@ -165,7 +168,7 @@ public:
|
||||
// Constructor with no modal flag - the new convention.
|
||||
FileDialogWrapper(
|
||||
wxWindow *parent,
|
||||
const wxString& message = _("Select a file"),
|
||||
const TranslatableString& message = XO("Select a file"),
|
||||
const FilePath& defaultDir = {},
|
||||
const FilePath& defaultFile = {},
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
@ -173,15 +176,16 @@ public:
|
||||
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 )
|
||||
const TranslatableString& name = XO("File Dialog"))
|
||||
: wxTabTraversalWrapper<FileDialog>(
|
||||
parent, message.Translation(), defaultDir, defaultFile, wildCard, style,
|
||||
pos, sz, name.Translation() )
|
||||
{}
|
||||
|
||||
// Pseudo ctor
|
||||
void Create(
|
||||
wxWindow *parent,
|
||||
const wxString& message = _("Select a file"),
|
||||
const TranslatableString& message = XO("Select a file"),
|
||||
const FilePath& defaultDir = {},
|
||||
const FilePath& defaultFile = {},
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
@ -189,10 +193,11 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
// Important: default window name localizes!
|
||||
const wxString& name = _("File Dialog"))
|
||||
const TranslatableString& name = XO("File Dialog"))
|
||||
{
|
||||
wxTabTraversalWrapper<FileDialog>::Create(
|
||||
parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name
|
||||
parent, message.Translation(), defaultDir, defaultFile, wildCard,
|
||||
style, pos, sz, name.Translation()
|
||||
);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user