diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 7ba9666f..d4d36347 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -1703,7 +1703,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.1.11; + MARKETING_VERSION = 2.1.12; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1735,7 +1735,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.1.11; + MARKETING_VERSION = 2.1.12; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Stats/AppDelegate.swift b/Stats/AppDelegate.swift index 39195861..ae81a7f7 100755 --- a/Stats/AppDelegate.swift +++ b/Stats/AppDelegate.swift @@ -48,19 +48,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele os_log(.info, log: log, "Stats started in %.4f seconds", startingPoint.timeIntervalSinceNow * -1) } - func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) { - if let uri = notification.userInfo?["url"] as? String { - os_log(.debug, log: log, "Downloading new version of app...") - if let url = URL(string: uri) { - updater.download(url, doneHandler: { path in - updater.install(path: path) - }) - } - } - - NSUserNotificationCenter.default.removeDeliveredNotification(self.updateNotification) - } - func applicationWillTerminate(_ aNotification: Notification) { modules.forEach{ $0.terminate() } _ = smc.close() @@ -76,6 +63,19 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele return true } + func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) { + if let uri = notification.userInfo?["url"] as? String { + os_log(.debug, log: log, "Downloading new version of app...") + if let url = URL(string: uri) { + updater.download(url, doneHandler: { path in + updater.install(path: path) + }) + } + } + + NSUserNotificationCenter.default.removeDeliveredNotification(self.updateNotification) + } + @objc private func updateCron() { self.updateActivity.invalidate() self.updateActivity.repeats = true diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index e285b0b4..52a570ae 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 32 + 33 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType