Add frontend code for email format user preference
This change adds all required frontend code for both GWT UI and Polygerrit as well as docs for the user preferenced introduced by Change I190644732. Feature: Issue 5349 Change-Id: I94353380fbd5208cebb7fe8946fb4c4100c8d054
This commit is contained in:
@@ -287,6 +287,12 @@ public interface AccountConstants extends Constants {
|
||||
|
||||
String emailFieldLabel();
|
||||
|
||||
String emailFormatFieldLabel();
|
||||
|
||||
String messagePlaintextOnly();
|
||||
|
||||
String messageHtmlPlaintext();
|
||||
|
||||
String defaultBaseForMerges();
|
||||
|
||||
String autoMerge();
|
||||
|
@@ -19,6 +19,10 @@ messageCCMeOnMyComments = Every Comment
|
||||
messageEnabled = Only Comments Left By Others
|
||||
messageDisabled = None
|
||||
|
||||
emailFormatFieldLabel = Email Format:
|
||||
messagePlaintextOnly = Plaintext Only
|
||||
messageHtmlPlaintext = HTML and Plaintext
|
||||
|
||||
defaultBaseForMerges = Default Base For Merges:
|
||||
autoMerge = Auto Merge
|
||||
firstParent = First Parent
|
||||
|
@@ -61,6 +61,7 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
private ListBox reviewCategoryStrategy;
|
||||
private ListBox diffView;
|
||||
private ListBox emailStrategy;
|
||||
private ListBox emailFormat;
|
||||
private ListBox defaultBaseForMerges;
|
||||
private StringListPanel myMenus;
|
||||
private Button save;
|
||||
@@ -102,6 +103,12 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
emailStrategy.addItem(
|
||||
Util.C.messageDisabled(), GeneralPreferencesInfo.EmailStrategy.DISABLED.name());
|
||||
|
||||
emailFormat = new ListBox();
|
||||
emailFormat.addItem(
|
||||
Util.C.messagePlaintextOnly(), GeneralPreferencesInfo.EmailFormat.PLAINTEXT.name());
|
||||
emailFormat.addItem(
|
||||
Util.C.messageHtmlPlaintext(), GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT.name());
|
||||
|
||||
defaultBaseForMerges = new ListBox();
|
||||
defaultBaseForMerges.addItem(
|
||||
Util.C.autoMerge(), GeneralPreferencesInfo.DefaultBase.AUTO_MERGE.name());
|
||||
@@ -157,7 +164,7 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
signedOffBy = new CheckBox(Util.C.signedOffBy());
|
||||
|
||||
boolean flashClippy = !UserAgent.hasJavaScriptClipboard() && UserAgent.Flash.isInstalled();
|
||||
final Grid formGrid = new Grid(13 + (flashClippy ? 1 : 0), 2);
|
||||
final Grid formGrid = new Grid(14 + (flashClippy ? 1 : 0), 2);
|
||||
|
||||
int row = 0;
|
||||
|
||||
@@ -177,6 +184,10 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
formGrid.setWidget(row, fieldIdx, emailStrategy);
|
||||
row++;
|
||||
|
||||
formGrid.setText(row, labelIdx, Util.C.emailFormatFieldLabel());
|
||||
formGrid.setWidget(row, fieldIdx, emailFormat);
|
||||
row++;
|
||||
|
||||
formGrid.setText(row, labelIdx, Util.C.defaultBaseForMerges());
|
||||
formGrid.setWidget(row, fieldIdx, defaultBaseForMerges);
|
||||
row++;
|
||||
@@ -250,6 +261,7 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
e.listenTo(diffView);
|
||||
e.listenTo(reviewCategoryStrategy);
|
||||
e.listenTo(emailStrategy);
|
||||
e.listenTo(emailFormat);
|
||||
e.listenTo(defaultBaseForMerges);
|
||||
}
|
||||
|
||||
@@ -287,6 +299,7 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
reviewCategoryStrategy.setEnabled(on);
|
||||
diffView.setEnabled(on);
|
||||
emailStrategy.setEnabled(on);
|
||||
emailFormat.setEnabled(on);
|
||||
defaultBaseForMerges.setEnabled(on);
|
||||
}
|
||||
|
||||
@@ -314,6 +327,7 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
p.reviewCategoryStrategy());
|
||||
setListBox(diffView, GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE, p.diffView());
|
||||
setListBox(emailStrategy, GeneralPreferencesInfo.EmailStrategy.ENABLED, p.emailStrategy());
|
||||
setListBox(emailFormat, GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT, p.emailFormat());
|
||||
setListBox(
|
||||
defaultBaseForMerges,
|
||||
GeneralPreferencesInfo.DefaultBase.FIRST_PARENT,
|
||||
@@ -414,6 +428,12 @@ public class MyPreferencesScreen extends SettingsScreen {
|
||||
GeneralPreferencesInfo.EmailStrategy.ENABLED,
|
||||
GeneralPreferencesInfo.EmailStrategy.values()));
|
||||
|
||||
p.emailFormat(
|
||||
getListBox(
|
||||
emailFormat,
|
||||
GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT,
|
||||
GeneralPreferencesInfo.EmailFormat.values()));
|
||||
|
||||
p.defaultBaseForMerges(
|
||||
getListBox(
|
||||
defaultBaseForMerges,
|
||||
|
Reference in New Issue
Block a user