vcs: strip mnemonics before using executor action text in commit dialog title

This commit is contained in:
Aleksey Pivovarov
2018-04-10 16:17:37 +03:00
parent f069b27e47
commit 7e7d8a30c5
@@ -300,7 +300,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
myHandlers.addAll(createCheckinHandlers(project, this, myCommitContext));
setTitle(myShowVcsCommit ? TITLE : trimEllipsis(executors.get(0).getActionText()));
setTitle(myShowVcsCommit ? TITLE : getExecutorPresentableText(executors.get(0)));
myCommitActionName = getCommitActionName(myAffectedVcses);
myExecutorActions = createExecutorActions(executors);
if (myShowVcsCommit) {
@@ -638,7 +638,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
JComponent configurationUI = SessionDialog.createConfigurationUI(session, getIncludedChanges(), getCommitMessage());
if (configurationUI != null) {
DialogWrapper sessionDialog =
new SessionDialog(commitExecutor.getActionText(), getProject(), session, getIncludedChanges(), getCommitMessage(),
new SessionDialog(getExecutorPresentableText(commitExecutor), getProject(), session, getIncludedChanges(), getCommitMessage(),
configurationUI);
if (!sessionDialog.showAndGet()) {
session.executionCanceled();
@@ -1084,9 +1084,14 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
return myBrowser.getData(dataId);
}
@NotNull
static String getExecutorPresentableText(@NotNull CommitExecutor executor) {
return trimEllipsis(removeMnemonic(executor.getActionText()));
}
@NotNull
static String trimEllipsis(@NotNull String title) {
return StringUtil.trimEnd(title, "...");
return StringUtil.trimEnd(StringUtil.trimEnd(title, "..."), "\u2026");
}
private void ensureDataIsActual(@NotNull Runnable runnable) {