2020-06-29 15:04:50 +02:00
|
|
|
|
//
|
|
|
|
|
// AdvancedPreferencesView.swift
|
|
|
|
|
// macOS
|
|
|
|
|
//
|
|
|
|
|
// Created by Stuart Breckenridge on 27/6/20.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct AdvancedPreferencesView: View {
|
|
|
|
|
|
2020-08-05 14:06:44 +02:00
|
|
|
|
@StateObject private var preferences = AppDefaults.shared
|
2020-07-16 01:29:58 +02:00
|
|
|
|
@StateObject private var viewModel = AdvancedPreferencesModel()
|
2020-06-29 15:04:50 +02:00
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
Form {
|
|
|
|
|
Toggle("Check for app updates automatically", isOn: $preferences.checkForUpdatesAutomatically)
|
|
|
|
|
Toggle("Download Test Builds", isOn: $preferences.downloadTestBuilds)
|
2020-07-12 12:53:37 +02:00
|
|
|
|
Text("If you’re not sure, don't enable test builds. Test builds may have bugs, which may include crashing bugs and data loss.")
|
|
|
|
|
.foregroundColor(.secondary)
|
2020-06-29 15:04:50 +02:00
|
|
|
|
HStack {
|
|
|
|
|
Spacer()
|
2020-07-16 00:43:11 +02:00
|
|
|
|
Button("Check for Updates") {
|
|
|
|
|
appDelegate.softwareUpdater.checkForUpdates()
|
|
|
|
|
}
|
2020-06-29 15:04:50 +02:00
|
|
|
|
Spacer()
|
2020-07-16 01:02:55 +02:00
|
|
|
|
}
|
2020-06-29 15:04:50 +02:00
|
|
|
|
Toggle("Send Crash Logs Automatically", isOn: $preferences.sendCrashLogs)
|
2020-07-16 01:02:55 +02:00
|
|
|
|
Divider()
|
2020-06-29 15:04:50 +02:00
|
|
|
|
HStack {
|
|
|
|
|
Spacer()
|
2020-07-12 12:53:37 +02:00
|
|
|
|
Button("Privacy Policy", action: {
|
|
|
|
|
NSWorkspace.shared.open(URL(string: "https://ranchero.com/netnewswire/privacypolicy")!)
|
|
|
|
|
})
|
2020-06-29 15:04:50 +02:00
|
|
|
|
Spacer()
|
2020-07-16 01:02:55 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-16 01:29:58 +02:00
|
|
|
|
.onChange(of: preferences.downloadTestBuilds, perform: { _ in
|
|
|
|
|
viewModel.updateAppcast()
|
|
|
|
|
})
|
2020-07-16 01:02:55 +02:00
|
|
|
|
.frame(width: 400, alignment: .center)
|
|
|
|
|
.lineLimit(3)
|
2020-06-29 15:04:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|