Added a "Auto Save on Every Change" option to config.dat (default false), that automatically saves the files whenever you change anything.

Originally committed to SVN as r555.
This commit is contained in:
Rodrigo Braz Monteiro 2006-11-30 23:27:59 +00:00
parent c69f347035
commit 72071301e4
4 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,7 @@ Please visit http://aegisub.net to download latest version
- Scrollbar in main subs grid didn't always allow scrolling through all the subs (jfs)
- You can now no longer create a style storage whose name is invalid as a filename, instead the illegal characters are replaced with a safe character and a warning is displayed (jfs)
o Previously those storages seemed to be created correctly, but were never written to disk and thus lost
- Added a "Auto Save on Every Change" option to config.dat (default false), that automatically saves the files whenever you change anything. (AMZ)
= 1.10 beta - 2006.08.07 ===========================

View File

@ -60,6 +60,7 @@ class AegisubFileDropTarget;
class FrameMain: public wxFrame {
friend class AegisubFileDropTarget;
friend class AegisubApp;
friend class SubtitlesGrid;
private:
int curMode;

View File

@ -236,6 +236,7 @@ void OptionsManager::LoadDefaults() {
SetBool(_T("Auto backup"),true);
SetInt(_T("Auto save every seconds"),60);
SetBool(_T("Auto save on every change"),false);
SetText(_T("Auto backup path"),_T("autoback"));
SetText(_T("Auto save path"),_T("autosave"));
SetText(_T("Auto recovery path"),_T("recovered"));

View File

@ -1283,6 +1283,13 @@ void SubtitlesGrid::CommitChanges(bool force) {
// Resume play
if (playing) video->Play();
}
// Autosave if option is enabled
if (Options.AsBool(_T("Auto Save on Every Change"))) {
if (ass->IsModified() && !ass->filename.IsEmpty()) parentFrame->SaveSubtitles(false);
}
// Update parent frame
parentFrame->UpdateTitle();
SetColumnWidths();
Refresh(false);