From 1527368d99301e41c89f5a47284fba87d5f4f480 Mon Sep 17 00:00:00 2001 From: LRN1986 Date: Fri, 26 Mar 2010 15:48:13 +0000 Subject: [PATCH] Revert to non-persistent LastOpenType per Gale's request --- src/Menus.cpp | 4 +++- src/Project.cpp | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index 91bac9ffe..7e7ed230b 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -4466,6 +4466,7 @@ void AudacityProject::OnImport() { wxArrayString selectedFiles = ShowOpenDialog(wxT("")); if (selectedFiles.GetCount() == 0) { + gPrefs->Write(wxT("/LastOpenType"),wxT("")); return; } @@ -4483,7 +4484,8 @@ void AudacityProject::OnImport() Import(fileName); } - + + gPrefs->Write(wxT("/LastOpenType"),wxT("")); HandleResize(); // Adjust scrollers for new track sizes. ODManager::Resume(); } diff --git a/src/Project.cpp b/src/Project.cpp index 02a729ca7..a1ce68754 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2138,10 +2138,8 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext dlog.SetFilterIndex(index); - if (dlog.ShowModal() != wxID_OK) { - return selected; - } - + int dialogResult = dlog.ShowModal(); + // Convert the filter index to type and save index = dlog.GetFilterIndex(); for (int i = 0; i < index; i++) { @@ -2150,8 +2148,10 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext gPrefs->Write(wxT("/DefaultOpenType"), mask.BeforeFirst(wxT('|'))); gPrefs->Write(wxT("/LastOpenType"), mask.BeforeFirst(wxT('|'))); - // Return the selected files - dlog.GetPaths(selected); + if (dialogResult != wxID_OK) { + // Return the selected files + dlog.GetPaths(selected); + } return selected; } @@ -2164,6 +2164,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj) * now be added automatically for the Save Projects dialogues).*/ wxArrayString selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup")); if (selectedFiles.GetCount() == 0) { + gPrefs->Write(wxT("/LastOpenType"),wxT("")); return; } @@ -2218,6 +2219,8 @@ void AudacityProject::OpenFiles(AudacityProject *proj) proj->OpenFile(fileName); } + gPrefs->Write(wxT("/LastOpenType"),wxT("")); + ODManager::Resume(); }