mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50: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()
|
||||
|
||||
let customApps = Preferences.custom.scanApps.map { appName in
|
||||
let customApps = Preferences.custom.scanApps?.map { appName in
|
||||
return Application(appName, .user_supplied)
|
||||
}.filter { app in
|
||||
return app.isInstalled()
|
||||
}
|
||||
} ?? []
|
||||
|
||||
App.shared.detectedApplications.append(contentsOf: customApps)
|
||||
|
||||
|
@ -216,14 +216,14 @@ extension StatusMenu {
|
||||
}
|
||||
|
||||
addItems([
|
||||
NSMenuItem.separator(),
|
||||
NSMenuItem(title: "mi_xdebug_mode".localized, submenu: [
|
||||
HeaderView.asMenuItem(text: "mi_xdebug_available_modes".localized)
|
||||
] + Xdebug.asMenuItems() + [
|
||||
HeaderView.asMenuItem(text: "mi_xdebug_actions".localized),
|
||||
NSMenuItem(title: "mi_xdebug_disable_all".localized,
|
||||
action: #selector(MainMenu.disableAllXdebugModes))
|
||||
], target: MainMenu.shared)
|
||||
], target: MainMenu.shared),
|
||||
NSMenuItem.separator()
|
||||
], target: MainMenu.shared)
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,9 @@ class StatusMenu: NSMenu {
|
||||
|
||||
if Preferences.isEnabled(.displayExtensions) {
|
||||
addExtensionsMenuItems()
|
||||
addXdebugMenuItem()
|
||||
NSMenuItem.separator()
|
||||
|
||||
addXdebugMenuItem()
|
||||
}
|
||||
|
||||
addPhpDoctorMenuItem()
|
||||
|
@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
|
||||
struct CustomPrefs: Decodable {
|
||||
let scanApps: [String]
|
||||
let scanApps: [String]?
|
||||
let presets: [Preset]?
|
||||
let services: [String]?
|
||||
let environmentVariables: [String: String]?
|
||||
|
@ -10,8 +10,13 @@ import Foundation
|
||||
import SwiftUI
|
||||
|
||||
var isRunningSwiftUIPreview: Bool {
|
||||
return ProcessInfo.processInfo
|
||||
.environment["XCODE_RUNNING_FOR_PREVIEWS"] != nil
|
||||
#if DEBUG
|
||||
// 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 {
|
||||
|
Reference in New Issue
Block a user