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:
@@ -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.
|
||||
} );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user