mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
🎨 Fix threading issue
This commit is contained in:
@ -455,7 +455,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.0;
|
MARKETING_VERSION = "3.0-prerelease";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -479,7 +479,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.0;
|
MARKETING_VERSION = "3.0-prerelease";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -76,35 +76,33 @@ class MainMenu: NSObject, NSWindowDelegate {
|
|||||||
Update the menu's contents, based on what's going on.
|
Update the menu's contents, based on what's going on.
|
||||||
*/
|
*/
|
||||||
public func update() {
|
public func update() {
|
||||||
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
|
// Update the menu item on the main thread
|
||||||
// Update the menu item on the main thread
|
DispatchQueue.main.async {
|
||||||
DispatchQueue.main.async {
|
// Create a new menu
|
||||||
// Create a new menu
|
let menu = StatusMenu()
|
||||||
let menu = StatusMenu()
|
|
||||||
|
// Add the PHP versions (or error messages)
|
||||||
// Add the PHP versions (or error messages)
|
menu.addPhpVersionMenuItems()
|
||||||
menu.addPhpVersionMenuItems()
|
menu.addItem(NSMenuItem.separator())
|
||||||
menu.addItem(NSMenuItem.separator())
|
|
||||||
|
// Add the possible actions
|
||||||
// Add the possible actions
|
menu.addPhpActionMenuItems()
|
||||||
menu.addPhpActionMenuItems()
|
menu.addItem(NSMenuItem.separator())
|
||||||
menu.addItem(NSMenuItem.separator())
|
|
||||||
|
// Add information about services & actions
|
||||||
// Add information about services & actions
|
menu.addPhpConfigurationMenuItems()
|
||||||
menu.addPhpConfigurationMenuItems()
|
menu.addItem(NSMenuItem.separator())
|
||||||
menu.addItem(NSMenuItem.separator())
|
|
||||||
|
// Add about & quit menu items
|
||||||
// Add about & quit menu items
|
menu.addItem(NSMenuItem(title: "mi_about".localized, action: #selector(self.openAbout), keyEquivalent: ""))
|
||||||
menu.addItem(NSMenuItem(title: "mi_about".localized, action: #selector(self.openAbout), keyEquivalent: ""))
|
menu.addItem(NSMenuItem(title: "mi_quit".localized, action: #selector(self.terminateApp), keyEquivalent: "q"))
|
||||||
menu.addItem(NSMenuItem(title: "mi_quit".localized, action: #selector(self.terminateApp), keyEquivalent: "q"))
|
|
||||||
|
// Make sure every item can be interacted with
|
||||||
// Make sure every item can be interacted with
|
menu.items.forEach({ (item) in
|
||||||
menu.items.forEach({ (item) in
|
item.target = self
|
||||||
item.target = self
|
})
|
||||||
})
|
|
||||||
|
self.statusItem.menu = menu
|
||||||
self.statusItem.menu = menu
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user