36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
// Copyright (c) 2026 Storm Dragon
|
|
// Authors: Storm Dragon, Angus Kola
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package app
|
|
|
|
import "git.stormux.org/storm/cthulhu/internal/config"
|
|
|
|
// The preferences worker owns shortcut changes, just like GUI changes.
|
|
// Follow NVDA+U's off -> speak -> beep -> both -> off order. Saving remains
|
|
// explicit; application profiles continue to inherit unchanged global values.
|
|
func (worker *preferencesWorker) cycle_progress_output() {
|
|
next := worker.settings
|
|
message := ""
|
|
switch next.ProgressBar.OutputMode {
|
|
case "both":
|
|
next.ProgressBar.OutputMode, message = "off", "No progress bar updates"
|
|
case "off":
|
|
next.ProgressBar.OutputMode, message = "speak", "Speak progress bar updates"
|
|
case "speak":
|
|
next.ProgressBar.OutputMode, message = "beep", "Beep for progress bar updates"
|
|
default:
|
|
next.ProgressBar.OutputMode, message = "both", "Beep and speak progress bar updates"
|
|
}
|
|
if worker.activeApp != "" {
|
|
worker.appSettings[worker.activeApp] = next
|
|
} else {
|
|
for application, settings := range worker.appSettings {
|
|
worker.appSettings[application] = config.RebaseApplicationSettings(worker.globalSettings, next, settings)
|
|
}
|
|
worker.globalSettings = next
|
|
}
|
|
worker.commit_settings(next)
|
|
worker.announceSpeechSetting(message)
|
|
}
|