feat(updates): 使用 Sparkle 从发布 ZIP 下载并重启更新
This commit is contained in:
@@ -19,6 +19,7 @@ import notify
|
||||
private let awake = KeepAwakeService()
|
||||
private let presentation = SettingsPresentation()
|
||||
private let updates = ReleaseUpdates()
|
||||
private lazy var updater = SparkleUpdater(updates: updates)
|
||||
private let appearance = AppearancePreferences()
|
||||
private let menuBarPreferences = MenuBarPreferences()
|
||||
private let language = LanguagePreferences()
|
||||
@@ -75,7 +76,7 @@ import notify
|
||||
MenuPanelView(metrics: self.metrics, preferences: self.appearance, keepAwake: self.awake, updates: self.updates,
|
||||
presentation: panel, onOpenSettings: { [weak self] in
|
||||
self?.settingsCommand()
|
||||
}, onOpenAbout: { [weak self] in self?.aboutCommand() }, onPreferredHeight: { [weak self] height in
|
||||
}, onPreferredHeight: { [weak self] height in
|
||||
self?.menuBar?.setPreferredContentHeight(height)
|
||||
})
|
||||
}
|
||||
@@ -110,7 +111,7 @@ import notify
|
||||
NSApp.mainMenu = root
|
||||
}
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) { updates.start() }
|
||||
func applicationDidFinishLaunching(_ notification: Notification) { updater.start() }
|
||||
|
||||
@objc private func settingsCommand() { showSettings() }
|
||||
@objc private func aboutCommand() { showSettings(.about) }
|
||||
@@ -127,7 +128,6 @@ import notify
|
||||
workspaceTokens.forEach(NSWorkspace.shared.notificationCenter.removeObserver)
|
||||
workspaceTokens.removeAll()
|
||||
menuBar?.shutdown()
|
||||
updates.stop()
|
||||
awake.disable()
|
||||
menuBar = nil
|
||||
openSettingsAction = nil
|
||||
|
||||
Reference in New Issue
Block a user