diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSourceInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSourceInfo.java index 77eefc1f5..a2c61f17e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSourceInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFSourceInfo.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash; import com.jpexs.helpers.Path; @@ -29,7 +30,7 @@ import java.io.InputStream; public class SWFSourceInfo { private final InputStream inputStream; - private final String file; + private String file; private final String fileTitle; public SWFSourceInfo(InputStream inputStream, String file, String fileTitle) { @@ -46,6 +47,10 @@ public class SWFSourceInfo { return file; } + public void setFile(String file) { + this.file = file; + } + public String getFileTitle() { return fileTitle; } diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 85c427477..2130ccc79 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -369,8 +369,10 @@ public class Main { } public static void saveFile(SWF swf, String outfile, SaveFileMode mode) throws IOException { - if (mode == SaveFileMode.SAVEAS) { + if (mode == SaveFileMode.SAVEAS && !swf.swfList.isBundle) { swf.file = outfile; + swf.fileTitle = null; + swf.swfList.sourceInfo.setFile(outfile); } File outfileF = new File(outfile); File tmpFile = new File(outfile + ".tmp"); diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index f1081773e..28223e03d 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -335,8 +335,9 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener { } @Override - public void updateComponents(SWF swf, List abcList) { + public void updateComponents(SWF swf) { boolean swfLoaded = swf != null; + List abcList = swfLoaded ? swf.abcList : null; boolean hasAbc = swfLoaded && abcList != null && !abcList.isEmpty(); /*saveCommandButton.setEnabled(swfLoaded); @@ -358,9 +359,8 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener { private boolean saveAs(SWF swf, SaveFileMode mode) { if (Main.saveFileDialog(swf, mode)) { - swf.fileTitle = null; mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : "")); - saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null); + updateComponents(mainFrame.panel.getCurrentSwf()); return true; } return false; diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index e87cc5036..e008bda14 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -1,32 +1,32 @@ -/* - * Copyright (C) 2010-2014 JPEXS - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.jpexs.decompiler.flash.gui; - -import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.tags.ABCContainerTag; -import java.util.List; - -/** - * - * @author JPEXS - */ -public interface MainFrameMenu { - - public boolean isInternalFlashViewerSelected(); - - public void updateComponents(SWF swf, List abcList); -} +/* + * Copyright (C) 2010-2014 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.gui; + +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import java.util.List; + +/** + * + * @author JPEXS + */ +public interface MainFrameMenu { + + public boolean isInternalFlashViewerSelected(); + + public void updateComponents(SWF swf); +} diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index 82b3bf511..6a81c011e 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -627,8 +627,9 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener { } @Override - public void updateComponents(SWF swf, List abcList) { + public void updateComponents(SWF swf) { boolean swfLoaded = swf != null; + List abcList = swfLoaded ? swf.abcList : null; boolean hasAbc = swfLoaded && abcList != null && !abcList.isEmpty(); boolean hasDebugger = hasAbc && Main.hasDebugger(swf); @@ -668,9 +669,8 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener { private boolean saveAs(SWF swf, SaveFileMode mode) { if (Main.saveFileDialog(swf, mode)) { - swf.fileTitle = null; mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : "")); - saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null); + updateComponents(mainFrame.panel.getCurrentSwf()); return true; } return false; diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 0bd9f027e..9753252af 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -642,7 +642,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec isWelcomeScreen = false; } - mainMenu.updateComponents(swf, abcList); + mainMenu.updateComponents(swf); } private void updateUi() { @@ -653,7 +653,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } mainFrame.setTitle(ApplicationInfo.applicationVerName); - mainMenu.updateComponents(null, null); + mainMenu.updateComponents(null); } public void closeAll() {