mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-12-21 19:20:06 +01:00
✨ Display app driver is now a preference
This commit is contained in:
@@ -66,12 +66,14 @@ class StatusMenu: NSMenu {
|
||||
|
||||
addPreferencesMenuItems()
|
||||
|
||||
if Valet.installed {
|
||||
// Add the menu item displaying the driver information
|
||||
addValetVersionItem()
|
||||
} else {
|
||||
// No driver, using Standalone Mode (internally: lite mode)
|
||||
addLiteModeMenuItem()
|
||||
if Preferences.isEnabled(.displayDriver) {
|
||||
if Valet.installed {
|
||||
// Add the menu item displaying the driver information
|
||||
addValetVersionItem()
|
||||
} else {
|
||||
// No driver, using Standalone Mode (internally: lite mode)
|
||||
addLiteModeMenuItem()
|
||||
}
|
||||
}
|
||||
|
||||
addCoreMenuItems()
|
||||
|
||||
@@ -48,6 +48,7 @@ enum PreferenceName: String, Codable {
|
||||
case displayExtensions = "display_extensions"
|
||||
case displayPresets = "display_presets"
|
||||
case displayMisc = "display_misc"
|
||||
case displayDriver = "display_driver"
|
||||
|
||||
/**
|
||||
What type of data each preference contains.
|
||||
@@ -81,7 +82,8 @@ enum PreferenceName: String, Codable {
|
||||
.displayLimitsWidget,
|
||||
.displayExtensions,
|
||||
.displayPresets,
|
||||
.displayMisc
|
||||
.displayMisc,
|
||||
.displayDriver
|
||||
],
|
||||
.string: [
|
||||
.globalHotkey,
|
||||
|
||||
@@ -72,6 +72,7 @@ class Preferences {
|
||||
PreferenceName.notifyAboutGlobalComposerStatus.rawValue: true,
|
||||
|
||||
/// Preferences: UI Preferences
|
||||
PreferenceName.displayDriver.rawValue: true,
|
||||
PreferenceName.displayGlobalVersionSwitcher.rawValue: true,
|
||||
PreferenceName.displayServicesManager.rawValue: true,
|
||||
PreferenceName.displayValetIntegration.rawValue: true,
|
||||
|
||||
@@ -55,7 +55,8 @@ class MenuStructurePreferencesVC: GenericPreferenceVC {
|
||||
let vc = NSStoryboard(name: "Main", bundle: nil)
|
||||
.instantiateController(withIdentifier: "preferencesTemplateVC") as! GenericPreferenceVC
|
||||
|
||||
_ = vc.addView(when: true, vc.displayFeature("prefs.display_global_version_switcher", .displayGlobalVersionSwitcher, true))
|
||||
return vc
|
||||
.addView(when: true, vc.displayFeature("prefs.display_global_version_switcher", .displayGlobalVersionSwitcher, true))
|
||||
.addView(when: Valet.installed, vc.displayFeature("prefs.display_services_manager", .displayServicesManager))
|
||||
.addView(when: Valet.installed, vc.displayFeature("prefs.display_valet_integration", .displayValetIntegration))
|
||||
.addView(when: true, vc.displayFeature("prefs.display_php_config_finder", .displayPhpConfigFinder))
|
||||
@@ -64,8 +65,7 @@ class MenuStructurePreferencesVC: GenericPreferenceVC {
|
||||
.addView(when: true, vc.displayFeature("prefs.display_extensions", .displayExtensions))
|
||||
.addView(when: true, vc.displayFeature("prefs.display_presets", .displayPresets))
|
||||
.addView(when: true, vc.displayFeature("prefs.display_misc", .displayMisc))
|
||||
|
||||
return vc
|
||||
.addView(when: true, vc.displayFeature("prefs.display_driver", .displayDriver))
|
||||
}
|
||||
// swiftlint:enable line_length
|
||||
}
|
||||
@@ -76,15 +76,13 @@ class NotificationPreferencesVC: GenericPreferenceVC {
|
||||
let vc = NSStoryboard(name: "Main", bundle: nil)
|
||||
.instantiateController(withIdentifier: "preferencesTemplateVC") as! GenericPreferenceVC
|
||||
|
||||
_ = vc.addView(when: true, vc.getNotifyAboutVersionChangePV())
|
||||
return vc.addView(when: true, vc.getNotifyAboutVersionChangePV())
|
||||
.addView(when: true, vc.getNotifyAboutPresetsPV())
|
||||
.addView(when: Valet.installed, vc.getNotifyAboutSecureTogglePV())
|
||||
.addView(when: true, vc.getNotifyAboutGlobalComposerStatusPV())
|
||||
.addView(when: true, vc.getNotifyAboutServicesPV())
|
||||
.addView(when: Valet.installed, vc.getNotifyAboutPhpFpmChangePV())
|
||||
.addView(when: Valet.installed, vc.getWarnAboutNonStandardTldPV())
|
||||
|
||||
return vc
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -467,6 +467,9 @@ This has no effect on other terminals, only for the particular terminal session
|
||||
"prefs.warn_about_non_standard_tld_desc" = "If you use a non-standard TLD, you may not wish to get repeated notifications about this.";
|
||||
"prefs.warn_about_non_standard_tld" = "Warn about non-standard TLD";
|
||||
|
||||
"prefs.display_driver_desc" = "If disabled, you will not be able to see which driver is in use. If Valet is active, the version number will also no longer be visible.";
|
||||
"prefs.display_driver" = "App Driver";
|
||||
|
||||
"prefs.display_global_version_switcher_desc" = "If disabled, you will not be able to change the globally linked PHP version via the main menu.";
|
||||
"prefs.display_global_version_switcher" = "PHP Switcher";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user