Skip to content

Commit 12c9eae

Browse files
David WeiserThomas Wolf
authored andcommitted
Change confirm hard reset dialog Yes- and No-button label
Adds new String ("&Reset") and uses it as Yes-button label for the confirm hard reset dialog. Changes No-Button label to "Cancel" Changes creation of MessageDialog in CommandConfirmation. Bug: 514470 Change-Id: I7da9a33cc64b84200aed8529fbd51ed8121b18e3 Signed-off-by: David Weiser <[email protected]>
1 parent 275ec28 commit 12c9eae

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ public void testResetToLocalBranch() throws Exception {
280280
.click();
281281

282282
bot.shell(UIText.ResetTargetSelectionDialog_ResetQuestion).bot()
283-
.button(IDialogConstants.YES_LABEL).click();
283+
.button(UIText.CommandConfirmationHardResetDialog_resetButtonLabel)
284+
.click();
284285

285286
Job.getJobManager().join(JobFamilies.RESET, null);
286287
String reset = getTestFileContent();

org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTagHandlingTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ public void testResetToTag() throws Exception {
164164
TestUtil.joinJobs(JobFamilies.RESET);
165165

166166
bot.shell(UIText.ResetTargetSelectionDialog_ResetQuestion).bot()
167-
.button(IDialogConstants.YES_LABEL).click();
167+
.button(UIText.CommandConfirmationHardResetDialog_resetButtonLabel)
168+
.click();
168169

169170
TestUtil.waitForJobs(50, 5000);
170171
Job.getJobManager().join(JobFamilies.RESET, null);

org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,6 +5535,9 @@ public class UIText extends NLS {
55355535
/** */
55365536
public static String StagingViewPreferencePage_maxLimitListMode;
55375537

5538+
/** */
5539+
public static String CommandConfirmationHardResetDialog_resetButtonLabel;
5540+
55385541
static {
55395542
initializeMessages(BUNDLE_NAME, UIText.class);
55405543
}

org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
import org.eclipse.debug.core.ILaunchConfiguration;
1919
import org.eclipse.egit.ui.internal.UIText;
2020
import org.eclipse.egit.ui.internal.branch.LaunchFinder;
21+
import org.eclipse.jface.dialogs.IDialogConstants;
2122
import org.eclipse.jface.dialogs.MessageDialog;
23+
import org.eclipse.jface.window.Window;
2224
import org.eclipse.jgit.lib.Repository;
2325
import org.eclipse.swt.widgets.Shell;
2426

@@ -47,7 +49,13 @@ public static boolean confirmHardReset(Shell shell, final Repository repo) {
4749
} else {
4850
question = MessageFormat.format(question, ""); //$NON-NLS-1$
4951
}
50-
return MessageDialog.openQuestion(shell,
51-
UIText.ResetTargetSelectionDialog_ResetQuestion, question);
52+
53+
MessageDialog messageDialog = new MessageDialog(shell,
54+
UIText.ResetTargetSelectionDialog_ResetQuestion, null, question,
55+
MessageDialog.QUESTION, 0,
56+
UIText.CommandConfirmationHardResetDialog_resetButtonLabel,
57+
IDialogConstants.CANCEL_LABEL);
58+
59+
return messageDialog.open() == Window.OK;
5260
}
5361
}

org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,3 +1949,5 @@ DiffStyleRangeFormatter_diffTruncated=[...] diff truncated after {0} lines.
19491949

19501950
StagingViewPreferencePage_title=Staging View
19511951
StagingViewPreferencePage_maxLimitListMode=Switch to compact mode if files number exceeds:
1952+
1953+
CommandConfirmationHardResetDialog_resetButtonLabel=&Reset

0 commit comments

Comments
 (0)