From 78aaf627340ee24fae829553689f12b6586e0223 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 25 Jun 2019 15:32:44 +0300 Subject: [PATCH] Disable internal plugin bunch check if separate plugin is installed --- .../org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt index deedf28d76e..f046e224a42 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt @@ -7,6 +7,8 @@ package org.jetbrains.kotlin.idea.vcs import com.intellij.BundleBase.replaceMnemonicAmpersand import com.intellij.CommonBundle +import com.intellij.ide.plugins.PluginManager +import com.intellij.openapi.extensions.PluginId import com.intellij.openapi.project.Project import com.intellij.openapi.ui.Messages import com.intellij.openapi.ui.Messages.NO @@ -27,7 +29,10 @@ import java.io.File import javax.swing.JComponent import javax.swing.JPanel -private var Project.bunchFileCheckEnabled: Boolean by NotNullableUserDataProperty(Key.create("IS_BUNCH_FILE_CHECK_ENABLED"), true) +private val BUNCH_PLUGIN_ID = PluginId.getId("org.jetbrains.bunch.tool.idea.plugin") + +private var Project.bunchFileCheckEnabled: Boolean + by NotNullableUserDataProperty(Key.create("IS_BUNCH_FILE_CHECK_ENABLED_KOTLIN"), !PluginManager.isPluginInstalled(BUNCH_PLUGIN_ID)) class BunchFileCheckInHandlerFactory : CheckinHandlerFactory() { override fun createHandler(panel: CheckinProjectPanel, commitContext: CommitContext): CheckinHandler { @@ -38,6 +43,7 @@ class BunchFileCheckInHandlerFactory : CheckinHandlerFactory() { private val project get() = checkInProjectPanel.project override fun getBeforeCheckinConfigurationPanel(): RefreshableOnComponent? { + if (PluginManager.isPluginInstalled(BUNCH_PLUGIN_ID)) return null BunchFileUtils.bunchFile(project) ?: return null val bunchFilesCheckBox = NonFocusableCheckBox(replaceMnemonicAmpersand("Check &bunch files"))