mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] suppresses channel switch notification for the first launch (IDEA-149673)
This commit is contained in:
@@ -38,6 +38,7 @@ import java.util.PropertyResourceBundle;
|
||||
* @author max
|
||||
*/
|
||||
public class ConfigImportHelper {
|
||||
private static final String FIRST_SESSION_KEY = "intellij.first.ide.session";
|
||||
private static final String CONFIG_IMPORTED_IN_CURRENT_SESSION_KEY = "intellij.config.imported.in.current.session";
|
||||
|
||||
private static final String BUILD_NUMBER_FILE = SystemInfo.isMac ? "/Resources/build.txt" : "build.txt";
|
||||
@@ -49,6 +50,8 @@ public class ConfigImportHelper {
|
||||
private ConfigImportHelper() { }
|
||||
|
||||
public static void importConfigsTo(@NotNull String newConfigPath) {
|
||||
System.setProperty(FIRST_SESSION_KEY, Boolean.TRUE.toString());
|
||||
|
||||
ConfigImportSettings settings = getConfigImportSettings();
|
||||
|
||||
File newConfigDir = new File(newConfigPath);
|
||||
@@ -80,6 +83,13 @@ public class ConfigImportHelper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} when the IDE is launched for the first time (i.e. there was no config directory).
|
||||
*/
|
||||
public static boolean isFirstSession() {
|
||||
return Boolean.getBoolean(FIRST_SESSION_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} when the IDE is launched for the first time, and configs were imported from another installation.
|
||||
*/
|
||||
|
||||
+5
-3
@@ -77,9 +77,11 @@ public class UpdateCheckerComponent implements ApplicationComponent {
|
||||
if (eap && current != ChannelStatus.EAP && UpdateStrategyCustomization.getInstance().forceEapUpdateChannelForEapBuilds()) {
|
||||
mySettings.setSelectedChannelStatus(ChannelStatus.EAP);
|
||||
LOG.info("channel forced to 'eap'");
|
||||
String title = IdeBundle.message("update.notifications.title");
|
||||
String message = IdeBundle.message("update.channel.enforced", ChannelStatus.EAP);
|
||||
notify(app, UpdateChecker.NOTIFICATIONS.createNotification(title, message, NotificationType.INFORMATION, null));
|
||||
if (!ConfigImportHelper.isFirstSession()) {
|
||||
String title = IdeBundle.message("update.notifications.title");
|
||||
String message = IdeBundle.message("update.channel.enforced", ChannelStatus.EAP);
|
||||
notify(app, UpdateChecker.NOTIFICATIONS.createNotification(title, message, NotificationType.INFORMATION, null));
|
||||
}
|
||||
}
|
||||
|
||||
if (!eap && current == ChannelStatus.EAP && ConfigImportHelper.isConfigImported()) {
|
||||
|
||||
Reference in New Issue
Block a user