mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-24 23:13:42 +02:00
AUP3: Update default/lastused path handling
This commit is contained in:
@@ -631,7 +631,7 @@ bool Exporter::GetFilename()
|
||||
wxString defext = mPlugins[mFormat]->GetExtension(mSubFormat).Lower();
|
||||
|
||||
//Bug 1304: Set a default path if none was given. For Export.
|
||||
mFilename = FileNames::DefaultToDocumentsFolder(wxT("/Export/Path"));
|
||||
mFilename.SetPath(FileNames::FindDefaultPath(FileNames::Operation::Export));
|
||||
mFilename.SetName(mProject->GetProjectName());
|
||||
if (mFilename.GetName().empty())
|
||||
mFilename.SetName(_("untitled"));
|
||||
@@ -776,8 +776,8 @@ bool Exporter::CheckFilename()
|
||||
{
|
||||
if( mFormatName.empty() )
|
||||
gPrefs->Write(wxT("/Export/Format"), mPlugins[mFormat]->GetFormat(mSubFormat));
|
||||
gPrefs->Write(wxT("/Export/Path"), mFilename.GetPath());
|
||||
gPrefs->Flush();
|
||||
|
||||
FileNames::UpdateDefaultPath(FileNames::Operation::Export, mFilename.GetPath());
|
||||
|
||||
//
|
||||
// To be even safer, return a temporary file name based
|
||||
|
||||
@@ -255,8 +255,7 @@ void ExportMultipleDialog::PopulateOrExchange(ShuttleGui& S)
|
||||
|
||||
|
||||
// Bug 1304: Set the default file path. It's used if none stored in config.
|
||||
auto filename = FileNames::DefaultToDocumentsFolder(wxT("/Export/Path"));
|
||||
wxString DefaultPath = filename.GetPath();
|
||||
auto DefaultPath = FileNames::FindDefaultPath(FileNames::Operation::Export);
|
||||
|
||||
if (mPluginIndex == -1)
|
||||
{
|
||||
@@ -274,9 +273,8 @@ void ExportMultipleDialog::PopulateOrExchange(ShuttleGui& S)
|
||||
S.StartMultiColumn(4, true);
|
||||
{
|
||||
mDir = S.Id(DirID)
|
||||
.TieTextBox(XXO("Folder:"),
|
||||
{wxT("/Export/MultiplePath"),
|
||||
DefaultPath},
|
||||
.AddTextBox(XXO("Folder:"),
|
||||
DefaultPath,
|
||||
64);
|
||||
S.Id(ChooseID).AddButton(XXO("Choose..."));
|
||||
S.Id(CreateID).AddButton(XXO("Create"));
|
||||
@@ -573,6 +571,8 @@ void ExportMultipleDialog::OnExport(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
FileNames::UpdateDefaultPath(FileNames::Operation::Export, mDir->GetValue());
|
||||
|
||||
// Make sure the output directory is in good shape
|
||||
if (!DirOk()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user