From 671ebf08a383aaa61c92b8fb92d3dfd695e50073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 15 Jan 2023 17:17:00 +0100 Subject: [PATCH] Fixed Deobfuscation icon on script toolbar did not match the deobfuscation status --- CHANGELOG.md | 1 + src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java | 8 +++++++- .../jpexs/decompiler/flash/gui/action/ActionPanel.java | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ffb735c..4092da664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file. - [#1842] AS1/2 Better handling obfuscated code, for..in - [#1842] AS1/2 use parenthesis when initObject has nonstring keys - [#1842] AS - Do not display §§dup when the value has no sideeffect +- Deobfuscation icon on script toolbar did not match the deobfuscation status ## [18.3.2] - 2023-01-10 ### Removed diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index eca97924d..172a790a8 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -45,6 +45,7 @@ import com.jpexs.decompiler.flash.action.parser.script.ActionScriptLexer; import com.jpexs.decompiler.flash.action.parser.script.ParsedSymbol; import com.jpexs.decompiler.flash.action.parser.script.SymbolType; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.configuration.ConfigurationItemChangeListener; import com.jpexs.decompiler.flash.configuration.CustomConfigurationKeys; import com.jpexs.decompiler.flash.configuration.SwfSpecificCustomConfiguration; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -971,7 +972,12 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener(){ + @Override + public void configurationItemChanged(Boolean newValue) { + deobfuscateButton.setSelected(newValue); + } + }); JButton deobfuscateOptionsButton = new JButton(View.getIcon("deobfuscateoptions16")); deobfuscateOptionsButton.addActionListener(this::deobfuscateOptionsButtonActionPerformed); diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index b2e1f4d8d..142d58c71 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.action.parser.script.SymbolType; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.configuration.ConfigurationItemChangeListener; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.DebugPanel; @@ -811,6 +812,12 @@ public class ActionPanel extends JPanel implements SearchListener(){ + @Override + public void configurationItemChanged(Boolean newValue) { + deobfuscateButton.setSelected(newValue); + } + }); JButton deobfuscateOptionsButton = new JButton(View.getIcon("deobfuscateoptions16"));