mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-10 21:10:08 +02:00
🐛 Various bugfixes
- Fixes issue with `scanApps` being non-optional in custom configuration - Fixes issue with position of separator if Xdebug is not detected - Ensure that `isRunningSwiftUIPreview` modifier always return false for debug builds
This commit is contained in:
@@ -155,11 +155,11 @@ extension MainMenu {
|
|||||||
|
|
||||||
App.shared.detectedApplications = Application.detectPresetApplications()
|
App.shared.detectedApplications = Application.detectPresetApplications()
|
||||||
|
|
||||||
let customApps = Preferences.custom.scanApps.map { appName in
|
let customApps = Preferences.custom.scanApps?.map { appName in
|
||||||
return Application(appName, .user_supplied)
|
return Application(appName, .user_supplied)
|
||||||
}.filter { app in
|
}.filter { app in
|
||||||
return app.isInstalled()
|
return app.isInstalled()
|
||||||
}
|
} ?? []
|
||||||
|
|
||||||
App.shared.detectedApplications.append(contentsOf: customApps)
|
App.shared.detectedApplications.append(contentsOf: customApps)
|
||||||
|
|
||||||
|
@@ -216,14 +216,14 @@ extension StatusMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addItems([
|
addItems([
|
||||||
NSMenuItem.separator(),
|
|
||||||
NSMenuItem(title: "mi_xdebug_mode".localized, submenu: [
|
NSMenuItem(title: "mi_xdebug_mode".localized, submenu: [
|
||||||
HeaderView.asMenuItem(text: "mi_xdebug_available_modes".localized)
|
HeaderView.asMenuItem(text: "mi_xdebug_available_modes".localized)
|
||||||
] + Xdebug.asMenuItems() + [
|
] + Xdebug.asMenuItems() + [
|
||||||
HeaderView.asMenuItem(text: "mi_xdebug_actions".localized),
|
HeaderView.asMenuItem(text: "mi_xdebug_actions".localized),
|
||||||
NSMenuItem(title: "mi_xdebug_disable_all".localized,
|
NSMenuItem(title: "mi_xdebug_disable_all".localized,
|
||||||
action: #selector(MainMenu.disableAllXdebugModes))
|
action: #selector(MainMenu.disableAllXdebugModes))
|
||||||
], target: MainMenu.shared)
|
], target: MainMenu.shared),
|
||||||
|
NSMenuItem.separator()
|
||||||
], target: MainMenu.shared)
|
], target: MainMenu.shared)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,8 +48,9 @@ class StatusMenu: NSMenu {
|
|||||||
|
|
||||||
if Preferences.isEnabled(.displayExtensions) {
|
if Preferences.isEnabled(.displayExtensions) {
|
||||||
addExtensionsMenuItems()
|
addExtensionsMenuItems()
|
||||||
addXdebugMenuItem()
|
|
||||||
NSMenuItem.separator()
|
NSMenuItem.separator()
|
||||||
|
|
||||||
|
addXdebugMenuItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
addPhpDoctorMenuItem()
|
addPhpDoctorMenuItem()
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
struct CustomPrefs: Decodable {
|
struct CustomPrefs: Decodable {
|
||||||
let scanApps: [String]
|
let scanApps: [String]?
|
||||||
let presets: [Preset]?
|
let presets: [Preset]?
|
||||||
let services: [String]?
|
let services: [String]?
|
||||||
let environmentVariables: [String: String]?
|
let environmentVariables: [String: String]?
|
||||||
|
@@ -10,8 +10,13 @@ import Foundation
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
var isRunningSwiftUIPreview: Bool {
|
var isRunningSwiftUIPreview: Bool {
|
||||||
return ProcessInfo.processInfo
|
#if DEBUG
|
||||||
.environment["XCODE_RUNNING_FOR_PREVIEWS"] != nil
|
// If running SwiftUI *and* when debugging
|
||||||
|
return ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] != nil
|
||||||
|
#else
|
||||||
|
// Release builds should always return false here
|
||||||
|
return false
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Color {
|
extension Color {
|
||||||
|
Reference in New Issue
Block a user