From 6c620f4b9970795d5c059e2cad49d70423447043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 23 Dec 2022 09:34:42 +0100 Subject: [PATCH] Fixed #1901 Collapsing the tree in autosave mode on saving manually Fixed Generic tag saving manually --- .../jpexs/decompiler/flash/gui/MainPanel.java | 7 ++++--- .../decompiler/flash/gui/PreviewPanel.java | 17 +++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 89970162c..9998f6dc0 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -3818,13 +3818,14 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se refreshTree(new Openable[]{openable}); } - public void refreshTree(Openable[] openables) { - clear(); - showCard(CARDEMPTYPANEL); + public void refreshTree(Openable[] openables) { TreeItem treeItem = null; if (currentView == VIEW_RESOURCES || currentView == VIEW_TAGLIST) { treeItem = getCurrentTree().getCurrentTreeItem(); } + + clear(); + showCard(CARDEMPTYPANEL); tagTree.updateSwfs(openables); tagListTree.updateSwfs(openables); diff --git a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java index c2858bac8..73fea642b 100644 --- a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java @@ -1313,10 +1313,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel swf.updateCharacters(); tag.getTimelined().resetTimeline(); swf.assignClassesToSymbols(); - swf.assignExportNamesToSymbols(); - if (refreshTree) { - mainPanel.refreshTree(swf); - } + swf.assignExportNamesToSymbols(); if (Configuration.editorMode.get()) { genericEditButton.setVisible(false); genericSaveButton.setVisible(true); @@ -1329,6 +1326,9 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel genericCancelButton.setVisible(false); } genericTagPanel.setEditMode(false, null); + if (refreshTree) { + mainPanel.refreshTree(swf); + } mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), tag); mainPanel.clearEditingStatus(); } @@ -1368,14 +1368,12 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel placeGenericPanel.setVisible(true); } Tag hilightTag = null; + SWF swf = null; if (placeEditMode == PLACE_EDIT_RAW) { if (placeGenericPanel.save()) { Tag tag = placeGenericPanel.getTag(); - SWF swf = tag.getSwf(); + swf = tag.getSwf(); tag.getTimelined().resetTimeline(); - if (refreshTree) { - mainPanel.refreshTree(swf); - } hilightTag = tag; } placeGenericPanel.setEditMode(false, null); @@ -1394,6 +1392,9 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel placeCancelButton.setVisible(false); } + if (placeEditMode == PLACE_EDIT_RAW && refreshTree && swf != null) { + mainPanel.refreshTree(swf); + } mainPanel.clearEditingStatus(); mainPanel.repaintTree(); if (hilightTag != null) {