diff --git a/PHP Monitor.xcodeproj/project.pbxproj b/PHP Monitor.xcodeproj/project.pbxproj index c1fa72d..db38866 100644 --- a/PHP Monitor.xcodeproj/project.pbxproj +++ b/PHP Monitor.xcodeproj/project.pbxproj @@ -793,7 +793,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 125; + CURRENT_PROJECT_VERSION = 130; DEVELOPMENT_TEAM = 8M54J5J787; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = phpmon/Info.plist; @@ -802,7 +802,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = "4.1-rc2"; + MARKETING_VERSION = "4.1-rc3"; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -818,7 +818,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 125; + CURRENT_PROJECT_VERSION = 130; DEVELOPMENT_TEAM = 8M54J5J787; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = phpmon/Info.plist; @@ -827,7 +827,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = "4.1-rc2"; + MARKETING_VERSION = "4.1-rc3"; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/phpmon/Domain/Core/App+GlobalHotkey.swift b/phpmon/Domain/Core/App+GlobalHotkey.swift index f1b730f..8f4f54c 100644 --- a/phpmon/Domain/Core/App+GlobalHotkey.swift +++ b/phpmon/Domain/Core/App+GlobalHotkey.swift @@ -20,7 +20,7 @@ extension App { func loadGlobalHotkey() { // Make sure we can retrieve the hotkey from preferences guard let hotkey = Preferences.preferences[.globalHotkey] as? String else { - print("No global hotkey loaded") + print("No global hotkey was saved in preferences. None set.") return } diff --git a/phpmon/Domain/Core/App.swift b/phpmon/Domain/Core/App.swift index be5e89e..73ec015 100644 --- a/phpmon/Domain/Core/App.swift +++ b/phpmon/Domain/Core/App.swift @@ -32,13 +32,6 @@ class App { return App.shared.busy } - // MARK: - Initializer - - /** When the app boots up, this code will run even before the start-up checks. */ - init() { - loadGlobalHotkey() - } - // MARK: Variables /** The list of preferences that are currently active. */ diff --git a/phpmon/Domain/Core/AppDelegate+Notifications.swift b/phpmon/Domain/Core/AppDelegate+Notifications.swift index f0af76c..3feff20 100644 --- a/phpmon/Domain/Core/AppDelegate+Notifications.swift +++ b/phpmon/Domain/Core/AppDelegate+Notifications.swift @@ -17,9 +17,7 @@ extension AppDelegate { let notificationCenter = UNUserNotificationCenter.current() notificationCenter.delegate = self notificationCenter.requestAuthorization(options: [.alert], completionHandler: { granted, error in - if granted { - print("PHP Monitor has permission to show notifications.") - } else { + if !granted { print("PHP Monitor does not have permission to show notifications.") } if let error = error { diff --git a/phpmon/Domain/Integrations/Valet/Valet.swift b/phpmon/Domain/Integrations/Valet/Valet.swift index 18efb33..0759406 100644 --- a/phpmon/Domain/Integrations/Valet/Valet.swift +++ b/phpmon/Domain/Integrations/Valet/Valet.swift @@ -33,6 +33,10 @@ class Valet { from: try! String(contentsOf: file, encoding: .utf8).data(using: .utf8)! ) + self.sites = [] + } + + public func startPreloadingSites() { if self.sites.count <= 10 { // Preload the sites and their drivers print("Fewer than or 11 sites found, preloading list of sites...") diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift index f832ebe..4ce43c3 100644 --- a/phpmon/Domain/Menu/MainMenu.swift +++ b/phpmon/Domain/Menu/MainMenu.swift @@ -68,9 +68,13 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate { } print("Detected applications: \(appNames)") + // Load the global hotkey + App.shared.loadGlobalHotkey() + // Attempt to find out more info about Valet print("PHP Monitor has extracted the version number of Valet: \(Valet.shared.version)") Valet.shared.validateVersion() + Valet.shared.startPreloadingSites() print("PHP Monitor is ready to serve!") // Schedule a request to fetch the PHP version every 60 seconds diff --git a/phpmon/Domain/Terminal/Paths.swift b/phpmon/Domain/Terminal/Paths.swift index 7effea5..6ffe80a 100644 --- a/phpmon/Domain/Terminal/Paths.swift +++ b/phpmon/Domain/Terminal/Paths.swift @@ -33,8 +33,6 @@ class Paths { print("This usually means we're in trouble... (no Homebrew?)") baseDir = .usr } - - print("Homebrew directory: \(baseDir)") } // - MARK: Binaries