diff --git a/Stats/AppDelegate.swift b/Stats/AppDelegate.swift index d72b124b..9f904c82 100755 --- a/Stats/AppDelegate.swift +++ b/Stats/AppDelegate.swift @@ -9,16 +9,10 @@ import Cocoa import ServiceManagement -extension Notification.Name { - static let killLauncher = Notification.Name("killLauncher") -} - let modules: Observable<[Module]> = Observable([CPU(), Memory(), Disk(), Battery(), Network()]) let updater = macAppUpdater(user: "exelban", repo: "stats") let menu = NSPopover() -let appStoreMode: Bool = false - @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { let defaults = UserDefaults.standard @@ -36,21 +30,12 @@ class AppDelegate: NSObject, NSApplicationDelegate { _ = MenuBar(menuBarItem, menuBarButton: menuBarButton) - let launcherAppId = "eu.exelban.StatsLauncher" - let runningApps = NSWorkspace.shared.runningApplications - let isRunning = !runningApps.filter { $0.bundleIdentifier == launcherAppId }.isEmpty - - if defaults.object(forKey: "runAtLogin") == nil { - SMLoginItemSetEnabled(launcherAppId as CFString, true) - self.defaults.set(true, forKey: "runAtLogin") - } - if defaults.object(forKey: "dockIcon") != nil { let dockIconStatus = defaults.bool(forKey: "dockIcon") ? NSApplication.ActivationPolicy.regular : NSApplication.ActivationPolicy.accessory NSApp.setActivationPolicy(dockIconStatus) } - if !appStoreMode && defaults.object(forKey: "checkUpdatesOnLogin") == nil || defaults.bool(forKey: "checkUpdatesOnLogin") { + if defaults.object(forKey: "checkUpdatesOnLogin") == nil || defaults.bool(forKey: "checkUpdatesOnLogin") { updater.check() { result, error in if error != nil && error as! String == "No internet connection" { return @@ -71,10 +56,6 @@ class AppDelegate: NSObject, NSApplicationDelegate { } } } - - if isRunning { - DistributedNotificationCenter.default().post(name: .killLauncher, object: Bundle.main.bundleIdentifier!) - } } func applicationWillTerminate(_ aNotification: Notification) { diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index 589d68b1..77007f08 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.3.0 + 1.2.12 CFBundleVersion 1 LSApplicationCategoryType diff --git a/Stats/Views/MainViewController.swift b/Stats/Views/MainViewController.swift index 4232c072..2a9309c9 100644 --- a/Stats/Views/MainViewController.swift +++ b/Stats/Views/MainViewController.swift @@ -121,9 +121,7 @@ class MainViewController: NSViewController { let aboutMenu = NSMenuItem(title: "About Stats", action: #selector(openAbout), keyEquivalent: "") aboutMenu.target = self - if !appStoreMode { - menu.addItem(updateMenu) - } + menu.addItem(updateMenu) menu.addItem(aboutMenu) menu.addItem(NSMenuItem(title: "Quit Stats", action: #selector(NSApplication.terminate(_:)), keyEquivalent: ""))