1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

Allow more UI tweaking

This commit is contained in:
2022-09-08 18:14:22 +02:00
parent d93af814c9
commit 186f80c90e
7 changed files with 77 additions and 26 deletions

View File

@ -1739,7 +1739,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 960;
CURRENT_PROJECT_VERSION = 965;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;
@ -1766,7 +1766,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 960;
CURRENT_PROJECT_VERSION = 965;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;

View File

@ -235,10 +235,10 @@ extension StatusMenu {
}
addItems([
NSMenuItem.separator(),
HeaderView.asMenuItem(text: "mi_php_doctor".localized),
NSMenuItem(title: "mi_recommendations_count".localized(WarningManager.shared.warnings.count)),
NSMenuItem(title: "mi_view_recommendations".localized, action: #selector(MainMenu.openWarnings))
NSMenuItem(title: "mi_view_recommendations".localized, action: #selector(MainMenu.openWarnings)),
NSMenuItem.separator()
])
}

View File

@ -22,29 +22,45 @@ class StatusMenu: NSMenu {
addItem(NSMenuItem.separator())
}
addValetMenuItems()
addItem(NSMenuItem.separator())
if Preferences.isEnabled(.displayValetIntegration) {
addValetMenuItems()
addItem(NSMenuItem.separator())
}
addConfigurationMenuItems()
addItem(NSMenuItem.separator())
if Preferences.isEnabled(.displayPhpConfigFinder) {
addConfigurationMenuItems()
addItem(NSMenuItem.separator())
}
addComposerMenuItems()
addItem(NSMenuItem.separator())
if Preferences.isEnabled(.displayComposerToolkit) {
addComposerMenuItems()
addItem(NSMenuItem.separator())
}
if PhpEnv.shared.isBusy {
return
}
addStatsMenuItem()
addItem(NSMenuItem.separator())
if Preferences.isEnabled(.displayLimitsWidget) {
addStatsMenuItem()
addItem(NSMenuItem.separator())
}
if Preferences.isEnabled(.displayExtensions) {
addExtensionsMenuItems()
addXdebugMenuItem()
NSMenuItem.separator()
}
addExtensionsMenuItems()
addXdebugMenuItem()
addPhpDoctorMenuItem()
addItem(NSMenuItem.separator())
addPresetsMenuItem()
addFirstAidAndServicesMenuItems()
if Preferences.isEnabled(.displayPresets) {
addPresetsMenuItem()
}
if Preferences.isEnabled(.displayMisc) {
addFirstAidAndServicesMenuItems()
}
addItem(NSMenuItem.separator())

View File

@ -37,11 +37,13 @@ enum PreferenceName: String {
// MENU CUSTOMIZATION
case displayGlobalVersionSwitcher = "display_global_version_switcher"
case displayServicesManager = "display_services_manager"
case displayValetConfigFinder = "display_valet_config_finder"
case displayValetIntegration = "display_valet_integration"
case displayPhpConfigFinder = "display_php_config_finder"
case displayComposerToolkit = "display_composer_toolkit"
case displayLimitsWidget = "display_limits_widget"
case displayExtensions = "display_extensions"
case displayPresets = "display_presets"
case displayMisc = "display_misc"
/**
What type of data each preference contains.
@ -68,11 +70,13 @@ enum PreferenceName: String {
// UI Preferences
.displayGlobalVersionSwitcher,
.displayServicesManager,
.displayValetConfigFinder,
.displayValetIntegration,
.displayPhpConfigFinder,
.displayComposerToolkit,
.displayLimitsWidget,
.displayExtensions
.displayExtensions,
.displayPresets,
.displayMisc
],
.string: [
.globalHotkey,

View File

@ -67,11 +67,13 @@ class Preferences {
/// Preferences: UI Preferences
PreferenceName.displayGlobalVersionSwitcher.rawValue: true,
PreferenceName.displayServicesManager.rawValue: true,
PreferenceName.displayValetConfigFinder.rawValue: true,
PreferenceName.displayValetIntegration.rawValue: true,
PreferenceName.displayPhpConfigFinder.rawValue: true,
PreferenceName.displayComposerToolkit.rawValue: true,
PreferenceName.displayLimitsWidget.rawValue: true,
PreferenceName.displayExtensions.rawValue: true,
PreferenceName.displayPresets.rawValue: true,
PreferenceName.displayMisc.rawValue: true,
/// Stats
InternalStats.switchCount.rawValue: 0,

View File

@ -265,7 +265,15 @@ class MenuStructurePreferencesVC: GenericPreferenceVC {
vc.views = [
vc.getDisplayMenuSectionPV("prefs.display_global_version_switcher", .displayGlobalVersionSwitcher, true),
vc.getDisplayMenuSectionPV("prefs.display_services_manager", .displayServicesManager)
vc.getDisplayMenuSectionPV("prefs.display_services_manager", .displayServicesManager),
vc.getDisplayMenuSectionPV("prefs.display_valet_integration", .displayValetIntegration),
vc.getDisplayMenuSectionPV("prefs.display_php_config_finder", .displayPhpConfigFinder),
vc.getDisplayMenuSectionPV("prefs.display_composer_toolkit", .displayComposerToolkit),
vc.getDisplayMenuSectionPV("prefs.display_limits_widget", .displayLimitsWidget),
vc.getDisplayMenuSectionPV("prefs.display_extensions", .displayExtensions),
vc.getDisplayMenuSectionPV("prefs.display_presets", .displayPresets),
vc.getDisplayMenuSectionPV("prefs.display_misc", .displayMisc)
]
return vc

View File

@ -227,7 +227,7 @@
"prefs.integrations" = "Integrations:";
"prefs.updates" = "Updates:";
"prefs.notifications" = "Notifications:";
"prefs.menu_contents" = "Display In Menu:";
"prefs.menu_contents" = "Features in Menu:";
"prefs.icon_options.php" = "Display PHP Icon";
"prefs.icon_options.elephant" = "Display Elephant Icon";
@ -253,7 +253,7 @@
"prefs.automatic_update_check_title" = "Automatically check for updates";
"prefs.automatic_update_check_desc" = "When checked, PHP Monitor will automatically check if there is a newer version available, and notify you if that is the case.";
"prefs.php_doctor_suggestions_title" = "Show suggestions (if applicable)";
"prefs.php_doctor_suggestions_title" = "Always show suggestions";
"prefs.php_doctor_suggestions_desc" = "If you uncheck this item, no PHP Doctor suggestions will appear in PHP Monitor's menu. Keep in mind that PHP Doctor will not appear if there are no recommendations.";
"prefs.shortcut_set" = "Set global shortcut";
@ -280,10 +280,31 @@
"prefs.notify_about_composer_success" = "Notify about global composer update";
"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" = "Show Global PHP Switcher";
"prefs.display_global_version_switcher" = "PHP Switcher";
"prefs.display_services_manager_desc" = "If disabled, you will not be able to see, start or stop individual services. (If any services are disabled, you will not be easily able to see that this is the case.)";
"prefs.display_services_manager" = "Show Services Manager";
"prefs.display_services_manager" = "Services Manager";
"prefs.display_valet_integration_desc" = "If disabled, you will not be able to locate the main Valet folder or open the list of domains.";
"prefs.display_valet_integration" = "Valet Integration";
"prefs.display_php_config_finder_desc" = "If disabled, you will not be able to easily locate your PHP configuration files and/or generate a phpinfo() dump.";
"prefs.display_php_config_finder" = "PHP Config Finder";
"prefs.display_composer_toolkit_desc" = "If disabled, you will not be able to invoke Composer via the main menu. The automatic Composer update after switching preference is unaffected by this change.";
"prefs.display_composer_toolkit" = "Composer Toolkit";
"prefs.display_limits_widget_desc" = "If disabled, you will not be able to see the limits widget (memory, POST, upload) in the main menu.";
"prefs.display_limits_widget" = "Limits Widget";
"prefs.display_extensions_desc" = "If disabled, you will not be able to easily toggle extensions via the main menu.";
"prefs.display_extensions" = "Extensions";
"prefs.display_presets_desc" = "If disabled, you will not be able to apply or revert PHP configuration presets.";
"prefs.display_presets" = "Presets";
"prefs.display_misc_desc" = "If disabled, you will not be able to access the First Aid & Services menu.";
"prefs.display_misc" = "First Aid & Services Menu";
// NOTIFICATIONS