feat: add option to disable system-widget updates for users experiencing ongoing chronod issues (#2733)

This commit is contained in:
Serhiy Mytrovtsiy
2025-12-03 19:02:40 +01:00
parent 3cad4f49dd
commit 1b1a338d7d
6 changed files with 71 additions and 27 deletions

View File

@@ -39,6 +39,11 @@ class ApplicationSettings: NSStackView {
set { Store.shared.set(key: "CombinedModules_popup", value: newValue) }
}
private var systemWidgetsUpdatesState: Bool {
get { Store.shared.bool(key: "systemWidgetsUpdates_state", defaultValue: true) }
set { Store.shared.set(key: "systemWidgetsUpdates_state", value: newValue) }
}
private var updateSelector: NSPopUpButton?
private var startAtLoginBtn: NSSwitch?
private var remoteControlBtn: NSSwitch?
@@ -97,6 +102,13 @@ class ApplicationSettings: NSStackView {
PreferencesRow(localizedString("Start at login"), component: self.startAtLoginBtn!)
]))
scrollView.stackView.addArrangedSubview(PreferencesSection([
PreferencesRow(localizedString("System widgets updates"), component: switchView(
action: #selector(self.toggleSystemWidgetsUpdatesState),
state: self.systemWidgetsUpdatesState
))
]))
self.combinedModulesView = PreferencesSection([
PreferencesRow(localizedString("Combined modules"), component: switchView(
action: #selector(self.toggleCombinedModules),
@@ -470,6 +482,10 @@ class ApplicationSettings: NSStackView {
}
}
}
@objc private func toggleSystemWidgetsUpdatesState(_ sender: NSButton) {
self.systemWidgetsUpdatesState = sender.state == NSControl.StateValue.on
}
}
private class ModuleSelectorView: NSStackView {