Disable internal plugin bunch check if separate plugin is installed

This commit is contained in:
Nikolay Krasko
2019-06-25 15:32:44 +03:00
parent a1462407f9
commit 78aaf62734
@@ -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"))