mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: Deprecate "AbstractCommonCheckinAction.getMnemonicsFreeActionName()"
Use "getActionName()" directly instead
This commit is contained in:
@@ -17,7 +17,6 @@ none.vcs.presentation=<none>
|
||||
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
|
||||
|
||||
+6
-2
@@ -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<AbstractCommonCheckinAction>()
|
||||
|
||||
@@ -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<FilePath>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user