diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 42ceb6f139..e3d575ddf0 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -805,6 +805,21 @@ abbreviated commit SHA-1 (`c9c0edb`). + Default is "Submit patch set ${patchSet} into ${branch}". +[[change.replyLabel]]change.replyLabel:: ++ +Label name for the reply button. In the user interface an ellipsis (…) +is appended. ++ +Default is "Reply". In the user interface it becomes "Reply…". + +[[change.replyTooltip]]change.replyTooltip:: ++ +Tooltip for the reply button. In the user interface a note about the +keyboard shortcut is appended. ++ +Default is "Reply and score". In the user interface it becomes "Reply +and score (Shortcut: a)". + [[changeMerge]] === Section changeMerge diff --git a/Documentation/user-review-ui.txt b/Documentation/user-review-ui.txt index 52d41ff9de..bec4cb9fc1 100644 --- a/Documentation/user-review-ui.txt +++ b/Documentation/user-review-ui.txt @@ -597,6 +597,9 @@ Clicking on the `Reply...` button opens a popup panel. A text box allows to type a summary comment for the currently viewed patch set. +Note that you can set the text and tooltip of the button in +link:config-gerrit.html#change.replyLabel[gerrit.config]. + [[vote]] If the current patch set is viewed, radio buttons are displayed for each label on which the user is allowed to vote. Voting on non-current diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java b/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java index 66309eafed..a0602450b1 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/data/GerritConfig.java @@ -57,6 +57,8 @@ public class GerritConfig implements Cloneable { protected List archiveFormats; protected int largeChangeSize; protected boolean newFeatures; + protected String replyLabel; + protected String replyTitle; public String getLoginUrl() { return loginUrl; @@ -308,4 +310,20 @@ public class GerritConfig implements Cloneable { public void setNewFeatures(boolean n) { newFeatures = n; } + + public String getReplyTitle() { + return replyTitle; + } + + public void setReplyTitle(String r) { + replyTitle = r; + } + + public String getReplyLabel() { + return replyLabel; + } + + public void setReplyLabel(String r) { + replyLabel = r; + } } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java index 5c75c0b7cb..f4cd3225f5 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java @@ -87,6 +87,7 @@ import com.google.gwt.user.client.ui.ToggleButton; import com.google.gwtexpui.globalkey.client.GlobalKey; import com.google.gwtexpui.globalkey.client.KeyCommand; import com.google.gwtexpui.globalkey.client.KeyCommandSet; +import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder; import com.google.gwtorm.client.KeyUtil; import java.sql.Timestamp; @@ -266,6 +267,8 @@ public class ChangeScreen2 extends Screen { reviewers.init(style, ccText); hashtags.init(style); + initReplyButton(); + keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation()); keysNavigation.add(new KeyCommand(0, 'u', Util.C.upToChangeList()) { @Override @@ -330,6 +333,14 @@ public class ChangeScreen2 extends Screen { } } + private void initReplyButton() { + reply.setTitle(Gerrit.getConfig().getReplyTitle()); + reply.setHTML(new SafeHtmlBuilder() + .openDiv() + .append(Gerrit.getConfig().getReplyLabel()) + .closeDiv()); + } + private void gotoSibling(final int offset) { if (offset > 0 && changeInfo.current_revision().equals(revision)) { return; diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml index b579b0f416..828928649d 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml @@ -356,9 +356,8 @@ limitations under the License.
+ title=''> -
Reply…
{ config.setSshdAddress(sshInfo.getHostKeys().get(0).getHost()); } + String replyTitle = + Optional.fromNullable(cfg.getString("change", null, "replyTooltip")) + .or("Reply and score") + + " (Shortcut: a)"; + String replyLabel = + Optional.fromNullable(cfg.getString("change", null, "replyLabel")) + .or("Reply") + + "\u2026"; + config.setReplyTitle(replyTitle); + config.setReplyLabel(replyLabel); + return config; }