Add "auto save non-read only profiles" preference (silent)

New global setting in Preferences -> General, right after "Browse for
profiles folder": a list "Auto-save non-read-only profiles" with Never /
Every 2 / 5 / 10 / 15 / 20 / 30 minutes. When enabled, RemSound periodically
saves the current profile, but ONLY if it is a real saved profile, is NOT
read-only, and has unsaved changes -- and it saves SILENTLY (no save cue,
no confirmation), so it never interrupts the user.

- AppConfig.AutoSaveNonReadOnlyMinutes (machine-wide, 0 = Never = default).
- SaveProfileTo gains a playCue flag; auto-save passes playCue: false.
- MainForm autoSaveTimer + ApplyAutoSaveTimer + ShouldAutoSave guard,
  re-applied live when the setting changes in Preferences.
- New self-test "Auto-save non-read-only profiles": options list, AppConfig
  persistence, the guard (read-only / blank / unchanged all skipped), and the
  timer turning on/off. Gate 28/28.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ednunp
2026-07-13 23:32:17 +01:00
co-authored by Claude Opus 4.8
parent 71fb065233
commit 26903950f7
4 changed files with 170 additions and 5 deletions
+5
View File
@@ -244,6 +244,11 @@ public sealed class AppConfig
/// Startup behaviour dialog. Null = always show the picker (legacy behaviour).</summary>
public string? StartWithProfileTitle { get; set; }
/// <summary>How often (in minutes) RemSound auto-saves the current profile if it's NOT read-only and
/// has unsaved changes. 0 = never (the default). Set in Preferences → General. The auto-save is
/// SILENT — it never plays the save cue or shows the confirmation. Machine-wide.</summary>
public int AutoSaveNonReadOnlyMinutes { get; set; }
// The send-only service's profile + settings live in the machine-wide RemSound.Core.ServiceStore
// (ProgramData), NOT here — AppConfig is per-user, but the service runs as SYSTEM and needs the same
// file the user wrote. (ServiceProfileName / ServiceLoggingEnabled were moved there 2026-07-12.)