1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 23:33:49 +01:00

Rewrite FileDialogWrapper using FileNames::FileTypes...

... also removing some repeated code and using the config keys /DefaultOpenType
and /LastOpenType only in Import.cpp
This commit is contained in:
Paul Licameli
2019-12-20 13:02:31 -05:00
parent fc668f09b0
commit c64b3cb31f
13 changed files with 93 additions and 216 deletions

View File

@@ -21,6 +21,7 @@
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
#include "../export/ExportMultiple.h"
#include "../import/Import.h"
#include "../import/ImportMIDI.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/FileHistory.h"
@@ -373,10 +374,9 @@ void OnImport(const CommandContext &context)
// this serves to track the file if the users zooms in and such.
MissingAliasFilesDialog::SetShouldShow(true);
wxArrayString selectedFiles = ProjectFileManager::ShowOpenDialog(wxT(""));
auto selectedFiles = ProjectFileManager::ShowOpenDialog();
if (selectedFiles.size() == 0) {
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
gPrefs->Flush();
Importer::SetLastOpenType({});
return;
}
@@ -391,10 +391,7 @@ void OnImport(const CommandContext &context)
ODManager::Pauser pauser;
auto cleanup = finally( [&] {
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
gPrefs->Flush();
Importer::SetLastOpenType({});
window.HandleResize(); // Adjust scrollers for NEW track sizes.
} );