add version in ui

Signed-off-by: pengzhile <pengzhile@gmail.com>
pull/8/head
pengzhile 2020-11-12 17:04:47 +08:00
parent 86d96d4ad2
commit 8c0786f1e7
7 changed files with 59 additions and 30 deletions

View File

@ -1,6 +1,6 @@
# Reset Your IDE Eval Information
1. Download and install plugin from [Release Page](https://gitee.com/pengzhile/ide-eval-resetter/attach_files/518325/download/ide-eval-resetter-2.1.2.zip).
1. Download and install plugin from [Download Link](https://plugins.zhile.io/files/ide-eval-resetter-2.1.3.zip).
* Alternative installation method:
* Add "Custom Plugin Repository": `https://plugins.zhile.io` manually (`Settings/Preferences` -> `Plugins`)
* Search and install plugin: `IDE Eval Reset`

View File

@ -4,7 +4,7 @@ plugins {
}
group 'io.zhile.research.intellij'
version '2.1.2'
version '2.1.3'
sourceCompatibility = 1.8
targetCompatibility = 1.8
@ -29,6 +29,8 @@ intellij {
patchPluginXml {
changeNotes """<pre>
Release v2.1.3
1. add version in UI
Release v2.1.2
1. fix third party plugins switch
Release v2.1.1

View File

@ -41,7 +41,7 @@ public class ResetAction extends AnAction implements DumbAware {
}
if (project == null) {
MainDialog mainDialog = new MainDialog();
MainDialog mainDialog = new MainDialog(ACTION_NAME);
mainDialog.show();
return;

View File

@ -13,6 +13,7 @@ public class Constants {
public static final PluginId PLUGIN_ID = CLASS_LOADER.getPluginId();
public static final IdeaPluginDescriptor PLUGIN_DESC = PluginManager.getPlugin(PLUGIN_ID);
public static final String PLUGIN_NAME = PLUGIN_DESC.getName();
public static final String PLUGIN_VERSION = PLUGIN_DESC.getVersion();
public static final String IDE_NAME = ApplicationNamesInfo.getInstance().getProductName();
public static final String IDE_NAME_LOWER = IDE_NAME.toLowerCase();
public static final String IDE_HASH = Integer.toHexString(FileUtil.pathHashCode(PathManager.getHomePath()));

View File

@ -6,10 +6,10 @@ import io.zhile.research.intellij.ier.ui.form.MainForm;
import javax.swing.*;
public class MainDialog extends DialogWrapper {
public MainDialog() {
public MainDialog(String title) {
super(true);
init();
setTitle("Eval Reset");
setTitle(title);
}

View File

@ -26,31 +26,6 @@
</component>
</children>
</grid>
<grid id="f8be5" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="2">
<constraints border-constraint="South"/>
<properties/>
<border type="none"/>
<children>
<component id="3e8db" class="javax.swing.JCheckBox" binding="chkResetAuto">
<constraints/>
<properties>
<text value="Auto reset before per restart"/>
</properties>
</component>
<component id="382d3" class="javax.swing.JButton" binding="btnReload">
<constraints/>
<properties>
<text value="Reload"/>
</properties>
</component>
<component id="7f8d9" class="javax.swing.JButton" binding="btnReset">
<constraints/>
<properties>
<text value="Reset"/>
</properties>
</component>
</children>
</grid>
<grid id="60ebc" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
@ -94,6 +69,54 @@
</grid>
</children>
</grid>
<grid id="e427f" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="South"/>
<properties/>
<border type="none"/>
<children>
<grid id="f8be5" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="2">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<component id="3e8db" class="javax.swing.JCheckBox" binding="chkResetAuto">
<constraints/>
<properties>
<text value="Auto reset before per restart"/>
</properties>
</component>
<component id="382d3" class="javax.swing.JButton" binding="btnReload">
<constraints/>
<properties>
<text value="Reload"/>
</properties>
</component>
<component id="7f8d9" class="javax.swing.JButton" binding="btnReset">
<constraints/>
<properties>
<text value="Reset"/>
</properties>
</component>
</children>
</grid>
<grid id="ee6d2" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="West"/>
<properties/>
<border type="empty">
<size top="0" left="5" bottom="0" right="5"/>
</border>
<children>
<component id="fbfed" class="javax.swing.JLabel" binding="lblVersion">
<constraints border-constraint="Center"/>
<properties>
<enabled value="false"/>
<text value="v1.0.0"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -24,6 +24,7 @@ public class MainForm {
private JLabel lblFound;
private JLabel lblLastResetTimeLabel;
private JCheckBox chkResetAuto;
private JLabel lblVersion;
private final DialogWrapper dialogWrapper;
private final DefaultListModel<String> listModel = new DefaultListModel<>();
@ -37,6 +38,8 @@ public class MainForm {
boldFont(lblLastResetTimeLabel);
reloadLastResetTime();
lblVersion.setText("v" + Constants.PLUGIN_VERSION);
chkResetAuto.setSelected(Resetter.isAutoReset());
chkResetAuto.addActionListener(new AbstractAction() {
@Override