Make disabled verification visible in UI

This commit is contained in:
Nikolay Krasko
2018-06-25 15:31:09 +03:00
parent 0c45f20515
commit 54bb09a5fb
2 changed files with 39 additions and 2 deletions
@@ -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="4" 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="5" 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,7 +19,7 @@
</component>
<vspacer id="42b13">
<constraints>
<grid row="3" 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="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"/>
</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">
@@ -100,6 +100,30 @@
</component>
</children>
</grid>
<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"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="290b2" class="javax.swing.JLabel" binding="verifierDisabledText">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<foreground color="-65536"/>
<text value="(status)"/>
</properties>
</component>
<hspacer id="edb4">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
</form>
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.idea.configuration.ui;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.ui.AsyncProcessIcon;
import javax.swing.*;
@@ -17,6 +18,7 @@ public class ConfigurePluginUpdatesForm {
public JLabel updateStatusLabel;
public JButton installButton;
public JLabel installStatusLabel;
private JLabel verifierDisabledText;
public ConfigurePluginUpdatesForm() {
int size = channelCombo.getModel().getSize();
@@ -28,6 +30,7 @@ public class ConfigurePluginUpdatesForm {
}
}
channelCombo.setPrototypeDisplayValue(maxLengthItem + " ");
showVerifierDisabledStatus();
}
private void createUIComponents() {
@@ -59,4 +62,14 @@ public class ConfigurePluginUpdatesForm {
installButton.setEnabled(false);
installButton.setVisible(false);
}
private void showVerifierDisabledStatus() {
//noinspection UnresolvedPropertyKey
if (!Registry.is("kotlin.plugin.update.verifier.enabled", true)) {
verifierDisabledText.setText("(verifier disabled)");
}
else {
verifierDisabledText.setText("");
}
}
}