mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-11 04:16:55 +00:00
macos: setup the standard sparkle driver for no-window scenario
If there are no windows, we use the standard sparkle driver to drive the standard window-based update UI.
This commit is contained in:
@@ -18,7 +18,9 @@ class UpdateController {
|
|||||||
/// Initialize a new update controller.
|
/// Initialize a new update controller.
|
||||||
init() {
|
init() {
|
||||||
let hostBundle = Bundle.main
|
let hostBundle = Bundle.main
|
||||||
self.userDriver = UpdateDriver(viewModel: .init())
|
self.userDriver = UpdateDriver(
|
||||||
|
viewModel: .init(),
|
||||||
|
hostBundle: hostBundle)
|
||||||
self.updater = SPUUpdater(
|
self.updater = SPUUpdater(
|
||||||
hostBundle: hostBundle,
|
hostBundle: hostBundle,
|
||||||
applicationBundle: hostBundle,
|
applicationBundle: hostBundle,
|
||||||
|
@@ -4,9 +4,11 @@ import Sparkle
|
|||||||
/// Implement the SPUUserDriver to modify our UpdateViewModel for custom presentation.
|
/// Implement the SPUUserDriver to modify our UpdateViewModel for custom presentation.
|
||||||
class UpdateDriver: NSObject, SPUUserDriver {
|
class UpdateDriver: NSObject, SPUUserDriver {
|
||||||
let viewModel: UpdateViewModel
|
let viewModel: UpdateViewModel
|
||||||
|
let standard: SPUStandardUserDriver
|
||||||
|
|
||||||
init(viewModel: UpdateViewModel) {
|
init(viewModel: UpdateViewModel, hostBundle: Bundle) {
|
||||||
self.viewModel = viewModel
|
self.viewModel = viewModel
|
||||||
|
self.standard = SPUStandardUserDriver(hostBundle: hostBundle, delegate: nil)
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user