Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2018-02-16 11:30:39 +0000
committerThomas Wolf2018-02-17 19:35:47 +0000
commitf9ce186e89de4d05d37f75ba4d3892c7af2648c1 (patch)
treed31495bd96e5bccd979e8c3f94b37af42a1c8967 /org.eclipse.egit.ui/src/org/eclipse/egit/ui
parent91f4b6c087c4595d92504f85baecf0c26bf43d53 (diff)
downloadegit-f9ce186e89de4d05d37f75ba4d3892c7af2648c1.tar.gz
egit-f9ce186e89de4d05d37f75ba4d3892c7af2648c1.tar.xz
egit-f9ce186e89de4d05d37f75ba4d3892c7af2648c1.zip
Discard Local Changes should use verbs if triggered from Staging View
User should be guided what happens if they select an action in an dialog. Especially with the "Discard" dialog it is important to make it clear that selecting the "OK" button will actually discard some data. Bug: 531264 Change-Id: I1d95d2c21df4e2fb65112f34cf0e9526eaf72c0b Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index a44436fc14..6deed34228 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -148,6 +148,7 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.api.AddCommand;
@@ -3051,9 +3052,15 @@ public class StagingView extends ViewPart
} else {
question = MessageFormat.format(question, ""); //$NON-NLS-1$
}
- boolean performAction = MessageDialog.openConfirm(form.getShell(),
- UIText.DiscardChangesAction_confirmActionTitle, question);
- if (!performAction) {
+
+ MessageDialog dlg = new MessageDialog(form.getShell(),
+ UIText.DiscardChangesAction_confirmActionTitle, null,
+ question, MessageDialog.CONFIRM,
+ new String[] {
+ UIText.DiscardChangesAction_discardChangesButtonText,
+ IDialogConstants.CANCEL_LABEL },
+ 0);
+ if (dlg.open() != Window.OK) {
return;
}
List<String> files = new ArrayList<>();

Back to the top