From 7aebd2388f7ca3b64adcdd0edbfaf3b19cf99b3b Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 6 Apr 2015 08:08:53 -0700 Subject: [PATCH] Remove monospaced font preference global defaults Summary: Fixes T7764. These settings have low utility, are no longer used by default, have become less useful on modern Windows which has a better selection of available fonts, and will eventually be subsumed (at least, for the most part) by T4103. Test Plan: - Grepped for strings. - Viewed settings. - Changed font to "24px impact". - Viewed diffs with default and custom font. Reviewers: btrahan, chad Reviewed By: chad Subscribers: chad, epriestley Maniphest Tasks: T7764 Differential Revision: https://secure.phabricator.com/D12301 --- .../PhabricatorExtraConfigSetupCheck.php | 7 ++++++ ...ricatorSyntaxHighlightingConfigOptions.php | 22 ------------------- ...ricatorDisplayPreferencesSettingsPanel.php | 10 ++------- src/view/page/PhabricatorStandardPageView.php | 20 +++-------------- 4 files changed, 12 insertions(+), 47 deletions(-) diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php index b789fe57d0..a95ec0e1c9 100644 --- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php +++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php @@ -167,6 +167,10 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { $reply_handler_reason = pht( 'Reply handlers can no longer be overridden with configuration.'); + $monospace_reason = pht( + 'Phabricator no longer supports global customization of monospaced '. + 'fonts.'); + $ancient_config += array( 'phid.external-loaders' => pht( @@ -245,6 +249,9 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { 'metamta.precedence-bulk' => pht( 'Phabricator now always sends transaction mail with '. '"Precedence: bulk" to improve deliverability.'), + + 'style.monospace' => $monospace_reason, + 'style.monospace.windows' => $monospace_reason, ); return $ancient_config; diff --git a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php index ab40f72898..90c1e87906 100644 --- a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php +++ b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php @@ -137,28 +137,6 @@ final class PhabricatorSyntaxHighlightingConfigOptions pht( "Treat all '*.x.bak' file as '.x'. NOTE: We map to capturing group ". "1 by specifying the mapping as '1'")), - $this->newOption( - 'style.monospace', - 'string', - null) - ->setLocked(true) - ->setSummary( - pht('Default monospace font.')) - ->setDescription( - pht( - "Set the default monospaced font style for users who haven't set ". - "a custom style.")), - $this->newOption( - 'style.monospace.windows', - 'string', - null) - ->setLocked(true) - ->setSummary( - pht('Default monospace font for clients on Windows.')) - ->setDescription( - pht( - "Set the default monospaced font style for users who haven't set ". - "a custom style and are using Windows.")), ); } diff --git a/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php index 0ba3521a80..b58d22a748 100644 --- a/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php @@ -90,8 +90,6 @@ EXAMPLE; ), pht('User Guide: Configuring an External Editor')); - $font_default = PhabricatorEnv::getEnvConfig('style.monospace'); - $pref_monospaced_textareas_value = $preferences ->getPreference($pref_monospaced_textareas); if (!$pref_monospaced_textareas_value) { @@ -139,12 +137,8 @@ EXAMPLE; id(new AphrontFormTextControl()) ->setLabel(pht('Monospaced Font')) ->setName($pref_monospaced) - // Check plz - ->setCaption(hsprintf( - '%s
(%s: %s)', - pht('Overrides default fonts in tools like Differential.'), - pht('Default'), - $font_default)) + ->setCaption( + pht('Overrides default fonts in tools like Differential.')) ->setValue($preferences->getPreference($pref_monospaced))) ->appendChild( id(new AphrontFormMarkupControl()) diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 61709265f4..1c84d46ff5 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -280,17 +280,14 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { protected function getHead() { - $monospaced = PhabricatorEnv::getEnvConfig('style.monospace'); - $monospaced_win = PhabricatorEnv::getEnvConfig('style.monospace.windows'); + $monospaced = null; $request = $this->getRequest(); if ($request) { $user = $request->getUser(); if ($user) { - $pref = $user->loadPreferences()->getPreference( + $monospaced = $user->loadPreferences()->getPreference( PhabricatorUserPreferences::PREFERENCE_MONOSPACED); - $monospaced = nonempty($pref, $monospaced); - $monospaced_win = nonempty($pref, $monospaced_win); } } @@ -306,21 +303,10 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { '', $monospaced); } - $font_css_win = null; - if (!empty($monospaced_win)) { - $font_css_win = hsprintf( - '', $monospaced_win); - } - return hsprintf( - '%s%s%s%s', + '%s%s%s', parent::getHead(), $font_css, - $font_css_win, $response->renderSingleResource('javelin-magical-init', 'phabricator')); }