Add autosave support
Closes #32 (closed), new step towards #3 (closed) after !108 (merged).
Description of the main features added, from commit:
"Add autosave support":
Any document open in a MousepadWindow is automatically saved when modified, in a temporary file located in g_get_user_data_dir()/Mousepad
and named autosave-N
where N is a unique id, with a delay of preferences.file.autosave-timer
seconds. Setting this parameter to 0 disables the feature.
When a document is regularly saved by the user, the temporary file associated with it is automatically deleted.
These automatic save and delete operations are asynchronous. The GApplication use count is used to ensure that they have time to finish correctly.
"Adapt settings to include new restore options" :
The following restore options are offered to the user:
- "never": Disables session restore and set
preferences.file.autosave-timer
to 0. This can be used for privacy purposes, since no more data is stored and all previous data are cleared. - "after a crash": This is the default: all the backup and restore machinery is in place, but it only has a visible effect in case of a problem. This is included in all the following choices.
- "unsaved documents": Unsaved documents are always restored, and the user is no longer asked for saving modified documents when quitting, i.e. when closing the last window or calling "app.quit". He is still asked for saving when closing a tab.
- "saved documents": Saved documents are always restored: this is the behavior before this MR when session restore is enabled.
- "always": This is the addition of the three previous choices.
Merge request reports
Activity
added 22 commits
-
1960c969...e7a61cde - 14 commits from branch
apps:master
- 857af62c - Group history initialization
- cf0c1aa0 - Adapt session save blocking
- 3f11bc7b - Split `mousepad_file_save()` into two parts
- 364e26a3 - Add autosave support
- 6a509b4d - Adapt session array format to include autosaved files
- fedb8cf3 - Adapt opening process to include autosaved files
- fdf45b43 - Adapt settings to include new restore capabilities
- 2d568411 - Add new restore capabilities
Toggle commit list-
1960c969...e7a61cde - 14 commits from branch
added 8 commits
- f661c0f6 - Group history initialization
- cc7b22bd - Adapt session save blocking
- de1a465b - Split `mousepad_file_save()` into two parts
- 06bc707a - Add autosave support
- 2ba197f2 - Adapt session array format to include autosaved files
- 9501ed48 - Adapt opening process to include autosaved files
- debd6764 - Adapt settings to include new restore capabilities
- 3471e91a - Add new restore capabilities
Toggle commit listadded 7 commits
- 96a4e5c4 - Add autosave support
- a30cb16e - Adapt session array format to include autosaved files
- 6210324c - Adapt opening process to include autosaved files
- fb24415c - Adapt settings to include new restore capabilities
- a70a8ff9 - Add new restore capabilities
- 3386a174 - Check for orphans after restore
- 5272e5e4 - Tests: Add some autosave tests along the way
Toggle commit listadded 11 commits
-
50aeef83 - 1 commit from branch
apps:master
- fc4c2dc5 - Group history initialization
- cf61fb66 - Adapt session save blocking
- 52a5819a - Split `mousepad_file_save()` into two parts
- 597f7ad3 - Add autosave support
- 42546df6 - Adapt session array format to include autosaved files
- 7a5a0cfb - Adapt opening process to include autosaved files
- 56951e0f - Adapt settings to include new restore capabilities
- ae2ebf3d - Add new restore capabilities
- dc545f6e - Check for orphans after restore
- 163a085c - Tests: Add some autosave tests along the way
Toggle commit list-
50aeef83 - 1 commit from branch
added 10 commits
- bf157988 - Group history initialization
- 73147460 - Adapt session save blocking
- 9ce2a254 - Split `mousepad_file_save()` into two parts
- 90ca6ce2 - Add autosave support
- 6b6b6de9 - Adapt session array format to include autosaved files
- c688a5d1 - Adapt opening procedure to include autosaved files
- 47c7e466 - Adapt settings to include new restore options
- 5de4bdf0 - Add new restore options
- adf75ed4 - Check for orphans after restore
- da0acf3f - Tests: Add some autosave tests along the way
Toggle commit listadded 13 commits
-
da0acf3f...405e08e2 - 3 commits from branch
apps:master
- 12443160 - Group history initialization
- 6baa515d - Adapt session save blocking
- 13b2c41c - Split `mousepad_file_save()` into two parts
- 26912f0b - Add autosave support
- e1f2f9f1 - Adapt session array format to include autosaved files
- a602787b - Adapt opening procedure to include autosaved files
- c8299237 - Adapt settings to include new restore options
- c9b0217b - Add new restore options
- 18e1fca9 - Check for orphans after restore
- 5d88639f - Tests: Add some autosave tests along the way
Toggle commit list-
da0acf3f...405e08e2 - 3 commits from branch
mentioned in merge request !110 (merged)
mentioned in commit 0bed4eeb
mentioned in commit e7c1da0c
mentioned in commit 095792db
mentioned in commit 96c03092
mentioned in commit 74ff987a
mentioned in commit d0113d1b