Recovered subtitle files are now saved in their own subfolder.

Originally committed to SVN as r468.
This commit is contained in:
Rodrigo Braz Monteiro 2006-07-06 23:20:30 +00:00
parent 72abf003b1
commit 14dbb8c4a4
3 changed files with 20 additions and 4 deletions

View file

@ -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 ===========================

View file

@ -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

View file

@ -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(":"));