action-update-thread: git

GitOrigin-RevId: d7fb8747bd22b7579e3e24152e78ae6e50b41835
This commit is contained in:
Aleksey Pivovarov
2022-06-23 16:29:49 +02:00
committed by intellij-monorepo-bot
parent 60fb7c9e5e
commit cab26477e9
5 changed files with 25 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
package git4idea.commands
import com.google.common.annotations.VisibleForTesting
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
@@ -183,4 +184,8 @@ class TestGitHttpLoginDialogAction : AnAction() {
}
}
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package git4idea.merge
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
import com.intellij.openapi.project.DumbAwareAction
@@ -38,6 +39,10 @@ abstract class GitConflictAction(text: Supplier<@Nls String>) :
e.presentation.isEnabled = isEnabled(project, nodes)
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
override fun actionPerformed(e: AnActionEvent) {
val project = e.project!!
val nodes = getConflicts(project, e)

View File

@@ -15,6 +15,7 @@
*/
package git4idea.remote
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.DumbAwareAction
import git4idea.GitUtil.getRepositoryManager
@@ -24,6 +25,10 @@ class GitConfigureRemotesAction : DumbAwareAction() {
e.presentation.isEnabledAndVisible = e.project != null && !getRepositoryManager(e.project!!).repositories.isEmpty()
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
override fun actionPerformed(e: AnActionEvent) {
val project = e.project!!
GitConfigureRemotesDialog(project, getRepositoryManager(project).repositories).show()

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package git4idea.stash.ui
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
import com.intellij.openapi.project.DumbAwareAction
@@ -14,6 +15,10 @@ class GitRefreshStashesAction : DumbAwareAction() {
}
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
override fun actionPerformed(e: AnActionEvent) {
e.project!!.service<GitStashTracker>().scheduleRefresh()
}

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package git4idea.stash.ui
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataKey
import com.intellij.openapi.components.serviceIfCreated
@@ -22,6 +23,10 @@ abstract class GitSingleStashAction : DumbAwareAction() {
e.presentation.isVisible = e.isFromActionToolbar || (e.project != null && e.getData(STASH_INFO) != null)
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
override fun actionPerformed(e: AnActionEvent) {
if (perform(e.project!!, e.getRequiredData(STASH_INFO).single())) {
e.project!!.serviceIfCreated<GitStashTracker>()?.scheduleRefresh()