diff --git a/app/common/setting-definitions.js b/app/common/setting-definitions.js
index 4d56525..b7c0a4f 100644
--- a/app/common/setting-definitions.js
+++ b/app/common/setting-definitions.js
@@ -174,6 +174,12 @@ _VAL[_NAM.CFGS_FAVICON_SOURCE] = (v)=>{
return (( v === FAVICON_SITE || v === FAVICON_CHROME || v === FAVICON_DDG ) ? v : undefined);
};
+// #316. How often to autosave. Empty or <= 0 == don't autosave
+_NAM.CFGS_AUTOREMEMBER_MINUTES = 'autoremember-timer-minutes';
+_DEF[_NAM.CFGS_AUTOREMEMBER_MINUTES] = '';
+_VAL[_NAM.CFGS_AUTOREMEMBER_MINUTES] = _vint;
+
+
// }}}2
/// The default values for the configuration settings.
diff --git a/app/settings/manifest.js b/app/settings/manifest.js
index 7c8e478..90e9d9e 100644
--- a/app/settings/manifest.js
+++ b/app/settings/manifest.js
@@ -216,6 +216,15 @@ setting_definitions.push(
"type": "checkbox",
"label": future_i18n('Prompt for confirmation before closing or deleting a tab that is currently playing audio ()'),
},
+ {
+ "tab": future_i18n("Behaviour"),
+ "group": future_i18n("Autosave"),
+ "name": S.S_AUTOREMEMBER_MINUTES,
+ "type": "text",
+ "label": future_i18n('If this is an integer I >= 0, automatically '
+ + 'remember all open windows/tabs every I minutes. Refresh the '
+ + 'TabFern window to apply changes to this option.'),
+ },
// Appearance
{
diff --git a/app/win/main_tl.js b/app/win/main_tl.js
index 3b43a3d..270cda0 100644
--- a/app/win/main_tl.js
+++ b/app/win/main_tl.js
@@ -4301,6 +4301,14 @@ function addEventListeners(done)
done();
} //addEventListeners
+function startAutoRememberTimerIfRequested(done) {
+ const minutes = S.getInt(S.S_AUTOREMEMBER_MINUTES, 0);
+ if(minutes > 0) {
+ // TODO RESUME HERE --- start timer
+ }
+ done();
+} // startAutoRememberTimerIfRequested()
+
/// The last function to be called after all other initialization has
/// completed successfully.
function initTreeFinal(done)
@@ -4439,9 +4447,9 @@ function main()
})
.then(addOpenWindowsToTree)
.then(addEventListeners)
- .then(initTreeFinal)
+ .then(initTreeFinal) // This needs to be the last real init step
- .val(check_init_step_count)
+ .val(check_init_step_count) // This is a sanity check after initTreeFinal
// Stop the spinner, if it started
.val(()=>{
@@ -4450,6 +4458,8 @@ function main()
//clearTimeout(spin_timer);
})
+ .then(startAutoRememberTimerIfRequested)
+
.or((err)=>{
$(K.INIT_MSG_SEL).text(
$(K.INIT_MSG_SEL).text() + "\n" + err