mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
AUP3: Update default/lastused path handling
This commit is contained in:
@@ -399,7 +399,7 @@ void OnImport(const CommandContext &context)
|
||||
auto &project = context.project;
|
||||
auto &window = ProjectWindow::Get( project );
|
||||
|
||||
auto selectedFiles = ProjectFileManager::ShowOpenDialog();
|
||||
auto selectedFiles = ProjectFileManager::ShowOpenDialog(FileNames::Operation::Import);
|
||||
if (selectedFiles.size() == 0) {
|
||||
Importer::SetLastOpenType({});
|
||||
return;
|
||||
@@ -420,7 +420,7 @@ void OnImport(const CommandContext &context)
|
||||
for (size_t ff = 0; ff < selectedFiles.size(); ff++) {
|
||||
wxString fileName = selectedFiles[ff];
|
||||
|
||||
FileNames::UpdateDefaultPath(FileNames::Operation::Open, fileName);
|
||||
FileNames::UpdateDefaultPath(FileNames::Operation::Import, ::wxPathOnly(fileName));
|
||||
|
||||
ProjectFileManager::Get( project ).Import(fileName);
|
||||
}
|
||||
|
||||
@@ -375,12 +375,10 @@ struct Handler : CommandHandlerObject {
|
||||
void OnResetConfig(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
//wxString dir = gPrefs->Read("/Directories/TempDir");
|
||||
gPrefs->DeleteAll();
|
||||
|
||||
// Directory will be reset on next restart.
|
||||
wxString dir = FileNames::DefaultTempDir();
|
||||
gPrefs->Write("/Directories/TempDir", dir);
|
||||
FileNames::UpdateDefaultPath(FileNames::Operation::Temp, FileNames::DefaultTempDir());
|
||||
gPrefs->Write("/GUI/SyncLockTracks", 0);
|
||||
gPrefs->Write("/SnapTo", 0 );
|
||||
ProjectSelectionManager::Get( project ).AS_SetSnapTo( 0 );
|
||||
|
||||
Reference in New Issue
Block a user