Persisting users diff formatting preferences

When a user changes diff formatting preferences and clicks the
Update button the preferences will then be persisted in the database.
This way a user doesn't have to adjust the diff formatting
preferences each time it switches to the next file diff.

Bug: issue 579
Change-Id: I52cd1dcf702ed04046b236228f994fb9042243d9
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
Sasa Zivkov
2010-06-14 15:00:05 +02:00
committed by Shawn O. Pearce
parent 5a00b3161d
commit 077b2c5dd0
25 changed files with 512 additions and 154 deletions

View File

@@ -14,8 +14,6 @@
package com.google.gerrit.client.patches;
import static com.google.gerrit.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT;
import com.google.gerrit.client.Dispatcher;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.RpcStatus;
@@ -33,6 +31,7 @@ import com.google.gerrit.common.data.PatchScriptSettings;
import com.google.gerrit.common.data.PatchSetDetail;
import com.google.gerrit.prettify.client.ClientSideFormatter;
import com.google.gerrit.prettify.common.PrettyFactory;
import com.google.gerrit.reviewdb.AccountDiffPreference;
import com.google.gerrit.reviewdb.Change;
import com.google.gerrit.reviewdb.Patch;
import com.google.gerrit.reviewdb.PatchSet;
@@ -234,7 +233,7 @@ public abstract class PatchScreen extends Screen implements
}
final int ctx = s.getContext();
if (ctx == WHOLE_FILE_CONTEXT && !last.getA().isWholeFile()) {
if (ctx == AccountDiffPreference.WHOLE_FILE_CONTEXT && !last.getA().isWholeFile()) {
// We don't have the entire file here, so we can't render it.
return false;
}