Add missing part RIDER-50617
authorSasha Blashenkov <Sasha.Blashenkov@jetbrains.com>
Tue, 15 Dec 2020 18:55:45 +0000 (21:55 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 15 Dec 2020 19:07:19 +0000 (19:07 +0000)
GitOrigin-RevId: fedf75b426ad8e3cb4a8f47007fe9991edef1bbc

platform/platform-impl/src/com/intellij/idea/IdeStarter.kt

index d8259a68781ce737611cbe5586c2e1e3d7fd4932..307a6600b82d3ca3d7006d5e3e924c193639120b 100644 (file)
@@ -7,6 +7,7 @@ import com.intellij.diagnostic.runActivity
 import com.intellij.diagnostic.runChild
 import com.intellij.featureStatistics.fusCollectors.LifecycleUsageTriggerCollector
 import com.intellij.ide.*
+import com.intellij.ide.customize.CommonCustomizeIDEWizardDialog
 import com.intellij.ide.customize.CustomizeIDEWizardDialog
 import com.intellij.ide.customize.CustomizeIDEWizardStepsProvider
 import com.intellij.ide.impl.ProjectUtil
@@ -23,6 +24,7 @@ import com.intellij.openapi.actionSystem.ActionManager
 import com.intellij.openapi.actionSystem.IdeActions
 import com.intellij.openapi.application.*
 import com.intellij.openapi.application.ex.ApplicationManagerEx
+import com.intellij.openapi.application.impl.ApplicationInfoImpl
 import com.intellij.openapi.diagnostic.Logger
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.util.SystemInfo
@@ -181,17 +183,34 @@ open class IdeStarter : ApplicationStarter {
     }
     //do not show Customize IDE Wizard [IDEA-249516]
     if (System.getProperty("idea.show.customize.ide.wizard")?.toBoolean() == true) {
+      val stepsDialogName = if (System.getProperty("idea.temp.change.ide.wizard") != null) {
+        System.getProperty("idea.temp.change.ide.wizard") // temporary until 211 release
+      }
+      else {
+        ApplicationInfoImpl.getShadowInstance().customizeIDEWizardDialog
+      }
       wizardStepProvider?.let { wizardStepProvider ->
         var done = false
         runInEdt {
-          val wizardDialog = object : CustomizeIDEWizardDialog(wizardStepProvider, null, false, true) {
-            override fun doOKAction() {
-              super.doOKAction()
-              showWelcomeFrame?.run()
+          val wizardDialog = if (!stepsDialogName.isNullOrBlank()) {
+            try {
+              val dialogClass = Class.forName(stepsDialogName)
+              val constr = dialogClass.getConstructor(StartupUtil.AppStarter::class.java)
+              (constr.newInstance(null) as CommonCustomizeIDEWizardDialog)
+            } catch (e: Throwable) {
+              Main.showMessage(BootstrapBundle.message("bootstrap.error.title.configuration.wizard.failed"), e)
+              done = false
+              null
             }
           }
+          else {
+            CustomizeIDEWizardDialog(wizardStepProvider, null, false, true)
+          }
+          wizardDialog?.setRunAfterOKAction {
+            showWelcomeFrame?.run()
+          }
 
-          if (wizardDialog.showIfNeeded()) {
+          if (wizardDialog?.showIfNeeded() == true || wizardDialog == null) {
             done = true
           }
         }