diff --git a/core/changelog.txt b/core/changelog.txt index e27f23f4f..1f3d705e3 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -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 =========================== diff --git a/core/frame_main.h b/core/frame_main.h index f3d4bae6e..beed9d701 100644 --- a/core/frame_main.h +++ b/core/frame_main.h @@ -60,6 +60,7 @@ class AegisubFileDropTarget; class FrameMain: public wxFrame { friend class AegisubFileDropTarget; friend class AegisubApp; + friend class SubtitlesGrid; private: int curMode; diff --git a/core/options.cpp b/core/options.cpp index 7b8c26fb9..59a955837 100644 --- a/core/options.cpp +++ b/core/options.cpp @@ -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")); diff --git a/core/subs_grid.cpp b/core/subs_grid.cpp index 88b666b18..976acddf6 100644 --- a/core/subs_grid.cpp +++ b/core/subs_grid.cpp @@ -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);