v2.0.1
Signed-off-by: pengzhile <pengzhile@gmail.com>
This commit is contained in:
parent
1d10d496b3
commit
fb52ae238c
|
@ -4,7 +4,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'io.zhile.research.intellij'
|
group 'io.zhile.research.intellij'
|
||||||
version '2.0.1'
|
version '2.0.2'
|
||||||
|
|
||||||
sourceCompatibility = 1.7
|
sourceCompatibility = 1.7
|
||||||
targetCompatibility = 1.7
|
targetCompatibility = 1.7
|
||||||
|
@ -29,6 +29,8 @@ intellij {
|
||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
changeNotes """<pre>
|
changeNotes """<pre>
|
||||||
|
Release v2.0.2
|
||||||
|
1. sync prefs manually
|
||||||
Release v2.0.1
|
Release v2.0.1
|
||||||
1. add option: Reset Automatically
|
1. add option: Reset Automatically
|
||||||
Release v2.0.0
|
Release v2.0.0
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class Resetter {
|
||||||
private static final String DEVICE_ID_KEY = DEFAULT_VENDOR + ".device_id";
|
private static final String DEVICE_ID_KEY = DEFAULT_VENDOR + ".device_id";
|
||||||
private static final String IDE_EVAL_PREFIX = DEFAULT_VENDOR + "/" + Constants.IDE_NAME_LOWER + "/" + Constants.IDE_HASH;
|
private static final String IDE_EVAL_PREFIX = DEFAULT_VENDOR + "/" + Constants.IDE_NAME_LOWER + "/" + Constants.IDE_HASH;
|
||||||
private static final String EVAL_KEY = "evlsprt";
|
private static final String EVAL_KEY = "evlsprt";
|
||||||
private static final String AUTO_RESET_KEY = Constants.PLUGIN_PREFS_PREFIX + ".auto_reset";
|
private static final String AUTO_RESET_KEY = Constants.PLUGIN_PREFS_PREFIX + ".auto_reset." + Constants.IDE_NAME_LOWER + "." + Constants.IDE_HASH;
|
||||||
|
|
||||||
private static final PropertiesComponentImpl PROPS = (PropertiesComponentImpl) PropertiesComponent.getInstance();
|
private static final PropertiesComponentImpl PROPS = (PropertiesComponentImpl) PropertiesComponent.getInstance();
|
||||||
|
|
||||||
|
@ -145,6 +145,8 @@ public class Resetter {
|
||||||
} else {
|
} else {
|
||||||
Prefs.remove(key);
|
Prefs.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncPrefs();
|
||||||
break;
|
break;
|
||||||
case PROPERTY:
|
case PROPERTY:
|
||||||
PROPS.unsetValue(key);
|
PROPS.unsetValue(key);
|
||||||
|
@ -158,6 +160,15 @@ public class Resetter {
|
||||||
|
|
||||||
public static void setAutoReset(boolean isAutoReset) {
|
public static void setAutoReset(boolean isAutoReset) {
|
||||||
Prefs.putBoolean(AUTO_RESET_KEY, isAutoReset);
|
Prefs.putBoolean(AUTO_RESET_KEY, isAutoReset);
|
||||||
|
syncPrefs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void syncPrefs() {
|
||||||
|
try {
|
||||||
|
Preferences.userRoot().sync();
|
||||||
|
} catch (BackingStoreException e) {
|
||||||
|
NotificationHelper.showError(null, "Flush preferences failed!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static File getSharedFile(String fileName) {
|
protected static File getSharedFile(String fileName) {
|
||||||
|
|
|
@ -25,12 +25,13 @@ public class ResetTimer {
|
||||||
|
|
||||||
public static void resetLastResetTime() {
|
public static void resetLastResetTime() {
|
||||||
Prefs.putLong(RESET_KEY, System.currentTimeMillis());
|
Prefs.putLong(RESET_KEY, System.currentTimeMillis());
|
||||||
|
Resetter.syncPrefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getLastResetTimeStr() {
|
public static String getLastResetTimeStr() {
|
||||||
long lastResetTime = getLastResetTime();
|
long lastResetTime = getLastResetTime();
|
||||||
|
|
||||||
return lastResetTime > 0 ? DateTime.getStringFromTimestamp(lastResetTime) : "not yet";
|
return lastResetTime > 0 ? DateTime.getStringFromTimestamp(lastResetTime) : "Not yet";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(final AnAction resetAction) {
|
public void start(final AnAction resetAction) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user