IDEA-253380 add "Show What's New in the editor after an IDE update" option

GitOrigin-RevId: aea2776c97829a63d9f0dde753689f8348ad561e
This commit is contained in:
Dmitry.Krasilschikov
2020-10-20 15:34:28 +00:00
committed by intellij-monorepo-bot
parent 5ac0a9f911
commit c56b80adc8
5 changed files with 29 additions and 2 deletions
@@ -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
@@ -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)
@@ -64,6 +64,14 @@ public class UpdateSettings implements PersistentStateComponent<UpdateOptions> {
myState.setKeepPluginsArchive(value);
}
public boolean isShowWhatsNewEditor() {
return myState.isShowWhatsNewEditor();
}
public void setShowWhatsNewEditor(boolean value) {
myState.setShowWhatsNewEditor(value);
}
public List<String> getEnabledExternalUpdateSources() {
return myState.getEnabledExternalComponentSources();
}
@@ -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);
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.updateSettings.impl.UpdateSettingsConfigurable.UpdatesSettingsPanel">
<grid id="5aa87" binding="myPanel" layout-manager="GridLayoutManager" row-count="10" column-count="6" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="5aa87" binding="myPanel" layout-manager="GridLayoutManager" row-count="11" column-count="6" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="62" y="37" width="816" height="434"/>
@@ -114,7 +114,7 @@
</component>
<vspacer id="3d6db">
<constraints>
<grid row="9" column="1" row-span="1" col-span="5" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="10" column="1" row-span="1" col-span="5" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="53064" class="javax.swing.JCheckBox" binding="myCheckForKeepPluginsArchive">
@@ -126,6 +126,15 @@
<text resource-bundle="messages/IdeBundle" key="updates.settings.keep.plugins.archive"/>
</properties>
</component>
<component id="474a7" class="com.intellij.ui.components.JBCheckBox" binding="myShowWhatsNewEditor">
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<selected value="true"/>
<text resource-bundle="messages/IdeBundle" key="updates.settings.show.editor"/>
</properties>
</component>
</children>
</grid>
</form>