Release v4.4: keyboard shortcuts are now machine-wide, not per-profile
Fixes issue #14: shortcuts were stored on each Profile, so one set on profile A didn't apply on profile B and seemed to vanish on switch. They now live in AppConfig (one set shared by every profile). RemSoundSettingsStore's Load*/Save* hotkey methods re-point to AppConfig (callers unchanged); the per-profile cache fields, profile load/save plumbing, and the HotkeySetting helper class are removed. Profile's HotkeyRecord fields stay only for back-compat deserialization. On upgrade, shortcuts reset to defaults (there's no single correct set to carry over since profiles could hold different/partial sets). A one-time startup notice tells upgraders to re-set them; fresh installs are silently marked done (nothing to reset). Manual, About changelog and RELEASE_NOTES updated; csproj <Version> 4.4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
32be3426e7
commit
8a1bc0c813
@@ -1380,6 +1380,8 @@ public sealed class MainForm : Form
|
||||
/// </summary>
|
||||
private void RunStartupNotices()
|
||||
{
|
||||
if (IsDisposed) return;
|
||||
MaybeShowKeyboardShortcutsGlobalNotice();
|
||||
if (IsDisposed) return;
|
||||
MaybeShowWhatsNewAfterUpdate();
|
||||
if (IsDisposed) return;
|
||||
@@ -1431,6 +1433,55 @@ public sealed class MainForm : Form
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>One-time notice (v4.4) telling upgraders that keyboard shortcuts have moved from
|
||||
/// per-profile to machine-wide storage (issue #14), so their shortcuts have reset to defaults and
|
||||
/// need re-setting. Shown once to anyone who ran an earlier version; on a brand-new install (which
|
||||
/// has nothing to reset) it's silently marked done and never shown. Must run BEFORE
|
||||
/// <see cref="MaybeShowWhatsNewAfterUpdate"/>, which overwrites the LastWhatsNewVersion we read to
|
||||
/// tell upgraders apart from fresh installs.</summary>
|
||||
private void MaybeShowKeyboardShortcutsGlobalNotice()
|
||||
{
|
||||
if (IsDisposed) return;
|
||||
AppConfig cfg;
|
||||
try { cfg = AppConfig.Load(); }
|
||||
catch { return; }
|
||||
if (cfg.KeyboardShortcutsGlobalNoticeShown) return;
|
||||
|
||||
// A non-empty LastWhatsNewVersion means a previous version has run on this machine — i.e. this
|
||||
// is an upgrade, so there were per-profile shortcuts that have now reset. A fresh install has it
|
||||
// empty (it's set later, by MaybeShowWhatsNewAfterUpdate) and has nothing to reset.
|
||||
var isUpgrade = !string.IsNullOrEmpty(cfg.LastWhatsNewVersion);
|
||||
if (isUpgrade)
|
||||
{
|
||||
logFile.Event("keyboard shortcuts: showing one-time 'now shared across profiles' notice");
|
||||
var page = new TaskDialogPage
|
||||
{
|
||||
Caption = "RemSound",
|
||||
Heading = "Your keyboard shortcuts are now shared across profiles",
|
||||
Text = "Keyboard shortcuts used to be saved separately for each profile, so a shortcut you set on one "
|
||||
+ "profile wouldn't work on another. From this version they're shared across all your profiles "
|
||||
+ "instead — one set for the whole app, which our users have requested.\n\n"
|
||||
+ "Because of this change, your shortcuts have started fresh at their defaults. If you'd set up any "
|
||||
+ "shortcuts of your own, please set them again in Options → Keyboard shortcuts (Ctrl+K). You only "
|
||||
+ "need to do this once — from now on they'll stay put whatever profile you're on.",
|
||||
Icon = TaskDialogIcon.Information,
|
||||
Buttons = { TaskDialogButton.OK },
|
||||
AllowCancel = true,
|
||||
};
|
||||
try { ForegroundDialog.Show(owner => TaskDialog.ShowDialog(owner, page)); }
|
||||
catch (Exception ex) { logFile.Event($"keyboard shortcuts notice failed: {ex.GetType().Name}: {ex.Message}"); }
|
||||
}
|
||||
|
||||
// Mark done either way (shown to upgraders, silently to fresh installs) so it's strictly one-time.
|
||||
try
|
||||
{
|
||||
var fresh = AppConfig.Load();
|
||||
fresh.KeyboardShortcutsGlobalNoticeShown = true;
|
||||
fresh.Save();
|
||||
}
|
||||
catch { /* harmless — at worst the notice shows again next launch */ }
|
||||
}
|
||||
|
||||
/// <summary>If the user opted in (<see cref="AppConfig.ShowWhatsNewAfterUpdate"/>) and the
|
||||
/// running version changed since the last launch we recorded, open the About box once so
|
||||
/// they see what changed in the update just installed. Always records the current version
|
||||
|
||||
Reference in New Issue
Block a user