Fixed bug related to tag cycling, which would reset grid, move video and force a refresh of everything (slow, and could undo uncommited changes)

Originally committed to SVN as r73.
This commit is contained in:
Rodrigo Braz Monteiro 2006-02-19 04:00:22 +00:00
parent f549c498c3
commit 82236684e7
2 changed files with 28 additions and 16 deletions

View file

@ -27,6 +27,7 @@ Please visit http://aegisub.net to download latest version
- Default video zoom can now be set in config.dat and is defaulted to 100% (AMZ) - Default video zoom can now be set in config.dat and is defaulted to 100% (AMZ)
- Fixed crash in Translation and Styling assistants, when you attempted to move past end of file, and then play (AMZ) - Fixed crash in Translation and Styling assistants, when you attempted to move past end of file, and then play (AMZ)
- Fixed linked commit of times, so it will only commit both times if the other was changed (to prevent damage when editing multiple lines) (AMZ) - Fixed linked commit of times, so it will only commit both times if the other was changed (to prevent damage when editing multiple lines) (AMZ)
- Fixed bug related to tag cycling, which would reset grid, move video and force a refresh of everything (slow, and could undo uncommited changes) (AMZ)
= 1.09 beta - 2006.01.16 =========================== = 1.09 beta - 2006.01.16 ===========================

View file

@ -996,23 +996,34 @@ void FrameMain::OnOpenStylingAssistant (wxCommandEvent &event) {
// Auto backup // Auto backup
void FrameMain::OnAutoSave(wxTimerEvent &event) { void FrameMain::OnAutoSave(wxTimerEvent &event) {
// Auto Save // Auto Save
if (AssFile::top->loaded && AssFile::top->IsASS) { try {
// Set path if (AssFile::top->loaded && AssFile::top->IsASS) {
wxFileName origfile(AssFile::top->filename); // Set path
wxString path = Options.AsText(_T("Auto save path")); wxFileName origfile(AssFile::top->filename);
if (path == _T("")) path = origfile.GetPath(); wxString path = Options.AsText(_T("Auto save path"));
wxFileName dstpath(path); if (path == _T("")) path = origfile.GetPath();
if (!dstpath.IsAbsolute()) path = AegisubApp::folderName + path; wxFileName dstpath(path);
path += _T("/"); if (!dstpath.IsAbsolute()) path = AegisubApp::folderName + path;
dstpath.Assign(path); path += _T("/");
if (!dstpath.DirExists()) wxMkdir(path); dstpath.Assign(path);
if (!dstpath.DirExists()) wxMkdir(path);
// Save // Save
wxString backup = path + origfile.GetName() + _T(".AUTOSAVE.") + origfile.GetExt(); wxString backup = path + origfile.GetName() + _T(".AUTOSAVE.") + origfile.GetExt();
AssFile::top->Save(backup,false,false); AssFile::top->Save(backup,false,false);
// Set status bar // Set status bar
StatusTimeout(_("File backup saved as \"") + backup + _T("\".")); StatusTimeout(_("File backup saved as \"") + backup + _T("\"."));
}
}
catch (wxString err) {
StatusTimeout(_T("Exception when attempting to autosave file: ") + err);
}
catch (wchar_t *err) {
StatusTimeout(_T("Exception when attempting to autosave file: ") + wxString(err));
}
catch (...) {
StatusTimeout(_T("Unhandled exception when attempting to autosave file."));
} }
} }
@ -1106,7 +1117,7 @@ void FrameMain::OnToggleTags(wxCommandEvent &event) {
Options.Save(); Options.Save();
// Refresh grid // Refresh grid
SubsBox->LoadFromAss(NULL,true,true); SubsBox->Refresh(false);
} }