Skip to content

Commit

Permalink
v2.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban committed Jul 19, 2020
1 parent 1d09a11 commit 7c8f0c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Stats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
26 changes: 13 additions & 13 deletions Stats/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Stats/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>32</string>
<string>33</string>
<key>Description</key>
<string>Simple macOS system monitor in your menu bar</string>
<key>LSApplicationCategoryType</key>
Expand Down

0 comments on commit 7c8f0c4

Please sign in to comment.