mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DBE-26672 [datagrip]: Re-enable all close actions regardless of the non-modal welcome screen being enabled or disabled
DBE-26672 [datagrip]: Allow the relaunching a closed project into the default welcome project to be configurable DBE-26672 [datagrip]: Rollback reopen projects on startup mode to allow it to be user-configurable again Merge-request: IJ-MR-216672 Merged-by: Scott Faria <scott.faria@jetbrains.com> (cherry picked from commit f4bfd294e8047855b9cd036186af7677d6f28162) IJ-MR-216891 GitOrigin-RevId: 76ffb0bf1626688925ee638976c541d7118707f1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
212f5e8006
commit
4b4f2a0d85
+2
-1
@@ -19,7 +19,8 @@ suspend fun Project.isWelcomeExperienceProject(): Boolean {
|
||||
return ProjectFrameCapabilitiesService.getInstance().has(this, ProjectFrameCapability.WELCOME_EXPERIENCE)
|
||||
}
|
||||
|
||||
internal fun Project.isWelcomeExperienceProjectSync(): Boolean {
|
||||
@Internal
|
||||
fun Project.isWelcomeExperienceProjectSync(): Boolean {
|
||||
@Suppress("DEPRECATION")
|
||||
return ProjectFrameCapabilitiesService.getInstanceSync().has(this, ProjectFrameCapability.WELCOME_EXPERIENCE)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.ApiStatus
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
class CloseOtherProjectsAction : CloseProjectsActionBase() {
|
||||
open class CloseOtherProjectsAction : CloseProjectsActionBase() {
|
||||
init {
|
||||
val uiCustomization = IdeUICustomization.getInstance()
|
||||
templatePresentation.setText(uiCustomization.projectMessagePointer("action.close.other.projects.text"))
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.intellij.openapi.wm.WindowManager
|
||||
import com.intellij.openapi.wm.impl.ProjectFrameHelper
|
||||
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame
|
||||
import com.intellij.ui.ComponentUtil
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
@@ -21,9 +22,13 @@ abstract class CloseProjectsActionBase : DumbAwareAction(), ActionRemoteBehavior
|
||||
init {
|
||||
templatePresentation.isApplicationScope = true
|
||||
}
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val currentProject = getProjectEvenIfNotInitialized(e) ?: return
|
||||
|
||||
// This needs to be called early because once the current project is disposed we lose the ability to check on things like
|
||||
// ProjectFrameCapability
|
||||
val shouldReopenWelcomeFrameAfterClose = shouldReopenWelcomeFrameAfterClose(currentProject)
|
||||
|
||||
ProjectManager.getInstance().openProjects
|
||||
.filter { canClose(it, currentProject) }
|
||||
.forEach {
|
||||
@@ -39,9 +44,14 @@ abstract class CloseProjectsActionBase : DumbAwareAction(), ActionRemoteBehavior
|
||||
RecentProjectsManager.getInstance().updateLastProjectPath()
|
||||
}
|
||||
|
||||
showWelcomeFrameIfNeeded()
|
||||
if (shouldReopenWelcomeFrameAfterClose) {
|
||||
showWelcomeFrameIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
protected open fun shouldReopenWelcomeFrameAfterClose(project: Project): Boolean = true
|
||||
|
||||
protected open fun showWelcomeFrameIfNeeded() {
|
||||
WelcomeFrame.showIfNoProjectOpened()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user