Cleaned Up Load Settings

This commit is contained in:
Konloch 2021-07-01 02:05:01 -07:00
parent ad6dff9082
commit 5175316002

View file

@ -40,7 +40,13 @@ public class SettingsSerializer
{
private static boolean settingsFileExists;
public static void saveSettings() {
public static void saveSettingsAsync()
{
Thread saveThread = new Thread(()-> saveSettings());
saveThread.start();
}
public static synchronized void saveSettings() {
try {
DiskWriter.replaceFile(settingsName,
"BCV: " + VERSION, false);
@ -333,76 +339,76 @@ public class SettingsSerializer
BytecodeViewer.viewer.dgs.setSelected(asBoolean(8));
BytecodeViewer.viewer.ner.setSelected(asBoolean(9));
BytecodeViewer.viewer.den.setSelected(asBoolean(10));
BytecodeViewer.viewer.rgn.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 11, false)));
BytecodeViewer.viewer.bto.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 12, false)));
BytecodeViewer.viewer.nns.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 13, false)));
BytecodeViewer.viewer.uto.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 14, false)));
BytecodeViewer.viewer.udv.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 15, false)));
BytecodeViewer.viewer.rer.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 16, false)));
BytecodeViewer.viewer.fdi.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 17, false)));
BytecodeViewer.viewer.asc.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 18, false)));
BytecodeViewer.viewer.decodeEnumSwitch.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 19, false)));
BytecodeViewer.viewer.sugarEnums.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 20, false)));
BytecodeViewer.viewer.decodeStringSwitch.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 21, false)));
BytecodeViewer.viewer.arrayiter.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 22, false)));
BytecodeViewer.viewer.collectioniter.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 23, false)));
BytecodeViewer.viewer.innerClasses.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 24, false)));
BytecodeViewer.viewer.removeBoilerPlate.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 25, false)));
BytecodeViewer.viewer.removeInnerClassSynthetics.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 26, false)));
BytecodeViewer.viewer.decodeLambdas.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 27, false)));
BytecodeViewer.viewer.hideBridgeMethods.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 28, false)));
BytecodeViewer.viewer.liftConstructorInit.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 29, false)));
BytecodeViewer.viewer.removeDeadMethods.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 30, false)));
BytecodeViewer.viewer.removeBadGenerics.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 31, false)));
BytecodeViewer.viewer.sugarAsserts.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 32, false)));
BytecodeViewer.viewer.sugarBoxing.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 33, false)));
BytecodeViewer.viewer.showVersion.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 34, false)));
BytecodeViewer.viewer.decodeFinally.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 35, false)));
BytecodeViewer.viewer.tidyMonitors.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 36, false)));
BytecodeViewer.viewer.lenient.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 37, false)));
BytecodeViewer.viewer.dumpClassPath.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 38, false)));
BytecodeViewer.viewer.comments.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 39, false)));
BytecodeViewer.viewer.forceTopSort.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 40, false)));
BytecodeViewer.viewer.forceTopSortAggress.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 41, false)));
BytecodeViewer.viewer.stringBuffer.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 42, false)));
BytecodeViewer.viewer.stringBuilder.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 43, false)));
BytecodeViewer.viewer.silent.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 44, false)));
BytecodeViewer.viewer.recover.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 45, false)));
BytecodeViewer.viewer.eclipse.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 46, false)));
BytecodeViewer.viewer.override.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 47, false)));
BytecodeViewer.viewer.showInferrable.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 48, false)));
BytecodeViewer.viewer.aexagg.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 49, false)));
BytecodeViewer.viewer.forceCondPropagate.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 50, false)));
BytecodeViewer.viewer.hideUTF.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 51, false)));
BytecodeViewer.viewer.hideLongStrings.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 52, false)));
BytecodeViewer.viewer.commentMonitor.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 53, false)));
BytecodeViewer.viewer.allowCorrecting.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 54, false)));
BytecodeViewer.viewer.labelledBlocks.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 55, false)));
BytecodeViewer.viewer.j14ClassOBJ.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 56, false)));
BytecodeViewer.viewer.hideLangImports.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 57, false)));
BytecodeViewer.viewer.recoveryTypeClash.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 58, false)));
BytecodeViewer.viewer.recoveryTypehInts.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 59, false)));
BytecodeViewer.viewer.forceTurningIFs.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 60, false)));
BytecodeViewer.viewer.forLoopAGGCapture.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 61, false)));
BytecodeViewer.viewer.forceExceptionPrune.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 62, false)));
BytecodeViewer.viewer.showDebugLineNumbers.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 63, false)));
BytecodeViewer.viewer.simplifyMemberReferences.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 64, false)));
BytecodeViewer.viewer.mergeVariables.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 65, false)));
BytecodeViewer.viewer.unicodeOutputEnabled.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 66, false)));
BytecodeViewer.viewer.retainPointlessSwitches.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 67, false)));
BytecodeViewer.viewer.includeLineNumbersInBytecode.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 68, false)));
BytecodeViewer.viewer.includeErrorDiagnostics.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 69, false)));
BytecodeViewer.viewer.retainRedunantCasts.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 70, false)));
BytecodeViewer.viewer.alwaysGenerateExceptionVars.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 71, false)));
BytecodeViewer.viewer.showSyntheticMembers.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 72, false)));
BytecodeViewer.viewer.forceExplicitTypeArguments.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 73, false)));
BytecodeViewer.viewer.forceExplicitImports.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 74, false)));
BytecodeViewer.viewer.flattenSwitchBlocks.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 75, false)));
BytecodeViewer.viewer.excludeNestedTypes.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 76, false)));
BytecodeViewer.viewer.appendBracketsToLabels.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 77, false)));
BytecodeViewer.viewer.debugHelpers.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 78, false)));
BytecodeViewer.viewer.rgn.setSelected(asBoolean(11));
BytecodeViewer.viewer.bto.setSelected(asBoolean(12));
BytecodeViewer.viewer.nns.setSelected(asBoolean(13));
BytecodeViewer.viewer.uto.setSelected(asBoolean(14));
BytecodeViewer.viewer.udv.setSelected(asBoolean(15));
BytecodeViewer.viewer.rer.setSelected(asBoolean(16));
BytecodeViewer.viewer.fdi.setSelected(asBoolean(17));
BytecodeViewer.viewer.asc.setSelected(asBoolean(18));
BytecodeViewer.viewer.decodeEnumSwitch.setSelected(asBoolean(19));
BytecodeViewer.viewer.sugarEnums.setSelected(asBoolean(20));
BytecodeViewer.viewer.decodeStringSwitch.setSelected(asBoolean(21));
BytecodeViewer.viewer.arrayiter.setSelected(asBoolean(22));
BytecodeViewer.viewer.collectioniter.setSelected(asBoolean(23));
BytecodeViewer.viewer.innerClasses.setSelected(asBoolean(24));
BytecodeViewer.viewer.removeBoilerPlate.setSelected(asBoolean(25));
BytecodeViewer.viewer.removeInnerClassSynthetics.setSelected(asBoolean(26));
BytecodeViewer.viewer.decodeLambdas.setSelected(asBoolean(27));
BytecodeViewer.viewer.hideBridgeMethods.setSelected(asBoolean(28));
BytecodeViewer.viewer.liftConstructorInit.setSelected(asBoolean(29));
BytecodeViewer.viewer.removeDeadMethods.setSelected(asBoolean(30));
BytecodeViewer.viewer.removeBadGenerics.setSelected(asBoolean(31));
BytecodeViewer.viewer.sugarAsserts.setSelected(asBoolean(32));
BytecodeViewer.viewer.sugarBoxing.setSelected(asBoolean(33));
BytecodeViewer.viewer.showVersion.setSelected(asBoolean(34));
BytecodeViewer.viewer.decodeFinally.setSelected(asBoolean(35));
BytecodeViewer.viewer.tidyMonitors.setSelected(asBoolean(36));
BytecodeViewer.viewer.lenient.setSelected(asBoolean(37));
BytecodeViewer.viewer.dumpClassPath.setSelected(asBoolean(38));
BytecodeViewer.viewer.comments.setSelected(asBoolean(39));
BytecodeViewer.viewer.forceTopSort.setSelected(asBoolean(40));
BytecodeViewer.viewer.forceTopSortAggress.setSelected(asBoolean(41));
BytecodeViewer.viewer.stringBuffer.setSelected(asBoolean(42));
BytecodeViewer.viewer.stringBuilder.setSelected(asBoolean(43));
BytecodeViewer.viewer.silent.setSelected(asBoolean(44));
BytecodeViewer.viewer.recover.setSelected(asBoolean(45));
BytecodeViewer.viewer.eclipse.setSelected(asBoolean(46));
BytecodeViewer.viewer.override.setSelected(asBoolean(47));
BytecodeViewer.viewer.showInferrable.setSelected(asBoolean(48));
BytecodeViewer.viewer.aexagg.setSelected(asBoolean(49));
BytecodeViewer.viewer.forceCondPropagate.setSelected(asBoolean(50));
BytecodeViewer.viewer.hideUTF.setSelected(asBoolean(51));
BytecodeViewer.viewer.hideLongStrings.setSelected(asBoolean(52));
BytecodeViewer.viewer.commentMonitor.setSelected(asBoolean(53));
BytecodeViewer.viewer.allowCorrecting.setSelected(asBoolean(54));
BytecodeViewer.viewer.labelledBlocks.setSelected(asBoolean(55));
BytecodeViewer.viewer.j14ClassOBJ.setSelected(asBoolean(56));
BytecodeViewer.viewer.hideLangImports.setSelected(asBoolean(57));
BytecodeViewer.viewer.recoveryTypeClash.setSelected(asBoolean(58));
BytecodeViewer.viewer.recoveryTypehInts.setSelected(asBoolean(59));
BytecodeViewer.viewer.forceTurningIFs.setSelected(asBoolean(60));
BytecodeViewer.viewer.forLoopAGGCapture.setSelected(asBoolean(61));
BytecodeViewer.viewer.forceExceptionPrune.setSelected(asBoolean(62));
BytecodeViewer.viewer.showDebugLineNumbers.setSelected(asBoolean(63));
BytecodeViewer.viewer.simplifyMemberReferences.setSelected(asBoolean(64));
BytecodeViewer.viewer.mergeVariables.setSelected(asBoolean(65));
BytecodeViewer.viewer.unicodeOutputEnabled.setSelected(asBoolean(66));
BytecodeViewer.viewer.retainPointlessSwitches.setSelected(asBoolean(67));
BytecodeViewer.viewer.includeLineNumbersInBytecode.setSelected(asBoolean(68));
BytecodeViewer.viewer.includeErrorDiagnostics.setSelected(asBoolean(69));
BytecodeViewer.viewer.retainRedunantCasts.setSelected(asBoolean(70));
BytecodeViewer.viewer.alwaysGenerateExceptionVars.setSelected(asBoolean(71));
BytecodeViewer.viewer.showSyntheticMembers.setSelected(asBoolean(72));
BytecodeViewer.viewer.forceExplicitTypeArguments.setSelected(asBoolean(73));
BytecodeViewer.viewer.forceExplicitImports.setSelected(asBoolean(74));
BytecodeViewer.viewer.flattenSwitchBlocks.setSelected(asBoolean(75));
BytecodeViewer.viewer.excludeNestedTypes.setSelected(asBoolean(76));
BytecodeViewer.viewer.appendBracketsToLabels.setSelected(asBoolean(77));
BytecodeViewer.viewer.debugHelpers.setSelected(asBoolean(78));
//79 is deprecated
BytecodeViewer.viewer.updateCheck.setSelected(Boolean.parseBoolean(DiskReader.loadString(settingsName, 80, false)));
BytecodeViewer.viewer.updateCheck.setSelected(asBoolean(80));
BytecodeViewer.viewer.viewPane1.setSelectedViewer(asInt(81));
BytecodeViewer.viewer.viewPane2.setSelectedViewer(asInt(82));
BytecodeViewer.viewer.viewPane3.setSelectedViewer(asInt(83));