mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 00:03:52 +02:00
Define wxDirDialogWrapper, with localized default prompt and name
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -100,4 +100,41 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#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
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user