From f9ce186e89de4d05d37f75ba4d3892c7af2648c1 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 16 Feb 2018 12:30:39 +0100 Subject: [PATCH] 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 --- .../org/eclipse/egit/ui/internal/staging/StagingView.java | 13 ++++++++++--- 1 file 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 a44436fc1..6deed3422 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 files = new ArrayList<>(); -- 2.11.4.GIT