1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

Revert to non-persistent LastOpenType per Gale's request

This commit is contained in:
LRN1986 2010-03-26 15:48:13 +00:00
parent eac019b68a
commit 1527368d99
2 changed files with 12 additions and 7 deletions

View File

@ -4466,6 +4466,7 @@ void AudacityProject::OnImport()
{ {
wxArrayString selectedFiles = ShowOpenDialog(wxT("")); wxArrayString selectedFiles = ShowOpenDialog(wxT(""));
if (selectedFiles.GetCount() == 0) { if (selectedFiles.GetCount() == 0) {
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
return; return;
} }
@ -4483,7 +4484,8 @@ void AudacityProject::OnImport()
Import(fileName); Import(fileName);
} }
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
HandleResize(); // Adjust scrollers for new track sizes. HandleResize(); // Adjust scrollers for new track sizes.
ODManager::Resume(); ODManager::Resume();
} }

View File

@ -2138,10 +2138,8 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext
dlog.SetFilterIndex(index); dlog.SetFilterIndex(index);
if (dlog.ShowModal() != wxID_OK) { int dialogResult = dlog.ShowModal();
return selected;
}
// Convert the filter index to type and save // Convert the filter index to type and save
index = dlog.GetFilterIndex(); index = dlog.GetFilterIndex();
for (int i = 0; i < index; i++) { 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("/DefaultOpenType"), mask.BeforeFirst(wxT('|')));
gPrefs->Write(wxT("/LastOpenType"), mask.BeforeFirst(wxT('|'))); gPrefs->Write(wxT("/LastOpenType"), mask.BeforeFirst(wxT('|')));
// Return the selected files if (dialogResult != wxID_OK) {
dlog.GetPaths(selected); // Return the selected files
dlog.GetPaths(selected);
}
return selected; return selected;
} }
@ -2164,6 +2164,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj)
* now be added automatically for the Save Projects dialogues).*/ * now be added automatically for the Save Projects dialogues).*/
wxArrayString selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup")); wxArrayString selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup"));
if (selectedFiles.GetCount() == 0) { if (selectedFiles.GetCount() == 0) {
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
return; return;
} }
@ -2218,6 +2219,8 @@ void AudacityProject::OpenFiles(AudacityProject *proj)
proj->OpenFile(fileName); proj->OpenFile(fileName);
} }
gPrefs->Write(wxT("/LastOpenType"),wxT(""));
ODManager::Resume(); ODManager::Resume();
} }