diff options
Diffstat (limited to 'gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java')
-rw-r--r-- | gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java index 641db80b3a..ecb4cd619b 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java @@ -27,6 +27,7 @@ import com.google.gerrit.common.data.GerritConfig; import com.google.gerrit.common.data.HostPageData; import com.google.gerrit.common.data.SystemInfoService; import com.google.gerrit.reviewdb.Account; +import com.google.gerrit.reviewdb.AccountDiffPreference; import com.google.gerrit.reviewdb.AccountGeneralPreferences; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; @@ -70,6 +71,7 @@ public class Gerrit implements EntryPoint { private static String myHost; private static GerritConfig myConfig; private static Account myAccount; + private static AccountDiffPreference myAccountDiffPref; private static TabPanel menuLeft; private static LinkMenuBar menuRight; @@ -172,6 +174,15 @@ public class Gerrit implements EntryPoint { return myAccount; } + /** @return the currently signed in users's diff preferences; null if no diff preferences defined for the account */ + public static AccountDiffPreference getAccountDiffPreference() { + return myAccountDiffPref; + } + + public static void setAccountDiffPreference(AccountDiffPreference accountDiffPref) { + myAccountDiffPref = accountDiffPref; + } + /** @return true if the user is currently authenticated */ public static boolean isSignedIn() { return getUserAccount() != null; @@ -203,6 +214,7 @@ public class Gerrit implements EntryPoint { static void deleteSessionCookie() { Cookies.removeCookie(SESSION_COOKIE); myAccount = null; + myAccountDiffPref = null; refreshMenuBar(); } @@ -234,6 +246,9 @@ public class Gerrit implements EntryPoint { if (result.account != null) { myAccount = result.account; } + if (result.accountDiffPref != null) { + myAccountDiffPref = result.accountDiffPref; + } onModuleLoad2(); } }); @@ -409,7 +424,8 @@ public class Gerrit implements EntryPoint { if (signedIn) { m = new LinkMenuBar(); addLink(m, C.menuMyChanges(), PageLinks.MINE); - addLink(m, C.menyMyDrafts(), PageLinks.MINE_DRAFTS); + addLink(m, C.menuMyDrafts(), PageLinks.MINE_DRAFTS); + addLink(m, C.menuMyWatchedChanges(), PageLinks.MINE_WATCHED); addLink(m, C.menuMyStarredChanges(), PageLinks.MINE_STARRED); menuLeft.add(m, C.menuMine()); menuLeft.selectTab(1); @@ -427,6 +443,7 @@ public class Gerrit implements EntryPoint { if (getConfig().isDocumentationAvailable()) { m = new LinkMenuBar(); addDocLink(m, C.menuDocumentationIndex(), "index.html"); + addDocLink(m, C.menuDocumentationSearch(), "user-search.html"); addDocLink(m, C.menuDocumentationUpload(), "user-upload.html"); addDocLink(m, C.menuDocumentationAccess(), "access-control.html"); menuLeft.add(m, C.menuDocumentation()); |