[lvcs] extract local history isEnabled API (IJPL-161713)

GitOrigin-RevId: 18a6bbdf87ff7b1919fdd745870820c5fa4c1826
This commit is contained in:
Dmitry Zhuravlev
2024-09-09 17:42:01 +02:00
committed by intellij-monorepo-bot
parent d90f879649
commit 8b44f407ee
5 changed files with 19 additions and 9 deletions

View File

@@ -49,8 +49,10 @@ class LocalHistoryImpl(private val coroutineScope: CoroutineScope) : LocalHistor
private var daysToKeep = getInt(DAYS_TO_KEEP)
var isDisabled: Boolean = false
private set
override val isEnabled: Boolean
get() = !isDisabled
private var isDisabled: Boolean = false
var facade: LocalHistoryFacade? = null
private set

View File

@@ -2,6 +2,7 @@
package com.intellij.history.integration.ui.actions;
import com.intellij.history.LocalHistory;
import com.intellij.history.core.LocalHistoryFacade;
import com.intellij.history.integration.IdeaGateway;
import com.intellij.history.integration.LocalHistoryImpl;
@@ -19,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class LocalHistoryAction extends AnAction implements DumbAware {
@Override
public void update(@NotNull AnActionEvent e) {
if (LocalHistoryImpl.getInstanceImpl().isDisabled()) {
if (!LocalHistory.getInstance().isEnabled()) {
e.getPresentation().setEnabledAndVisible(false);
return;
}