mirror of
https://github.com/bitgapp/eqMac.git
synced 2024-12-03 07:31:45 +03:00
started working on ability for user to update the app before it starts
This commit is contained in:
parent
3f61b0d8ea
commit
c59eaa8fe4
@ -9,11 +9,28 @@
|
||||
import Cocoa
|
||||
import SwiftyJSON
|
||||
import ServiceManagement
|
||||
import Sparkle
|
||||
import EmitterKit
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
class AppDelegate: NSObject, NSApplicationDelegate, SUUpdaterDelegate {
|
||||
var updater = SUUpdater(for: Bundle.main)!
|
||||
var updateFound = Event<Void>()
|
||||
var updateNotFound = Event<Void>()
|
||||
var updateCanceled = Event<Void>()
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
Application.start()
|
||||
updater.delegate = self
|
||||
updateFound.once { _ in
|
||||
self.updateCanceled.once { _ in
|
||||
Application.start()
|
||||
}
|
||||
}
|
||||
|
||||
updateNotFound.once { _ in
|
||||
Application.start()
|
||||
}
|
||||
updater.checkForUpdatesInBackground()
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
@ -32,6 +49,30 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
func applicationDidBecomeActive(_ notification: Notification) {
|
||||
|
||||
}
|
||||
|
||||
func updaterDidNotFindUpdate(_ updater: SUUpdater) {
|
||||
updateNotFound.emit()
|
||||
}
|
||||
|
||||
func updater(_ updater: SUUpdater, didFindValidUpdate item: SUAppcastItem) {
|
||||
updateFound.emit()
|
||||
}
|
||||
|
||||
func updater(_ updater: SUUpdater, userDidSkipThisVersion item: SUAppcastItem) {
|
||||
updateCanceled.emit()
|
||||
}
|
||||
|
||||
func updater(_ updater: SUUpdater, didCancelInstallUpdateOnQuit item: SUAppcastItem) {
|
||||
updateCanceled.emit()
|
||||
}
|
||||
|
||||
func updater(_ updater: SUUpdater, didDismissUpdateAlertPermanently permanently: Bool, for item: SUAppcastItem) {
|
||||
// updateCanceled.emit()
|
||||
}
|
||||
|
||||
func userDidCancelDownload(_ updater: SUUpdater) {
|
||||
updateCanceled.emit()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,8 @@
|
||||
|
||||
import Cocoa
|
||||
import AMCoreAudio
|
||||
import EventKit
|
||||
//import EventKit
|
||||
import AVFoundation
|
||||
//import AudioKit
|
||||
import Foundation
|
||||
|
||||
class Engine {
|
||||
|
@ -1042,7 +1042,7 @@
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 0.1.1;
|
||||
CURRENT_PROJECT_VERSION = 0.1.0;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = JZA6C97KJA;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
@ -1102,7 +1102,7 @@
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 0.1.1;
|
||||
CURRENT_PROJECT_VERSION = 0.1.0;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = JZA6C97KJA;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
|
Loading…
Reference in New Issue
Block a user