Fixed: [#1962] Close button could close more than one file at once

Fixed: Simple editor - Selecting previous SWF when swf close
Changed: An item selected in the tag tree is needed for actions to be available.
Also SWF node is selected by default on first SWF opening.
This commit is contained in:
Jindra Petřík
2025-05-15 22:50:13 +02:00
parent 960f705071
commit cd91e3c3d2
6 changed files with 139 additions and 31 deletions

View File

@@ -53,6 +53,7 @@ import com.jpexs.decompiler.flash.gui.pipes.FirstInstance;
import com.jpexs.decompiler.flash.gui.soleditor.CookiesChangedListener;
import com.jpexs.decompiler.flash.gui.soleditor.SharedObjectsStorage;
import com.jpexs.decompiler.flash.gui.soleditor.SolEditorFrame;
import com.jpexs.decompiler.flash.gui.tagtree.AbstractTagTreeModel;
import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin;
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag;
@@ -150,6 +151,7 @@ import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;
import javax.swing.filechooser.FileFilter;
import javax.swing.tree.TreePath;
import jsyntaxpane.DefaultSyntaxKit;
import org.pushingpixels.substance.api.SubstanceLookAndFeel;
@@ -1817,8 +1819,22 @@ public class Main {
}
if (isInited()) {
mainFrame.getPanel().tagTree.setSelectionPathString(resourcesPathStr);
mainFrame.getPanel().tagListTree.setSelectionPathString(tagListPathStr);
if (resourcesPathStr == null) {
TreePath tp = mainFrame.getPanel().tagTree.getFullModel().getTreePath(fopenable);
if (tp != null) {
mainFrame.getPanel().tagTree.setSelectionPath(tp);
}
} else {
mainFrame.getPanel().tagTree.setSelectionPathString(resourcesPathStr);
}
if (tagListPathStr == null) {
TreePath tp = mainFrame.getPanel().tagListTree.getFullModel().getTreePath(fopenable);
if (tp != null) {
mainFrame.getPanel().tagListTree.setSelectionPath(tp);
}
} else {
mainFrame.getPanel().tagListTree.setSelectionPathString(tagListPathStr);
}
} else {
mainFrame.getPanel().tagTree.setExpandPathString(resourcesPathStr);
mainFrame.getPanel().tagListTree.setExpandPathString(tagListPathStr);