Attempting to load a file which does not exist no longer unloads previous subtitles. (Fix to bug #12)

Originally committed to SVN as r133.
This commit is contained in:
Rodrigo Braz Monteiro 2006-02-23 22:47:14 +00:00
parent 7e1d5f4fa8
commit 81efd4082f
2 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,7 @@ Please visit http://aegisub.net to download latest version
- Added forums and bugtracker to Help menu. (AMZ) - Added forums and bugtracker to Help menu. (AMZ)
- Fixed Fonts Collector behavior with font shortcuts. (AMZ) - Fixed Fonts Collector behavior with font shortcuts. (AMZ)
- Better error reporting when loading Automation scripts (jfs) - Better error reporting when loading Automation scripts (jfs)
- Attempting to load a file which does not exist no longer unloads previous subtitles. (AMZ)
= 1.09 beta - 2006.01.16 =========================== = 1.09 beta - 2006.01.16 ===========================

View File

@ -485,6 +485,13 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
// Load // Load
try { try {
// File exists?
if (isFile) {
wxFileName fileCheck(filename);
if (!fileCheck.FileExists()) throw _T("File does not exist.");
}
// Proceed into loading
SubsBox->Clear(); SubsBox->Clear();
AssFile::StackReset(); AssFile::StackReset();
if (isFile) { if (isFile) {
@ -501,6 +508,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
} }
catch (AutomationError &err) { catch (AutomationError &err) {
wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL);
return;
} }
catch (...) { catch (...) {
wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL);