mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-12-22 03:20:07 +01:00
✨ Display app driver is now a preference
This commit is contained in:
@@ -66,12 +66,14 @@ class StatusMenu: NSMenu {
|
|||||||
|
|
||||||
addPreferencesMenuItems()
|
addPreferencesMenuItems()
|
||||||
|
|
||||||
if Valet.installed {
|
if Preferences.isEnabled(.displayDriver) {
|
||||||
// Add the menu item displaying the driver information
|
if Valet.installed {
|
||||||
addValetVersionItem()
|
// Add the menu item displaying the driver information
|
||||||
} else {
|
addValetVersionItem()
|
||||||
// No driver, using Standalone Mode (internally: lite mode)
|
} else {
|
||||||
addLiteModeMenuItem()
|
// No driver, using Standalone Mode (internally: lite mode)
|
||||||
|
addLiteModeMenuItem()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addCoreMenuItems()
|
addCoreMenuItems()
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ enum PreferenceName: String, Codable {
|
|||||||
case displayExtensions = "display_extensions"
|
case displayExtensions = "display_extensions"
|
||||||
case displayPresets = "display_presets"
|
case displayPresets = "display_presets"
|
||||||
case displayMisc = "display_misc"
|
case displayMisc = "display_misc"
|
||||||
|
case displayDriver = "display_driver"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
What type of data each preference contains.
|
What type of data each preference contains.
|
||||||
@@ -81,7 +82,8 @@ enum PreferenceName: String, Codable {
|
|||||||
.displayLimitsWidget,
|
.displayLimitsWidget,
|
||||||
.displayExtensions,
|
.displayExtensions,
|
||||||
.displayPresets,
|
.displayPresets,
|
||||||
.displayMisc
|
.displayMisc,
|
||||||
|
.displayDriver
|
||||||
],
|
],
|
||||||
.string: [
|
.string: [
|
||||||
.globalHotkey,
|
.globalHotkey,
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class Preferences {
|
|||||||
PreferenceName.notifyAboutGlobalComposerStatus.rawValue: true,
|
PreferenceName.notifyAboutGlobalComposerStatus.rawValue: true,
|
||||||
|
|
||||||
/// Preferences: UI Preferences
|
/// Preferences: UI Preferences
|
||||||
|
PreferenceName.displayDriver.rawValue: true,
|
||||||
PreferenceName.displayGlobalVersionSwitcher.rawValue: true,
|
PreferenceName.displayGlobalVersionSwitcher.rawValue: true,
|
||||||
PreferenceName.displayServicesManager.rawValue: true,
|
PreferenceName.displayServicesManager.rawValue: true,
|
||||||
PreferenceName.displayValetIntegration.rawValue: true,
|
PreferenceName.displayValetIntegration.rawValue: true,
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ class MenuStructurePreferencesVC: GenericPreferenceVC {
|
|||||||
let vc = NSStoryboard(name: "Main", bundle: nil)
|
let vc = NSStoryboard(name: "Main", bundle: nil)
|
||||||
.instantiateController(withIdentifier: "preferencesTemplateVC") as! GenericPreferenceVC
|
.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_services_manager", .displayServicesManager))
|
||||||
.addView(when: Valet.installed, vc.displayFeature("prefs.display_valet_integration", .displayValetIntegration))
|
.addView(when: Valet.installed, vc.displayFeature("prefs.display_valet_integration", .displayValetIntegration))
|
||||||
.addView(when: true, vc.displayFeature("prefs.display_php_config_finder", .displayPhpConfigFinder))
|
.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_extensions", .displayExtensions))
|
||||||
.addView(when: true, vc.displayFeature("prefs.display_presets", .displayPresets))
|
.addView(when: true, vc.displayFeature("prefs.display_presets", .displayPresets))
|
||||||
.addView(when: true, vc.displayFeature("prefs.display_misc", .displayMisc))
|
.addView(when: true, vc.displayFeature("prefs.display_misc", .displayMisc))
|
||||||
|
.addView(when: true, vc.displayFeature("prefs.display_driver", .displayDriver))
|
||||||
return vc
|
|
||||||
}
|
}
|
||||||
// swiftlint:enable line_length
|
// swiftlint:enable line_length
|
||||||
}
|
}
|
||||||
@@ -76,15 +76,13 @@ class NotificationPreferencesVC: GenericPreferenceVC {
|
|||||||
let vc = NSStoryboard(name: "Main", bundle: nil)
|
let vc = NSStoryboard(name: "Main", bundle: nil)
|
||||||
.instantiateController(withIdentifier: "preferencesTemplateVC") as! GenericPreferenceVC
|
.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: true, vc.getNotifyAboutPresetsPV())
|
||||||
.addView(when: Valet.installed, vc.getNotifyAboutSecureTogglePV())
|
.addView(when: Valet.installed, vc.getNotifyAboutSecureTogglePV())
|
||||||
.addView(when: true, vc.getNotifyAboutGlobalComposerStatusPV())
|
.addView(when: true, vc.getNotifyAboutGlobalComposerStatusPV())
|
||||||
.addView(when: true, vc.getNotifyAboutServicesPV())
|
.addView(when: true, vc.getNotifyAboutServicesPV())
|
||||||
.addView(when: Valet.installed, vc.getNotifyAboutPhpFpmChangePV())
|
.addView(when: Valet.installed, vc.getNotifyAboutPhpFpmChangePV())
|
||||||
.addView(when: Valet.installed, vc.getWarnAboutNonStandardTldPV())
|
.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_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.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_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";
|
"prefs.display_global_version_switcher" = "PHP Switcher";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user