-
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.
Merge branch 'main' into feature/github-actions
- Loading branch information
Showing
25 changed files
with
715 additions
and
207 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
18 changes: 18 additions & 0 deletions
18
Empusa.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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 |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import SwiftUI | ||
import Sparkle | ||
|
||
@main | ||
struct EmpusaApp: App { | ||
private let updaterController: SPUStandardUpdaterController = .init( | ||
startingUpdater: true, | ||
updaterDelegate: nil, | ||
userDriverDelegate: nil | ||
) | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
MainView( | ||
model: EmpusaModel() | ||
) | ||
.frame(width: 680, height: 400) | ||
.frame(width: 680, height: 420) | ||
} | ||
.windowResizability(.contentSize) | ||
.commands { | ||
CommandGroup(replacing: CommandGroupPlacement.newItem) {} | ||
CommandGroup(after: .appInfo) { | ||
CheckForUpdatesView(updater: updaterController.updater) | ||
} | ||
} | ||
} | ||
} |
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SUFeedURL</key> | ||
<string>https://empusa.pacotevicio.app/sparkle.xml</string> | ||
<key>SUPublicEDKey</key> | ||
<string>62os1l9hx8vk8noKLn706G/htYbpMlhOP2TTJQFa66w=</string> | ||
</dict> | ||
</plist> |
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,26 @@ | ||
import SwiftUI | ||
import Sparkle | ||
|
||
final class CheckForUpdatesViewModel: ObservableObject { | ||
@Published var canCheckForUpdates = false | ||
|
||
init(updater: SPUUpdater) { | ||
updater.publisher(for: \.canCheckForUpdates) | ||
.assign(to: &$canCheckForUpdates) | ||
} | ||
} | ||
|
||
struct CheckForUpdatesView: View { | ||
@ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel | ||
private let updater: SPUUpdater | ||
|
||
init(updater: SPUUpdater) { | ||
self.updater = updater | ||
self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater) | ||
} | ||
|
||
var body: some View { | ||
Button("Check for Updates...", action: updater.checkForUpdates) | ||
.disabled(!checkForUpdatesViewModel.canCheckForUpdates) | ||
} | ||
} |
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
Oops, something went wrong.