Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-08-21 11:06:30 -0400
committerThomas Wolf2019-08-21 12:08:20 -0400
commit70207c34222a4bcb0fc56c3810080dd5e5621430 (patch)
treef003bd9965b8d4e8d7c8395c30cdb345334e42ee /org.eclipse.egit.ui
parent9a0e6920c9e134d8a7848ca289645e79f9e4d6fa (diff)
downloadegit-70207c34222a4bcb0fc56c3810080dd5e5621430.tar.gz
egit-70207c34222a4bcb0fc56c3810080dd5e5621430.tar.xz
egit-70207c34222a4bcb0fc56c3810080dd5e5621430.zip
Shorten confirmation messages for "reset hard" and "discard changes"
Eliminate the "Are you sure?"-like extra questions. They're not necessary; the dialogs tell the user what's going to happen and present a "Reset"/"Discard Changes" button and a "Cancel" button. The explicit questions were a left-over from older code where the dialogs had just "Yes"/"No" or "OK"/"Cancel" buttons. Incidentally constructing the message texts becomes simpler because the warning text about running launches doesn't have to be inserted somewhere in the middle but can simply be tacked onto the end. Bug: 550292 Bug: 550293 Change-Id: I9365737ef08fe43f29142ca1ae6851464282a334 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java20
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties6
3 files changed, 10 insertions, 18 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
index 1df4287ec..3287530e1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java
@@ -1981,7 +1981,7 @@ public class UIText extends NLS {
public static String ResetTargetSelectionDialog_ResetConfirmQuestion;
/** */
- public static String ResetTargetSelectionDialog_ResetQuestion;
+ public static String ResetTargetSelectionDialog_ResetConfirmTitle;
/** */
public static String ResetTargetSelectionDialog_ResetTitle;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java
index bceb780b6..e05b11b48 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommandConfirmation.java
@@ -55,17 +55,13 @@ public class CommandConfirmation {
.getRunningLaunchConfiguration(Collections.singleton(repo),
null);
if (launch != null) {
- question = MessageFormat.format(question,
- "\n\n" + MessageFormat.format( //$NON-NLS-1$
- UIText.LaunchFinder_RunningLaunchMessage,
- launch));
- } else {
- question = MessageFormat.format(question, ""); //$NON-NLS-1$
+ question += "\n\n" + MessageFormat.format( //$NON-NLS-1$
+ UIText.LaunchFinder_RunningLaunchMessage, launch);
}
MessageDialog messageDialog = new MessageDialog(shell,
- UIText.ResetTargetSelectionDialog_ResetQuestion, null, question,
- MessageDialog.QUESTION,
+ UIText.ResetTargetSelectionDialog_ResetConfirmTitle, null,
+ question, MessageDialog.QUESTION,
new String[] {
UIText.CommandConfirmationHardResetDialog_resetButtonLabel,
IDialogConstants.CANCEL_LABEL },
@@ -113,12 +109,8 @@ public class CommandConfirmation {
String launch = LaunchFinder
.getRunningLaunchConfiguration(repoAndPaths.keySet(), null);
if (launch != null) {
- question = MessageFormat.format(question,
- "\n\n" + MessageFormat.format( //$NON-NLS-1$
- UIText.LaunchFinder_RunningLaunchMessage,
- launch));
- } else {
- question = MessageFormat.format(question, ""); //$NON-NLS-1$
+ question += "\n\n" + MessageFormat.format( //$NON-NLS-1$
+ UIText.LaunchFinder_RunningLaunchMessage, launch);
}
Shell parent = shell != null ? shell
: PlatformUI.getWorkbench().getModalDialogShellProvider()
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
index a8e7b9567..bbc06d2fc 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties
@@ -683,8 +683,8 @@ ResetTargetSelectionDialog_DetachedHeadState=You are in the 'detached HEAD' stat
ResetTargetSelectionDialog_ExpressionLabel=Reset to (&expression):
ResetTargetSelectionDialog_ExpressionTooltip=Any Git expression resolving to a commit
ResetTargetSelectionDialog_ResetButton=&Reset
-ResetTargetSelectionDialog_ResetConfirmQuestion=Resetting will overwrite any changes in your working tree.{0}\n\nDo you want to continue?
-ResetTargetSelectionDialog_ResetQuestion=Confirm Reset
+ResetTargetSelectionDialog_ResetConfirmQuestion=Reset and overwrite any changes in your working tree?
+ResetTargetSelectionDialog_ResetConfirmTitle=Confirm Reset
ResetTargetSelectionDialog_ResetTitle=Reset: {0}
ResetTargetSelectionDialog_ResetTypeGroup=Reset type
ResetTargetSelectionDialog_ResetTypeHardButton=&Hard (HEAD, index, and working tree updated)
@@ -1363,7 +1363,7 @@ DiffEditorPage_Title=Diff
DiffEditorPage_ToggleLineNumbers=Use Old/New &Line Numbers
DiffEditorPage_WarningNoDiffForMerge=Cannot compute diff for a merge commit.
DiscardChangesAction_confirmActionTitle=Discard Uncommitted Changes
-DiscardChangesAction_confirmActionMessage=This will discard all uncommitted changes for the selected resources. Untracked files will be ignored.{0}\n\nAre you sure you want to do this?
+DiscardChangesAction_confirmActionMessage=Discard all uncommitted changes for the selected resources?\n\n Untracked files will be ignored.
DiscardChangesAction_discardChanges=Discard Changes
DiscardChangesAction_discardChangesButtonText=&Discard Changes
Disconnect_disconnect=Disconnect

Back to the top