Added Remembering breakpoints

Added #2131 Breakpoint list dialog
Fixed AS1/2 Debugger - script was cleared on stop button
This commit is contained in:
Jindra Petřík
2023-12-30 18:06:08 +01:00
parent a74196ddf4
commit 8ceb44f25e
18 changed files with 658 additions and 190 deletions
@@ -51,6 +51,7 @@ import com.jpexs.decompiler.flash.configuration.SwfSpecificCustomConfiguration;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.gui.AppDialog;
import com.jpexs.decompiler.flash.gui.AppStrings;
import com.jpexs.decompiler.flash.gui.BreakpointListDialog;
import com.jpexs.decompiler.flash.gui.DebugPanel;
import com.jpexs.decompiler.flash.gui.DebuggerHandler;
import com.jpexs.decompiler.flash.gui.FasterScrollPane;
@@ -962,6 +963,12 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
iconsPanel.add(deobfuscateButton);
iconsPanel.add(deobfuscateOptionsButton);
JButton breakpointListButton = new JButton(View.getIcon("breakpointlist16"));
breakpointListButton.setMargin(new Insets(5, 5, 5, 5));
breakpointListButton.addActionListener(this::breakPointListButtonActionPerformed);
breakpointListButton.setToolTipText(AppStrings.translate("button.breakpointList"));
iconsPanel.add(breakpointListButton);
scriptNameLabel = new JLabel("-");
@@ -1891,6 +1898,10 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
}
}
private void breakPointListButtonActionPerformed(ActionEvent evt) {
Main.showBreakpointsList();
}
private void addTraitButtonActionPerformed(ActionEvent evt) {
int class_index = decompiledTextArea.getClassIndex();
@@ -118,15 +118,8 @@ public class LinkDialog extends JDialog {
List<SWF> selectedSWFs = new ArrayList<>();
if (conf != null) {
String abcDependencies = conf.getCustomData(CustomConfigurationKeys.KEY_ABC_DEPENDENCIES, "");
if (!abcDependencies.isEmpty()) {
String[] parts = (abcDependencies + Configuration.ABC_DEPS_SEPARATOR).split(Pattern.quote(Configuration.ABC_DEPS_SEPARATOR));
List<String> preselectedNames = new ArrayList<>();
for (String part : parts) {
if (!part.isEmpty()) {
preselectedNames.add(part);
}
}
List<String> preselectedNames = conf.getCustomDataAsList(CustomConfigurationKeys.KEY_ABC_DEPENDENCIES);
if (!preselectedNames.isEmpty()) {
selectedSWFs = Main.namesToSwfs(preselectedNames);
}
}
@@ -142,8 +135,8 @@ public class LinkDialog extends JDialog {
public void save(SWF swf, boolean force) {
Map<String, SWF> map = getSelectedSwfs();
SwfSpecificCustomConfiguration conf = Configuration.getOrCreateSwfSpecificCustomConfiguration(swf.getShortPathTitle());
String oldValue = conf.getCustomData(CustomConfigurationKeys.KEY_ABC_DEPENDENCIES, "");
String newValue = String.join(Configuration.ABC_DEPS_SEPARATOR, map.keySet());
List<String> oldValue = conf.getCustomDataAsList(CustomConfigurationKeys.KEY_ABC_DEPENDENCIES);
List<String> newValue = new ArrayList<>(map.keySet());
conf.setCustomData(CustomConfigurationKeys.KEY_ABC_DEPENDENCIES, newValue);
List<SWF> swfs = new ArrayList<>(map.values());
if (!Objects.equals(oldValue, newValue) || force) {