Skip to content

Commit 4d446b3

Browse files
committed
BackgroundTaskQueue deprecated
1 parent 3e9158b commit 4d446b3

File tree

1 file changed

+9
-3
lines changed
  • src/main/kotlin/com/github/oldmegit/goframehelper/startup

1 file changed

+9
-3
lines changed

src/main/kotlin/com/github/oldmegit/goframehelper/startup/StartUp.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,24 @@ package com.github.oldmegit.goframehelper.startup
22

33
import com.github.oldmegit.goframehelper.data.Bundle
44
import com.github.oldmegit.goframehelper.gf.GfGoMod
5-
import com.intellij.openapi.progress.BackgroundTaskQueue
65
import com.intellij.openapi.progress.ProgressIndicator
6+
import com.intellij.openapi.progress.ProgressManager
77
import com.intellij.openapi.progress.Task
88
import com.intellij.openapi.project.Project
99
import com.intellij.openapi.startup.StartupActivity
1010

11+
1112
class StartUp : StartupActivity {
1213
override fun runActivity(project: Project) {
13-
val task = BackgroundTaskQueue(project, Bundle.getMessage("name"))
14-
task.run(object : Task.Backgroundable(project, Bundle.getMessage("init")) {
14+
val taskTitle = Bundle.getMessage("name")
15+
ProgressManager.getInstance().run(object : Task.Backgroundable(project, taskTitle) {
1516
override fun run(indicator: ProgressIndicator) {
17+
if (indicator.isCanceled) {
18+
return
19+
}
20+
indicator.text = Bundle.getMessage("init")
1621
GfGoMod.reset(project)
22+
indicator.fraction = 1.0
1723
}
1824
})
1925
}

0 commit comments

Comments
 (0)