Add "double-press to copy status" toggle + document the spoken-status changes (held for next release)
Preferences General-tab checkbox "Double-press the speak-status hotkey to copy the status to the clipboard" (Alt+C), machine-wide (AppConfig.DoublePressStatusToCopy), on by default. When off, a double press just reads the status again. SpeakStatusLine reads the flag only when the timing already qualifies, so a normal single press never touches the config. Manual's speak-status section now covers the line-by-line read, GB totals, and the double-press copy + its toggle. Held for the next release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
0fe9637356
commit
be32a060e7
@@ -3360,13 +3360,16 @@ public sealed class MainForm : Form
|
||||
private void SpeakStatusLine()
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
var doublePress = now - lastSpeakStatusPressUtc <= TimeSpan.FromMilliseconds(600);
|
||||
var withinDoublePressWindow = now - lastSpeakStatusPressUtc <= TimeSpan.FromMilliseconds(600);
|
||||
lastSpeakStatusPressUtc = now;
|
||||
|
||||
var text = statusReadout.Text;
|
||||
if (string.IsNullOrWhiteSpace(text)) text = "No status information available.";
|
||||
|
||||
if (doublePress)
|
||||
// Double press copies to the clipboard — but only if the user has left that on (Preferences →
|
||||
// General). Read the flag only when the timing already qualifies, so a normal single press never
|
||||
// touches the config file.
|
||||
if (withinDoublePressWindow && AppConfig.Load().DoublePressStatusToCopy)
|
||||
{
|
||||
// Second quick press: copy the status to the clipboard so it can be shared. Clipboard access
|
||||
// needs the UI thread — this runs on it (the hotkey is marshalled onto the owner form).
|
||||
|
||||
@@ -210,6 +210,15 @@ internal sealed class PreferencesDialog : Form
|
||||
AutoSize = true,
|
||||
};
|
||||
|
||||
// Screen-reader convenience (machine-wide, AppConfig). On by default. When off, a double press of
|
||||
// the speak-status hotkey just reads the status again rather than copying it.
|
||||
private readonly AccessibleCheckBox doublePressCopyBox = new()
|
||||
{
|
||||
Text = "Double-press the speak-status hotkey to copy the status to the clipboard (Alt+&C)",
|
||||
AccessibleName = "Double-press the speak-status hotkey to copy the status to the clipboard",
|
||||
AutoSize = true,
|
||||
};
|
||||
|
||||
// Update settings — startup-check checkbox, frequency dropdown, manual check button,
|
||||
// silent-install checkbox. Sits above the logging row so users meet it during setup; the
|
||||
// canonical order in the dialog is "things related to the program staying current" before
|
||||
@@ -566,6 +575,15 @@ internal sealed class PreferencesDialog : Form
|
||||
silentlyInstallUpdatesBox.Checked = cfgForLoad.SilentlyInstallUpdates;
|
||||
upnpEnabledBox.Checked = cfgForLoad.UpnpEnabled;
|
||||
|
||||
// Double-press-the-speak-status-hotkey-to-copy toggle (machine-wide, AppConfig). On by default.
|
||||
doublePressCopyBox.Checked = cfgForLoad.DoublePressStatusToCopy;
|
||||
doublePressCopyBox.CheckedChanged += (_, _) =>
|
||||
{
|
||||
var cfg = AppConfig.Load();
|
||||
cfg.DoublePressStatusToCopy = doublePressCopyBox.Checked;
|
||||
try { cfg.Save(); } catch { /* harmless — choice just won't survive a restart */ }
|
||||
};
|
||||
|
||||
checkForUpdatesOnStartupBox.CheckedChanged += (_, _) =>
|
||||
{
|
||||
var cfg = AppConfig.Load();
|
||||
@@ -798,7 +816,7 @@ internal sealed class PreferencesDialog : Form
|
||||
// is a field (declared above) so OnShown can focus it when the dialog opens. Logging is its
|
||||
// own tab (2026-06-19); the two logging controls moved off the General tab to lead it.
|
||||
tabs.TabPages.Add(MakeTab("General",
|
||||
browseProfilesFolderButton, acceptRemoteVolumeBox, upnpEnabledBox, upnpStatusLabel));
|
||||
browseProfilesFolderButton, acceptRemoteVolumeBox, upnpEnabledBox, upnpStatusLabel, doublePressCopyBox));
|
||||
tabs.TabPages.Add(MakeTab("Audio cues", cueGroup));
|
||||
tabs.TabPages.Add(MakeTab("Startup behaviour",
|
||||
startMinimisedBox, startWithUserBox, startWithProfileBox, startupListPanel));
|
||||
|
||||
@@ -196,6 +196,11 @@ public sealed class AppConfig
|
||||
public bool? UntickOthersWhenUsingDefaultOutput { get; set; }
|
||||
public bool? UntickOthersWhenUsingDefaultInput { get; set; }
|
||||
|
||||
/// <summary>If true, pressing the "speak status" global hotkey twice in quick succession copies the
|
||||
/// status text to the clipboard (instead of just reading it again). On by default; the user can turn
|
||||
/// it off on the Preferences General tab. Machine-wide; a screen-reader convenience (Andre's idea).</summary>
|
||||
public bool DoublePressStatusToCopy { get; set; } = true;
|
||||
|
||||
/// <summary>If non-null and a profile with this title exists, RemSound skips the
|
||||
/// startup profile picker and loads this profile directly. Combine with
|
||||
/// <see cref="StartMinimised"/> + the Windows auto-start registry entry
|
||||
|
||||
Reference in New Issue
Block a user