1
0
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:
Leland Lucius
2020-07-27 14:11:50 -05:00
parent 757bc0b183
commit e2d6e1cc24
15 changed files with 299 additions and 173 deletions

View File

@@ -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

View File

@@ -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;