From c56b80adc81948c3fe20cd67168a3a74a613d474 Mon Sep 17 00:00:00 2001 From: "Dmitry.Krasilschikov" Date: Tue, 20 Oct 2020 18:20:04 +0300 Subject: [PATCH] IDEA-253380 add "Show What's New in the editor after an IDE update" option GitOrigin-RevId: aea2776c97829a63d9f0dde753689f8348ad561e --- .../resources/messages/IdeBundle.properties | 1 + .../openapi/updateSettings/impl/UpdateOptions.kt | 3 +++ .../openapi/updateSettings/impl/UpdateSettings.java | 8 ++++++++ .../impl/UpdateSettingsConfigurable.java | 6 ++++++ .../updateSettings/impl/UpdatesSettingsPanel.form | 13 +++++++++++-- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/resources/messages/IdeBundle.properties b/platform/platform-api/resources/messages/IdeBundle.properties index ca73166bcf0d..18e57b90221e 100644 --- a/platform/platform-api/resources/messages/IdeBundle.properties +++ b/platform/platform-api/resources/messages/IdeBundle.properties @@ -2394,3 +2394,4 @@ title.advanced.options=Advanced Options name.variable=File name entered in the dialog template.file.name=Template to generate file name and path template.file.name.optional=Template to generate file name and path (optional) +updates.settings.show.editor=Show What's New in the editor after an IDE update diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateOptions.kt b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateOptions.kt index c3dc750e78da..49fec5cb317c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateOptions.kt +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateOptions.kt @@ -29,6 +29,9 @@ class UpdateOptions : BaseState() { @get:OptionTag("KEEP_PLUGINS_ARCHIVE") var isKeepPluginsArchive by property(true) + @get:OptionTag("SHOW_WHATS_NEW_EDITOR") + var isShowWhatsNewEditor by property(true) + @get:OptionTag("LAST_TIME_CHECKED") var lastTimeChecked by property(0L) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java index a89d8439f66e..bcec00ad90e7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java @@ -64,6 +64,14 @@ public class UpdateSettings implements PersistentStateComponent { myState.setKeepPluginsArchive(value); } + public boolean isShowWhatsNewEditor() { + return myState.isShowWhatsNewEditor(); + } + + public void setShowWhatsNewEditor(boolean value) { + myState.setShowWhatsNewEditor(value); + } + public List getEnabledExternalUpdateSources() { return myState.getEnabledExternalComponentSources(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java index a14a30e4a2e3..b91bd7d42ebe 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java @@ -17,6 +17,7 @@ import com.intellij.openapi.updateSettings.UpdateStrategyCustomization; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.CollectionComboBoxModel; import com.intellij.ui.JBColor; +import com.intellij.ui.components.JBCheckBox; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.labels.ActionLink; import com.intellij.util.text.DateFormatUtil; @@ -69,6 +70,7 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable { boolean wasEnabled = mySettings.isCheckNeeded(); mySettings.setCheckNeeded(myPanel.myCheckForUpdates.isSelected()); mySettings.setKeepPluginsArchive(myPanel.myCheckForKeepPluginsArchive.isSelected()); + mySettings.setShowWhatsNewEditor(myPanel.myShowWhatsNewEditor.isSelected()); if (wasEnabled != mySettings.isCheckNeeded()) { UpdateCheckerComponent checker = UpdateCheckerComponent.getInstance(); if (checker != null) { @@ -88,6 +90,7 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable { public void reset() { myPanel.myCheckForUpdates.setSelected(mySettings.isCheckNeeded()); myPanel.myCheckForKeepPluginsArchive.setSelected(mySettings.isKeepPluginsArchive()); + myPanel.myShowWhatsNewEditor.setSelected(mySettings.isShowWhatsNewEditor()); myPanel.updateLastCheckedLabel(); myPanel.setSelectedChannelType(mySettings.getSelectedActiveChannel()); } @@ -97,6 +100,7 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable { return myPanel != null && (myPanel.myCheckForUpdates.isSelected() != mySettings.isCheckNeeded() || myPanel.myCheckForKeepPluginsArchive.isSelected() != mySettings.isKeepPluginsArchive() || + myPanel.myShowWhatsNewEditor.isSelected() != mySettings.isShowWhatsNewEditor() || myPanel.myUpdateChannels.getSelectedItem() != mySettings.getSelectedActiveChannel()); } @@ -117,6 +121,7 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable { private JLabel myVersionNumber; private JLabel myLastCheckedDate; @SuppressWarnings("unused") private ActionLink myIgnoredBuildsLink; + private JBCheckBox myShowWhatsNewEditor; UpdatesSettingsPanel(boolean checkNowEnabled) { mySettings = UpdateSettings.getInstance(); @@ -128,6 +133,7 @@ public class UpdateSettingsConfigurable implements SearchableConfigurable { if (manager != null) { myCheckForUpdates.setText(IdeBundle.message("updates.settings.checkbox.external")); myCheckForKeepPluginsArchive.setText(IdeBundle.message("updates.settings.keep.plugins.archive")); + myShowWhatsNewEditor.setText(IdeBundle.message("updates.settings.show.editor")); myUpdateChannels.setVisible(false); myChannelWarning.setText(IdeBundle.message("updates.settings.external", manager.toolName)); myChannelWarning.setForeground(JBColor.GRAY); diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form index 5084194641f1..fdc145996622 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesSettingsPanel.form @@ -1,6 +1,6 @@
- + @@ -114,7 +114,7 @@ - + @@ -126,6 +126,15 @@ + + + + + + + + +