diff --git a/core/changelog.txt b/core/changelog.txt index 13b294fe8..0255b6d63 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -95,6 +95,7 @@ Please visit http://aegisub.net to download latest version - Fixed the default resolution for video display and resolution resampler when the script's field is blank. (AMZ) - Stopping audio playback will now stop video playback as well. (AMZ) - Implemented sorting of subtitles by start time. (AMZ) +- Recovered subtitle files are now saved in their own subfolder. (AMZ) = 1.09 beta - 2006.01.16 =========================== diff --git a/core/main.cpp b/core/main.cpp index a345e15e2..10f367d3d 100644 --- a/core/main.cpp +++ b/core/main.cpp @@ -137,8 +137,15 @@ bool AegisubApp::OnInit() { // Unhandled exception void AegisubApp::OnUnhandledException() { // Attempt to recover file - wxFileName orig(AssFile::top->filename); - wxString filename = folderName + orig.GetName() + _T(".RECOVER.ass"); + wxFileName origfile(AssFile::top->filename); + wxString path = Options.AsText(_T("Auto recovery path")); + if (path.IsEmpty()) path = folderName; + wxFileName dstpath(path); + if (!dstpath.IsAbsolute()) path = AegisubApp::folderName + path; + path += _T("/"); + dstpath.Assign(path); + if (!dstpath.DirExists()) wxMkdir(path); + wxString filename = folderName + origfile.GetName() + _T(".RECOVER.ass"); AssFile::top->Save(filename,false,false); // Inform user of crash @@ -150,8 +157,15 @@ void AegisubApp::OnUnhandledException() { // Fatal exception void AegisubApp::OnFatalException() { // Attempt to recover file - wxFileName orig(AssFile::top->filename); - wxString filename = folderName + orig.GetName() + _T(".RECOVER.ass"); + wxFileName origfile(AssFile::top->filename); + wxString path = Options.AsText(_T("Auto recovery path")); + if (path.IsEmpty()) path = folderName; + wxFileName dstpath(path); + if (!dstpath.IsAbsolute()) path = AegisubApp::folderName + path; + path += _T("/"); + dstpath.Assign(path); + if (!dstpath.DirExists()) wxMkdir(path); + wxString filename = path + origfile.GetName() + _T(".RECOVER.ass"); AssFile::top->Save(filename,false,false); // Stack walk diff --git a/core/options.cpp b/core/options.cpp index 62326a17a..7b8c26fb9 100644 --- a/core/options.cpp +++ b/core/options.cpp @@ -238,6 +238,7 @@ void OptionsManager::LoadDefaults() { SetInt(_T("Auto save every seconds"),60); SetText(_T("Auto backup path"),_T("autoback")); SetText(_T("Auto save path"),_T("autosave")); + SetText(_T("Auto recovery path"),_T("recovered")); SetInt(_T("Autoload linked files"),2); SetText(_T("Text actor separator"),_T(":"));