mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: removed all logic from the Telemetry plugin since it's not used anyway. The toggle leaves for now since I have not decided what to do with that.
This commit is contained in:
@@ -33,7 +33,6 @@ var modules: [Module] = [
|
||||
Bluetooth(),
|
||||
Clock()
|
||||
]
|
||||
let telemetry: Telemetry = Telemetry(&modules)
|
||||
|
||||
@main
|
||||
class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDelegate {
|
||||
|
||||
@@ -83,7 +83,7 @@ class ApplicationSettings: NSStackView {
|
||||
)
|
||||
self.telemetryBtn = switchView(
|
||||
action: #selector(self.toggleTelemetry),
|
||||
state: telemetry.isEnabled
|
||||
state: Telemetry.shared.isEnabled
|
||||
)
|
||||
|
||||
scrollView.stackView.addArrangedSubview(PreferencesSection([
|
||||
@@ -182,7 +182,7 @@ class ApplicationSettings: NSStackView {
|
||||
|
||||
internal func viewWillAppear() {
|
||||
self.startAtLoginBtn?.state = LaunchAtLogin.isEnabled ? .on : .off
|
||||
self.telemetryBtn?.state = telemetry.isEnabled ? .on : .off
|
||||
self.telemetryBtn?.state = Telemetry.shared.isEnabled ? .on : .off
|
||||
|
||||
var idx = self.updateSelector?.indexOfSelectedItem ?? 0
|
||||
if let items = self.updateSelector?.menu?.items {
|
||||
@@ -296,7 +296,7 @@ class ApplicationSettings: NSStackView {
|
||||
}
|
||||
|
||||
@objc private func toggleTelemetry(_ sender: NSButton) {
|
||||
telemetry.isEnabled = sender.state == NSControl.StateValue.on
|
||||
Telemetry.shared.isEnabled = sender.state == NSControl.StateValue.on
|
||||
}
|
||||
|
||||
@objc private func toggleCombinedModules(_ sender: NSButton) {
|
||||
|
||||
@@ -400,12 +400,12 @@ private class SetupView_4: NSStackView {
|
||||
|
||||
container.addRow(with: [self.option(
|
||||
tag: 1,
|
||||
state: telemetry.isEnabled,
|
||||
state: Telemetry.shared.isEnabled,
|
||||
text: localizedString("Share anonymous telemetry data")
|
||||
)])
|
||||
container.addRow(with: [self.option(
|
||||
tag: 2,
|
||||
state: !telemetry.isEnabled,
|
||||
state: !Telemetry.shared.isEnabled,
|
||||
text: localizedString("Do not share anonymous telemetry data")
|
||||
)])
|
||||
|
||||
@@ -427,7 +427,7 @@ private class SetupView_4: NSStackView {
|
||||
}
|
||||
|
||||
@objc private func toggle(_ sender: NSButton) {
|
||||
telemetry.isEnabled = sender.tag == 1
|
||||
Telemetry.shared.isEnabled = sender.tag == 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user