PY-84031: Introduce registry key to disable opening files in welcome screen for PyCharm

Space-RevId: 9acd4498039dde453b98116358698dc31eb0bf89

GitOrigin-RevId: 62b19feb98a47015d843c553b64446d699882df1
This commit is contained in:
Ilia Zakoulov
2026-02-03 23:35:47 +00:00
committed by intellij-monorepo-bot
parent a3caebb1d5
commit 7e1a54bb1f
2 changed files with 6 additions and 0 deletions
@@ -34,6 +34,7 @@
<platform.ide.welcomeScreenFeatureBackend implementation="com.intellij.pycharm.community.ide.impl.newProjectWizard.welcome.PyLearnWelcomeScreenFeature"/>
<platform.ide.welcomeScreenFeatureBackend implementation="com.intellij.pycharm.community.ide.impl.newProjectWizard.welcome.PyImportFileWelcomeScreenFeature"/>
<platform.ide.welcomeScreenFeatureBackend implementation="com.intellij.pycharm.community.ide.impl.newProjectWizard.welcome.PyPluginsWelcomeScreenFeature"/>
<registryKey defaultValue="true" description="Open non-project files in welcome screen" key="welcome.screen.open.files"/>
<statistics.validation.customValidationRule
implementation="com.intellij.pycharm.community.ide.impl.miscProject.impl.MiscProjectUsageCollectorValidationRule"/>
@@ -5,6 +5,7 @@ import com.intellij.openapi.application.EDT
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ex.ProjectEx
import com.intellij.openapi.ui.MessageDialogBuilder
import com.intellij.openapi.util.registry.Registry
import com.intellij.openapi.wm.ex.WelcomeScreenProjectProvider
import com.intellij.platform.PlatformProjectOpenProcessor
import com.intellij.pycharm.community.ide.impl.PyCharmCommunityCustomizationBundle
@@ -34,6 +35,10 @@ internal class PyCharmWelcomeScreenProjectProvider : WelcomeScreenProjectProvide
override fun doGetCreateNewFileProjectPrefix(): String = "awesomeProject"
override fun canOpenFilesFromSystemFileManager(): Boolean {
return Registry.`is`("welcome.screen.open.files", false)
}
override suspend fun doCreateOrOpenWelcomeScreenProject(path: Path): Project {
val project = super.doCreateOrOpenWelcomeScreenProject(path)
// The name might be a MiscProject, since we are reusing that project.