1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-08 04:20:07 +02:00

👌 Whitespace, remove print()

This commit is contained in:
2021-03-19 15:50:43 +01:00
parent 0ad6e5cb1c
commit 7733c90206

View File

@ -26,6 +26,7 @@ class MainMenu: NSObject, NSWindowDelegate {
func startup() { func startup() {
// Start with the icon // Start with the icon
self.setStatusBar(image: NSImage(named: NSImage.Name("StatusBarIcon"))!) self.setStatusBar(image: NSImage(named: NSImage.Name("StatusBarIcon"))!)
// Perform environment boot checks // Perform environment boot checks
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
Startup().checkEnvironment(success: { self.onEnvironmentPass() }, Startup().checkEnvironment(success: { self.onEnvironmentPass() },
@ -40,6 +41,7 @@ class MainMenu: NSObject, NSWindowDelegate {
private func onEnvironmentPass() { private func onEnvironmentPass() {
App.shared.availablePhpVersions = Actions.detectPhpVersions() App.shared.availablePhpVersions = Actions.detectPhpVersions()
self.updatePhpVersionInStatusBar() self.updatePhpVersionInStatusBar()
// Schedule a request to fetch the PHP version every 60 seconds // Schedule a request to fetch the PHP version every 60 seconds
DispatchQueue.main.async { DispatchQueue.main.async {
App.shared.timer = Timer.scheduledTimer( App.shared.timer = Timer.scheduledTimer(
@ -144,6 +146,7 @@ class MainMenu: NSObject, NSWindowDelegate {
self.update() self.update()
execute() execute()
App.shared.busy = false App.shared.busy = false
DispatchQueue.main.async { DispatchQueue.main.async {
self.updatePhpVersionInStatusBar() self.updatePhpVersionInStatusBar()
self.update() self.update()
@ -204,8 +207,6 @@ class MainMenu: NSObject, NSWindowDelegate {
@objc func toggleExtension(sender: ExtensionMenuItem) { @objc func toggleExtension(sender: ExtensionMenuItem) {
self.waitAndExecute { self.waitAndExecute {
// Toggle that extension
print("Toggling extension '\(sender.phpExtension!.name)'")
sender.phpExtension?.toggle() sender.phpExtension?.toggle()
} }
} }
@ -222,6 +223,7 @@ class MainMenu: NSObject, NSWindowDelegate {
@objc func forceRestartLatestPhp() { @objc func forceRestartLatestPhp() {
// Tell the user the switch is about to occur // Tell the user the switch is about to occur
Alert.notify(message: "alert.force_reload.title".localized, info: "alert.force_reload.info".localized) Alert.notify(message: "alert.force_reload.title".localized, info: "alert.force_reload.info".localized)
// Start switching // Start switching
self.waitAndExecute { self.waitAndExecute {
Actions.fixMyPhp() Actions.fixMyPhp()
@ -271,6 +273,7 @@ class MainMenu: NSObject, NSWindowDelegate {
DispatchQueue.main.async { DispatchQueue.main.async {
self.updatePhpVersionInStatusBar() self.updatePhpVersionInStatusBar()
self.update() self.update()
// Send a notification that the switch has been completed // Send a notification that the switch has been completed
LocalNotification.send( LocalNotification.send(
title: String(format: "notification.version_changed_title".localized, sender.version), title: String(format: "notification.version_changed_title".localized, sender.version),