Show current Kotlin installed version in update form (KT-25255)

#KT-25255 Fixed
This commit is contained in:
Nikolay Krasko
2018-07-09 17:45:03 +03:00
parent 90f1829fb8
commit aa21e9c3bc
3 changed files with 36 additions and 6 deletions
@@ -138,7 +138,7 @@ class KotlinUpdatesSettingsConfigurable : SearchableConfigurable, Configurable.N
when (pluginUpdateStatus) {
PluginUpdateStatus.LatestVersionInstalled -> {
form.setUpdateStatus(
"You have the latest version of the plugin (${KotlinPluginUtil.getPluginVersion()}) installed.",
"You have the latest version of the plugin installed.",
false
)
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.kotlin.idea.configuration.ui.ConfigurePluginUpdatesForm">
<grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@@ -19,13 +19,13 @@
</component>
<vspacer id="42b13">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<grid id="2505b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -42,7 +42,7 @@
</grid>
<grid id="b171" layout-manager="FlowLayout" hgap="-1" vgap="5" flow-align="0">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -103,7 +103,7 @@
<grid id="6a5b2" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -124,6 +124,33 @@
</hspacer>
</children>
</grid>
<grid id="cec56" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="f62d1" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Current Kotlin plugin version:"/>
</properties>
</component>
<component id="e71d" class="javax.swing.JTextPane" binding="currentVersion">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<editable value="false"/>
<text value="{version}"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.idea.configuration.ui;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.ui.AsyncProcessIcon;
import org.jetbrains.kotlin.idea.KotlinPluginUtil;
import javax.swing.*;
@@ -19,6 +20,7 @@ public class ConfigurePluginUpdatesForm {
public JButton installButton;
public JLabel installStatusLabel;
private JLabel verifierDisabledText;
private JTextPane currentVersion;
public ConfigurePluginUpdatesForm() {
int size = channelCombo.getModel().getSize();
@@ -31,6 +33,7 @@ public class ConfigurePluginUpdatesForm {
}
channelCombo.setPrototypeDisplayValue(maxLengthItem + " ");
showVerifierDisabledStatus();
currentVersion.setText(KotlinPluginUtil.getPluginVersion());
}
private void createUIComponents() {