Add settings screen for global diff preferences

The account preferences are available under the Settings menu, but not
the diff preferences. The diff preferences are only accessible from
the diff screen by clicking on the gear icon. It's confusing to users
that they cannot find all preferences under the Settings menu. This is
why it makes sense to make the diff preferences available in the
Settings menu too.

There are a few diff settings which are only applicable when looking
at a concrete file diff and which are not stored on server side
(show/hide left side, language). These settings are not available when
the diff preferences are accessed from the Settings menu.

The diff preferences in the Settings menu are rendered with the same
style as the diff preferences in the popup. This makes it easy for
users to see that these are actually the same settings, just accessed
through different paths.

Change-Id: I35f45a4784592b9ce2fe35d86fd6974acc14f5c6
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-10-07 14:40:10 +02:00
parent bd567a0d3b
commit 7b6af4ff35
8 changed files with 237 additions and 118 deletions

View File

@@ -28,6 +28,7 @@ import static com.google.gerrit.common.PageLinks.REGISTER;
import static com.google.gerrit.common.PageLinks.SETTINGS;
import static com.google.gerrit.common.PageLinks.SETTINGS_AGREEMENTS;
import static com.google.gerrit.common.PageLinks.SETTINGS_CONTACT;
import static com.google.gerrit.common.PageLinks.SETTINGS_DIFF_PREFERENCES;
import static com.google.gerrit.common.PageLinks.SETTINGS_EXTENSION;
import static com.google.gerrit.common.PageLinks.SETTINGS_GPGKEYS;
import static com.google.gerrit.common.PageLinks.SETTINGS_HTTP_PASSWORD;
@@ -41,6 +42,7 @@ import static com.google.gerrit.common.PageLinks.toChangeQuery;
import com.google.gerrit.client.account.MyAgreementsScreen;
import com.google.gerrit.client.account.MyContactInformationScreen;
import com.google.gerrit.client.account.MyDiffPreferencesScreen;
import com.google.gerrit.client.account.MyGpgKeysScreen;
import com.google.gerrit.client.account.MyGroupsScreen;
import com.google.gerrit.client.account.MyIdentitiesScreen;
@@ -527,6 +529,10 @@ public class Dispatcher {
return new MyPreferencesScreen();
}
if (matchExact(SETTINGS_DIFF_PREFERENCES, token)) {
return new MyDiffPreferencesScreen();
}
if (matchExact(SETTINGS_PROJECTS, token)) {
return new MyWatchedProjectsScreen();
}