mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: add option to disable system-widget updates for users experiencing ongoing chronod issues (#2733)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user