Files
cthulhu/internal/app/progress_settings.go
hjozwiak 9a10a15b68 Read Wine settings live at poll and spawn
Phase 2 of the Wine/Proton stage (decisions 3, 4, 16, 17, 19 in docs/testing/wine-proton.md): replace the Wine manager's startup snapshot with a live settings source read once per poll, so accepted global settings take effect with no reader restart. The source publishes only the active/global profile's Wine values; per-application profile switching never changes the governing list. A newly listed running program restarts its helper once in the same mode; removals and clearing the global switch never downgrade a running helper.
2026-11-02 01:15:33 -05:00

37 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"
}
profileNext := worker.retainProfileKeyboard(next, worker.activeApp)
if worker.activeApp != "" {
worker.appSettings[worker.activeApp] = profileNext
} else {
for application, settings := range worker.appSettings {
worker.appSettings[application] = config.RebaseApplicationSettings(worker.globalSettings, profileNext, settings)
}
worker.setGlobalSettings(profileNext)
}
worker.commit_settings(next)
worker.announceSpeechSetting(message)
}