Remove theme preferences

The themes were only used by CodeMirror in the GWT UI. Since the GWT UI
is gone these preferences are no longer needed.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I25196483fc1c3f97b23c4a6269b516f3429ae44e
This commit is contained in:
Edwin Kempin 2019-12-30 16:32:53 +01:00 committed by David Pursehouse
parent 8341b35711
commit f006c3edce
7 changed files with 0 additions and 153 deletions

View File

@ -1423,7 +1423,6 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
)]}'
{
"context": 10,
"theme": "DEFAULT",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
@ -1454,7 +1453,6 @@ link:#diff-preferences-input[DiffPreferencesInput] entity.
{
"context": 10,
"theme": "ECLIPSE",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
@ -1480,7 +1478,6 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
)]}'
{
"context": 10,
"theme": "ECLIPSE",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
@ -1517,7 +1514,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
)]}'
{
"theme": "ECLIPSE",
"tab_size": 4,
"line_length": 80,
"indent_unit": 2,
@ -1549,7 +1545,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
Content-Type: application/json;charset=UTF-8
{
"theme": "ECLIPSE",
"tab_size": 4,
"line_length": 80,
"indent_unit": 2,
@ -1576,7 +1571,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
)]}'
{
"theme": "ECLIPSE",
"tab_size": 4,
"line_length": 80,
"cursor_blink_rate": 530,
@ -2441,9 +2435,6 @@ preferences of a user.
|Field Name ||Description
|`context` ||
The number of lines of context when viewing a patch.
|`theme` ||
The CodeMirror theme name in upper case, for example `DEFAULT`. All the themes
from the CodeMirror release that Gerrit is using are available.
|`expand_all_comments` |not set if `false`|
Whether all inline comments should be automatically expanded.
|`ignore_whitespace` ||
@ -2565,9 +2556,6 @@ preferences of a user.
[options="header",cols="1,^1,5"]
|===========================================
|Field Name ||Description
|`theme` ||
The CodeMirror theme name in upper case, for example `DEFAULT`. All the themes
from the CodeMirror release that Gerrit is using are available.
|`tab_size` ||
Number of spaces that should be used to display one tab.
|`line_length` ||

View File

@ -60,7 +60,6 @@ public class DiffPreferencesInfo {
public Boolean hideEmptyPane;
public Boolean matchBrackets;
public Boolean lineWrapping;
public Theme theme;
public Whitespace ignoreWhitespace;
public Boolean retainHeader;
public Boolean skipDeleted;
@ -75,7 +74,6 @@ public class DiffPreferencesInfo {
i.lineLength = DEFAULT_LINE_LENGTH;
i.cursorBlinkRate = 0;
i.ignoreWhitespace = Whitespace.IGNORE_NONE;
i.theme = Theme.DEFAULT;
i.expandAllComments = false;
i.intralineDifference = true;
i.manualReview = false;

View File

@ -30,7 +30,6 @@ public class EditPreferencesInfo {
public Boolean indentWithTabs;
public Boolean autoCloseBrackets;
public Boolean showBase;
public Theme theme;
public static EditPreferencesInfo defaults() {
EditPreferencesInfo i = new EditPreferencesInfo();
@ -48,7 +47,6 @@ public class EditPreferencesInfo {
i.indentWithTabs = false;
i.autoCloseBrackets = false;
i.showBase = false;
i.theme = Theme.DEFAULT;
return i;
}
}

View File

@ -1,123 +0,0 @@
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.extensions.client;
public enum Theme {
// Light themes
DEFAULT,
DAY_3024,
DUOTONE_LIGHT,
BASE16_LIGHT,
ECLIPSE,
ELEGANT,
MDN_LIKE,
NEAT,
NEO,
PARAISO_LIGHT,
SOLARIZED,
TTCN,
XQ_LIGHT,
YETI,
// Dark themes
NIGHT_3024,
ABCDEF,
AMBIANCE,
BASE16_DARK,
BESPIN,
BLACKBOARD,
COBALT,
COLORFORTH,
DRACULA,
DUOTONE_DARK,
ERLANG_DARK,
HOPSCOTCH,
ICECODER,
ISOTOPE,
LESSER_DARK,
LIQUIBYTE,
MATERIAL,
MBO,
MIDNIGHT,
MONOKAI,
NIGHT,
PARAISO_DARK,
PASTEL_ON_DARK,
RAILSCASTS,
RUBYBLUE,
SETI,
THE_MATRIX,
TOMORROW_NIGHT_BRIGHT,
TOMORROW_NIGHT_EIGHTIES,
TWILIGHT,
VIBRANT_INK,
XQ_DARK,
ZENBURN;
public boolean isDark() {
switch (this) {
case ABCDEF:
case AMBIANCE:
case BASE16_DARK:
case BESPIN:
case BLACKBOARD:
case COBALT:
case COLORFORTH:
case DRACULA:
case DUOTONE_DARK:
case ERLANG_DARK:
case HOPSCOTCH:
case ICECODER:
case ISOTOPE:
case LESSER_DARK:
case LIQUIBYTE:
case MATERIAL:
case MBO:
case MIDNIGHT:
case MONOKAI:
case NIGHT:
case NIGHT_3024:
case PARAISO_DARK:
case PASTEL_ON_DARK:
case RAILSCASTS:
case RUBYBLUE:
case SETI:
case THE_MATRIX:
case TOMORROW_NIGHT_BRIGHT:
case TOMORROW_NIGHT_EIGHTIES:
case TWILIGHT:
case VIBRANT_INK:
case XQ_DARK:
case ZENBURN:
return true;
case BASE16_LIGHT:
case DEFAULT:
case DAY_3024:
case DUOTONE_LIGHT:
case ECLIPSE:
case ELEGANT:
case MDN_LIKE:
case NEAT:
case NEO:
case PARAISO_LIGHT:
case SOLARIZED:
case TTCN:
case XQ_LIGHT:
case YETI:
default:
return false;
}
}
}

View File

@ -21,7 +21,6 @@ import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.acceptance.NoHttpd;
import com.google.gerrit.extensions.client.DiffPreferencesInfo;
import com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace;
import com.google.gerrit.extensions.client.Theme;
import org.junit.Test;
@NoHttpd
@ -43,7 +42,6 @@ public class DiffPreferencesIT extends AbstractDaemonTest {
i.fontSize *= -1;
i.lineLength *= -1;
i.cursorBlinkRate = 500;
i.theme = Theme.MIDNIGHT;
i.ignoreWhitespace = Whitespace.IGNORE_ALL;
i.expandAllComments ^= true;
i.intralineDifference ^= true;

View File

@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.acceptance.NoHttpd;
import com.google.gerrit.extensions.client.EditPreferencesInfo;
import com.google.gerrit.extensions.client.Theme;
import org.junit.Test;
@NoHttpd
@ -42,7 +41,6 @@ public class EditPreferencesIT extends AbstractDaemonTest {
assertThat(out.indentWithTabs).isNull();
assertThat(out.autoCloseBrackets).isNull();
assertThat(out.showBase).isNull();
assertThat(out.theme).isEqualTo(Theme.DEFAULT);
// change some default values
out.lineLength = 80;
@ -59,7 +57,6 @@ public class EditPreferencesIT extends AbstractDaemonTest {
out.indentWithTabs = true;
out.autoCloseBrackets = true;
out.showBase = true;
out.theme = Theme.TWILIGHT;
EditPreferencesInfo info = gApi.accounts().id(admin.id().toString()).setEditPreferences(out);
@ -91,6 +88,5 @@ public class EditPreferencesIT extends AbstractDaemonTest {
assertThat(out.indentWithTabs).isEqualTo(in.indentWithTabs);
assertThat(out.autoCloseBrackets).isEqualTo(in.autoCloseBrackets);
assertThat(out.showBase).isEqualTo(in.showBase);
assertThat(out.theme).isEqualTo(in.theme);
}
}

View File

@ -21,7 +21,6 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
import com.google.gerrit.extensions.client.Theme;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.List;
import java.util.Map;
@ -48,8 +47,6 @@ public class ConfigUtilTest extends GerritBaseTests {
public String s;
public String sd;
public String nd;
public Theme t;
public Theme td;
public List<String> list;
public Map<String, String> map;
@ -67,8 +64,6 @@ public class ConfigUtilTest extends GerritBaseTests {
i.s = "foo";
i.sd = "bar";
// i.nd = null; // Don't need to explicitly set it; it's null by default
i.t = Theme.DEFAULT;
i.td = Theme.DEFAULT;
return i;
}
}
@ -86,7 +81,6 @@ public class ConfigUtilTest extends GerritBaseTests {
in.bb = true;
in.bd = false;
in.s = "baz";
in.t = Theme.MIDNIGHT;
Config cfg = new Config();
ConfigUtil.storeSection(cfg, SECT, SUB, in, d);
@ -117,8 +111,6 @@ public class ConfigUtilTest extends GerritBaseTests {
assertThat(out.s).isEqualTo(in.s);
assertThat(out.sd).isEqualTo(d.sd);
assertThat(out.nd).isNull();
assertThat(out.t).isEqualTo(in.t);
assertThat(out.td).isEqualTo(d.td);
}
@Test