Phase 3 of the Wine/Proton stage (decisions 6, 9, 13, 19 in docs/testing/wine-proton.md): a global-only Wine tab modeled on the Pronunciation page, with the controller-only checkbox and a typed editable program list. Wine values flow through the preferences protocol so a global Apply reaches the live Wine settings from Phase 2 with no reader restart. Entries are validated as edited and named in-tab, blocking Apply until fixed; case-insensitive duplicates collapse. Per-application preferences expose no Wine editing and an app-scoped Apply cannot change the governing list.
62 lines
1.7 KiB
Go
62 lines
1.7 KiB
Go
// Copyright (c) 2026 Storm Dragon
|
|
// Authors: Storm Dragon, Angus Kola
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package preferences
|
|
|
|
func (session *uiSession) setValues(values Values) {
|
|
// The Wine page exists only in global preferences. Application
|
|
// preferences retain the values their base carries and submit them
|
|
// unchanged, so they are never a Wine editing surface.
|
|
session.wine = cloneWineSettings(values.Wine)
|
|
if session.wineEditable {
|
|
setWineValues(values.Wine)
|
|
}
|
|
setPronunciations(values.Pronunciations)
|
|
setTextAttributes(values.TextAttributes)
|
|
setOCRValues(values.OCR)
|
|
session.set_general_values(values)
|
|
set_sound_checks(values)
|
|
set_speech_support(values)
|
|
session.set_braille_values(values)
|
|
session.set_sound_values(values)
|
|
session.setEchoVoice(values)
|
|
session.setSpeechVoice(values)
|
|
set_echo_checks(values)
|
|
set_speech_presentation(values)
|
|
}
|
|
|
|
func (session *uiSession) getValues() (Values, error) {
|
|
var values Values
|
|
var err error
|
|
if session.wineEditable {
|
|
if values.Wine, err = getWineValues(); err != nil {
|
|
return values, err
|
|
}
|
|
} else {
|
|
values.Wine = cloneWineSettings(session.wine)
|
|
}
|
|
if values.Pronunciations, err = getPronunciations(); err != nil {
|
|
return values, err
|
|
}
|
|
values.TextAttributes = getTextAttributes()
|
|
values.OCR = getOCRValues()
|
|
if err := session.get_general_values(&values); err != nil {
|
|
return values, err
|
|
}
|
|
get_sound_checks(&values)
|
|
get_speech_support(&values)
|
|
if err := session.get_braille_values(&values); err != nil {
|
|
return values, err
|
|
}
|
|
if err := session.get_sound_values(&values); err != nil {
|
|
return values, err
|
|
}
|
|
get_echo_checks(&values)
|
|
getReading(&values)
|
|
if err := session.get_speech_values(&values); err != nil {
|
|
return values, err
|
|
}
|
|
return values, nil
|
|
}
|