summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-06-06 07:57:01 (EDT)
committerGerrit Code Review @ Eclipse.org2013-06-13 19:11:51 (EDT)
commit66a5bb6d2a08c42b1c1491a995f03b8a96706da0 (patch)
tree7db6003d64caf62f72ca80b2c08a1e2645eecde0
parent7f56d84644375af537af619a32e73cda690cafc1 (diff)
downloadorg.eclipse.mylyn.reviews-66a5bb6d2a08c42b1c1491a995f03b8a96706da0.zip
org.eclipse.mylyn.reviews-66a5bb6d2a08c42b1c1491a995f03b8a96706da0.tar.gz
org.eclipse.mylyn.reviews-66a5bb6d2a08c42b1c1491a995f03b8a96706da0.tar.bz2
409935: hide "Publishes 0 draft" message in the Publish Comments dialogrefs/changes/79/13579/4
Bug: 409935 Change-Id: I48788982bb198f9f0d968d26c737c29f844d2d0a Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=409935
-rw-r--r--org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/operations/PublishDialog.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/operations/PublishDialog.java b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/operations/PublishDialog.java
index e7a0b9d..0984e42 100644
--- a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/operations/PublishDialog.java
+++ b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/operations/PublishDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies and others.
+ * Copyright (c) 2011, 2013 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,8 +59,6 @@ public class PublishDialog extends GerritOperationDialog {
private final List<Button> approvalButtons;
- private Label statusLabel;
-
private final String editorCommentText;
private final IReviewItemSet set;
@@ -116,14 +114,14 @@ public class PublishDialog extends GerritOperationDialog {
messageEditor.getViewer().setSelectedRange(editorCommentText.length(), 0);
messageEditor.getControl().setFocus();
- statusLabel = new Label(composite, SWT.NONE);
-
int drafts = 0;
for (IComment comment : set.getAllComments()) {
drafts += comment.isDraft() ? 1 : 0;
}
-
- statusLabel.setText(NLS.bind("Publishes {0} draft{1}.", drafts, drafts > 1 ? "s" : ""));
+ if (drafts > 0) {
+ Label statusLabel = new Label(composite, SWT.NONE);
+ statusLabel.setText(NLS.bind("Publishes {0} draft{1}.", drafts, drafts > 1 ? "s" : ""));
+ }
return composite;
}