Modify files related to welcome wizard
authorSasha Blashenkov <sasha.blashenkov@jetbrains.com>
Wed, 5 May 2021 14:28:47 +0000 (07:28 -0700)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Mon, 10 May 2021 21:31:00 +0000 (21:31 +0000)
GitOrigin-RevId: dda8dbbe6a31b9d96eca1a8640628c7823bf9c9e

platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationInfoEx.java
platform/platform-impl/src/com/intellij/idea/IdeStarter.kt
platform/platform-impl/src/com/intellij/idea/StartupUtil.java
platform/platform-resources/src/idea/ApplicationInfo.xsd

index 5a56be871f7349f98cd62741610d78f274728664..3b522ab66b575f470b7d2faac6df894b5d65f164 100644 (file)
@@ -124,9 +124,7 @@ public abstract class ApplicationInfoEx extends ApplicationInfo {
 
   public abstract boolean isEssentialPlugin(@NotNull PluginId pluginId);
 
-  public abstract @Nullable String getCustomizeIDEWizardDialog();
-
-  public abstract @Nullable String getCustomizeIDEWizardStepsProvider();
+  public abstract @Nullable String getWelcomeWizardDialog();
 
   public abstract int @Nullable [] getAboutLogoRect();
 
index 6edd6f64ed85e3e2bdc3aac3598ca91d2ae020a0..be19211498647d90e478195aa6c53027beeb1e40 100644 (file)
@@ -9,8 +9,6 @@ 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
 import com.intellij.ide.lightEdit.LightEditService
@@ -23,7 +21,6 @@ import com.intellij.openapi.actionSystem.ActionManager
 import com.intellij.openapi.application.*
 import com.intellij.openapi.application.ex.ApplicationEx
 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
@@ -114,7 +111,7 @@ open class IdeStarter : ApplicationStarter {
     }
 
     if (JetBrainsProtocolHandler.appStartedWithCommand()) {
-      val needToOpenProject = showWizardAndWelcomeFrame(lifecyclePublisher, willOpenProject = false)
+      val needToOpenProject = showWelcomeFrame(lifecyclePublisher, willOpenProject = false)
       frameInitActivity.end()
       LifecycleUsageTriggerCollector.onIdeStart()
 
@@ -131,7 +128,7 @@ open class IdeStarter : ApplicationStarter {
       val recentProjectManager = RecentProjectsManager.getInstance()
       val willReopenRecentProjectOnStart = recentProjectManager.willReopenProjectOnStart()
       val willOpenProject = willReopenRecentProjectOnStart || !args.isEmpty() || !filesToLoad.isEmpty()
-      val needToOpenProject = showWizardAndWelcomeFrame(lifecyclePublisher, willOpenProject)
+      val needToOpenProject = showWelcomeFrame(lifecyclePublisher, willOpenProject)
       frameInitActivity.end()
       ForkJoinPool.commonPool().execute {
         LifecycleUsageTriggerCollector.onIdeStart()
@@ -163,47 +160,14 @@ open class IdeStarter : ApplicationStarter {
     return CompletableFuture.completedFuture(null)
   }
 
-  private fun showWizardAndWelcomeFrame(lifecyclePublisher: AppLifecycleListener, willOpenProject: Boolean): Boolean {
+  private fun showWelcomeFrame(lifecyclePublisher: AppLifecycleListener, willOpenProject: Boolean): Boolean {
     val doShowWelcomeFrame = if (willOpenProject) null else WelcomeFrame.prepareToShow()
-    // do not show Customize IDE Wizard [IDEA-249516]
-    val wizardStepProvider = wizardStepProvider
-    if (wizardStepProvider == null || System.getProperty("idea.show.customize.ide.wizard")?.toBoolean() != true) {
-      if (doShowWelcomeFrame == null) {
-        return true
-      }
 
-      ApplicationManager.getApplication().invokeLater {
-        doShowWelcomeFrame.run()
-        lifecyclePublisher.welcomeScreenDisplayed()
-      }
-      return false
-    }
+    if (doShowWelcomeFrame == null) return true
 
-    // temporary until 211 release
-    val stepDialogName = System.getProperty("idea.temp.change.ide.wizard")
-                         ?: ApplicationInfoImpl.getShadowInstance().customizeIDEWizardDialog
     ApplicationManager.getApplication().invokeLater {
-      val wizardDialog: CommonCustomizeIDEWizardDialog?
-      if (stepDialogName.isNullOrBlank()) {
-        wizardDialog = CustomizeIDEWizardDialog(wizardStepProvider, null, false, true)
-      }
-      else {
-        wizardDialog = try {
-          Class.forName(stepDialogName).getConstructor(StartupUtil.AppStarter::class.java)
-            .newInstance(null) as CommonCustomizeIDEWizardDialog
-        }
-        catch (e: Throwable) {
-          Main.showMessage(BootstrapBundle.message("bootstrap.error.title.configuration.wizard.failed"), e)
-          null
-        }
-      }
-
-      wizardDialog?.showIfNeeded()
-
-      if (doShowWelcomeFrame != null) {
-        doShowWelcomeFrame.run()
-        lifecyclePublisher.welcomeScreenDisplayed()
-      }
+      doShowWelcomeFrame.run()
+      lifecyclePublisher.welcomeScreenDisplayed()
     }
     return false
   }
index 9112d74f1a72f0257ae3f7f9072d5d0c12867e06..3432521dd1741d93cd3cd57da8e3857b257aff44 100644 (file)
@@ -915,45 +915,24 @@ public final class StartupUtil {
     return path;
   }
 
+  /**
+   * Used in Rider
+   */
   private static void runStartupWizard(@NotNull AppStarter appStarter) {
-    String stepsProviderName = ApplicationInfoImpl.getShadowInstance().getCustomizeIDEWizardStepsProvider();
-    if (stepsProviderName == null) {
-      return;
-    }
+    String stepsDialogName = ApplicationInfoImpl.getShadowInstance().getWelcomeWizardDialog();
+    if (stepsDialogName == null) return;
 
-    CustomizeIDEWizardStepsProvider provider;
     try {
-      Class<?> providerClass = Class.forName(stepsProviderName);
-      provider = (CustomizeIDEWizardStepsProvider)providerClass.getDeclaredConstructor().newInstance();
+      Class<?> dialogClass = Class.forName(stepsDialogName);
+      Constructor<?> constr = dialogClass.getConstructor(AppStarter.class);
+      ((CommonCustomizeIDEWizardDialog) constr.newInstance(appStarter)).showIfNeeded();
     }
     catch (Throwable e) {
       Main.showMessage(BootstrapBundle.message("bootstrap.error.title.configuration.wizard.failed"), e);
       return;
     }
 
-    appStarter.beforeStartupWizard();
-
-    String stepsDialogName = ApplicationInfoImpl.getShadowInstance().getCustomizeIDEWizardDialog();
-    if (System.getProperty("idea.temp.change.ide.wizard") != null) { // temporary until 211 release
-      stepsDialogName = System.getProperty("idea.temp.change.ide.wizard");
-    }
-    if (stepsDialogName != null) {
-      try {
-        Class<?> dialogClass = Class.forName(stepsDialogName);
-        Constructor<?> constr = dialogClass.getConstructor(AppStarter.class);
-        ((CommonCustomizeIDEWizardDialog) constr.newInstance(appStarter)).showIfNeeded();
-      }
-      catch (Throwable e) {
-        Main.showMessage(BootstrapBundle.message("bootstrap.error.title.configuration.wizard.failed"), e);
-        return;
-      }
-    }
-    else if (Boolean.parseBoolean(System.getProperty("idea.show.customize.ide.wizard"))) {
-      new CustomizeIDEWizardDialog(provider, appStarter, true, false).showIfNeeded();
-    }
-
     PluginManagerCore.invalidatePlugins();
-    appStarter.startupWizardFinished(provider);
   }
 
   // must be called from EDT
index 44542e425c23db6554c14162cbf988a1b0bfb723..a3290c62fae4e1448869c5360ab8379a04bee3d3 100644 (file)
@@ -16,7 +16,7 @@
         <xs:element type="namesType" name="names"/>
         <xs:element type="essentialPluginType" name="essential-plugin" minOccurs="0" maxOccurs="unbounded"/>
         <xs:element type="welcome-screenType" name="welcome-screen"/>
-        <xs:element type="customize-ide-wizardType" name="customize-ide-wizard" minOccurs="0"/>
+        <xs:element type="welcome-wizardType" name="welcome-wizard" minOccurs="0"/>
         <xs:element type="pluginsPageType" name="plugins-page" minOccurs="0" maxOccurs="unbounded">
           <xs:annotation>
             <xs:documentation>
   <xs:complexType name="welcome-screenType">
     <xs:attribute type="xs:string" name="logo-url" use="required"/>
   </xs:complexType>
-  <xs:complexType name="customize-ide-wizardType">
-    <xs:attribute type="xs:string" name="provider" use="required"/>
-    <xs:attribute type="xs:string" name="dialog" />
+  <xs:complexType name="welcome-wizardType">
+    <xs:attribute type="xs:string" name="dialog" use="required" />
   </xs:complexType>
   <xs:complexType name="editorType">
     <xs:attribute type="xs:string" name="background-url" use="required"/>