diff --git a/platform/platform-resources-en/src/messages/VcsBundle.properties b/platform/platform-resources-en/src/messages/VcsBundle.properties index 52d773e31b99..a7949548f095 100644 --- a/platform/platform-resources-en/src/messages/VcsBundle.properties +++ b/platform/platform-resources-en/src/messages/VcsBundle.properties @@ -17,7 +17,6 @@ none.vcs.presentation= vcs.command.name.add=Add vcs.command.name.remove=Remove vcs.command.name.checkin=Comm_it -vcs.command.name.checkin.no.mnemonics=Commit vcs.command.name.edit=Edit vcs.command.name.checkout=Checkout vcs.command.name.status=Status diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AbstractCommonCheckinAction.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AbstractCommonCheckinAction.kt index 0782d9d8dce4..ef5909016d9a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AbstractCommonCheckinAction.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AbstractCommonCheckinAction.kt @@ -13,6 +13,7 @@ import com.intellij.openapi.vcs.VcsBundle.message import com.intellij.openapi.vcs.changes.* import com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog import com.intellij.util.containers.ContainerUtil.concat +import com.intellij.util.ui.UIUtil.removeMnemonic private val LOG = logger() @@ -46,8 +47,10 @@ abstract class AbstractCommonCheckinAction : AbstractVcsAction(), UpdateInBackgr LOG.debug("actionPerformed. ") val project = context.project!! + val actionName = getActionName(context)?.let { removeMnemonic(it) } + val isFreezedDialogTitle = actionName?.let { "Can not $it now" } - if (ChangeListManager.getInstance(project).isFreezedWithNotification("Can not ${getMnemonicsFreeActionName(context)} now")) { + if (ChangeListManager.getInstance(project).isFreezedWithNotification(isFreezedDialogTitle)) { LOG.debug("ChangeListManager is freezed. returning.") } else if (ProjectLevelVcsManager.getInstance(project).isBackgroundVcsOperationRunning) { @@ -61,7 +64,8 @@ abstract class AbstractCommonCheckinAction : AbstractVcsAction(), UpdateInBackgr } } - protected open fun getMnemonicsFreeActionName(context: VcsContext): String? = getActionName(context) + @Deprecated("getActionName() will be used instead") + protected open fun getMnemonicsFreeActionName(context: VcsContext): String? = null protected abstract fun getRoots(dataContext: VcsContext): Array diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinFilesAction.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinFilesAction.kt index e118b4dffa3e..81be03219429 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinFilesAction.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinFilesAction.kt @@ -36,9 +36,6 @@ open class CommonCheckinFilesAction : AbstractCommonCheckinAction() { return message(pluralize(messageKey, roots.size), checkinActionName) } - override fun getMnemonicsFreeActionName(context: VcsContext): String = - appendSubject(context, message("vcs.command.name.checkin.no.mnemonics")) - override fun getInitiallySelectedChangeList(context: VcsContext, project: Project): LocalChangeList { val manager = ChangeListManager.getInstance(project) val defaultChangeList = manager.defaultChangeList diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinProjectAction.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinProjectAction.kt index 96ddc4919c21..e9f42fb6f422 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinProjectAction.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CommonCheckinProjectAction.kt @@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.actions import com.intellij.idea.ActionsBundle import com.intellij.openapi.vcs.FilePath import com.intellij.openapi.vcs.ProjectLevelVcsManager -import com.intellij.openapi.vcs.VcsBundle import com.intellij.vcsUtil.VcsUtil.getFilePath open class CommonCheckinProjectAction : AbstractCommonCheckinAction() { @@ -17,6 +16,4 @@ open class CommonCheckinProjectAction : AbstractCommonCheckinAction() { override fun approximatelyHasRoots(dataContext: VcsContext): Boolean = true override fun getActionName(dataContext: VcsContext): String = ActionsBundle.message("action.CheckinProject.text") - - override fun getMnemonicsFreeActionName(context: VcsContext): String = VcsBundle.message("vcs.command.name.checkin.no.mnemonics") }