forked from PlayCover/PlayCover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
186 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// SettingsView.swift | ||
// PlayCover | ||
// | ||
// Created by Andrew Glaze on 7/16/22. | ||
// | ||
|
||
import SwiftUI | ||
import Sparkle | ||
|
||
struct PlayCoverSettingsView: View { | ||
@ObservedObject var updaterViewModel: UpdaterViewModel | ||
|
||
private enum Tabs: Hashable { | ||
case updates | ||
} | ||
|
||
var body: some View { | ||
TabView { | ||
UpdateSettings(updaterViewModel: updaterViewModel) | ||
.tabItem { | ||
Label("Updates", systemImage: "square.and.arrow.down") | ||
} | ||
.tag(Tabs.updates) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// UpdateSettings.swift | ||
// PlayCover | ||
// | ||
// Created by Andrew Glaze on 7/23/22. | ||
// | ||
|
||
import SwiftUI | ||
import Sparkle | ||
|
||
struct UpdateSettings: View { | ||
@ObservedObject var updaterViewModel: UpdaterViewModel | ||
@AppStorage("SUEnableAutomaticChecks") var autoUpdate = false | ||
@AppStorage("nightlyUpdates") var nightlyUpdates = false | ||
|
||
var body: some View { | ||
Form { | ||
Toggle("Automatically check for updates", isOn: $autoUpdate) | ||
Toggle("Check for nightly updates", isOn: $nightlyUpdates) | ||
Button("Check for updates now…") { | ||
updaterViewModel.checkForUpdates() | ||
} | ||
} | ||
.padding(20) | ||
.frame(width: 350, height: 100, alignment: .center) | ||
.onChange(of: autoUpdate) { value in | ||
updaterViewModel.automaticallyCheckForUpdates = value | ||
} | ||
.onChange(of: nightlyUpdates) { _ in | ||
updaterViewModel.toggleAllowedChannels() | ||
} | ||
} | ||
} |
Oops, something went wrong.