diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index bf02eca75..36604444a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -413,6 +413,10 @@ public class Configuration { @ConfigurationCategory("ui") public static final ConfigurationItem autoSaveTagModifications = null; + @ConfigurationDefaultBoolean(false) + @ConfigurationCategory("ui") + public static final ConfigurationItem saveSessionOnExit = null; + private enum OSId { WINDOWS, OSX, UNIX diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 0f4506ec7..07aa2a527 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2398,8 +2398,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } public void reload(boolean forceReload) { - closeTag(); - if (Configuration.dumpView.get()) { dumpViewReload(forceReload); return; @@ -2414,6 +2412,10 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec return; } + if (oldItem != treeItem) { + closeTag(); + } + oldItem = treeItem; // show the preview of the tag when the user clicks to the tagname inside the scripts node, too @@ -2427,7 +2429,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec //if (flashPanel != null) { // flashPanel.specialPlayback = false; //} - folderPreviewPanel.setItems(new ArrayList()); + folderPreviewPanel.setItems(new ArrayList<>()); previewPanel.clear(); stopFlashPlayer(); if (treeItem instanceof ScriptPack) { diff --git a/src/com/jpexs/decompiler/flash/gui/TextPanel.java b/src/com/jpexs/decompiler/flash/gui/TextPanel.java index 6cf259ce2..94a9bcbb3 100644 --- a/src/com/jpexs/decompiler/flash/gui/TextPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TextPanel.java @@ -136,7 +136,7 @@ public class TextPanel extends JPanel { JPanel buttonsPanel = new JPanel(new FlowLayout()); textEditButton = createButton("button.edit", "edit16", null, e -> editText()); - textSaveButton = createButton("button.save", "save16", null, e -> saveText()); + textSaveButton = createButton("button.save", "save16", null, e -> saveText(true)); textCancelButton = createButton("button.cancel", "cancel16", null, e -> cancelText()); buttonsPanel.add(textEditButton); @@ -175,7 +175,7 @@ public class TextPanel extends JPanel { public void closeTag() { if (modified && Configuration.autoSaveTagModifications.get()) { - saveText(); + saveText(false); } textTag = null; @@ -231,12 +231,14 @@ public class TextPanel extends JPanel { mainPanel.reload(true); } - private void saveText() { + private void saveText(boolean refresh) { if (mainPanel.saveText(textTag, textValue.getText(), null)) { setEditText(false); modified = false; textTag.getSwf().clearImageCache(); - mainPanel.refreshTree(); + if (refresh) { + mainPanel.refreshTree(); + } } } diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index cc0c34490..5f43cf057 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -323,3 +323,6 @@ config.description.editorMode = Make text areas edittable automatically when you config.name.autoSaveTagModifications = Auto save tag modificatios config.description.autoSaveTagModifications = Save the changes when you select a new tag in the tree + +config.name.saveSessionOnExit = Save session on exit +config.description.saveSessionOnExit = Save the current session and reopens it after FFDec restart (works only with real files) diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties index ceb8b3053..ddd543f54 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties @@ -320,3 +320,6 @@ config.description.updateProxyAddress = Http Proxy c\u00edm a friss\u00edt\u00e9 config.name.autoSaveTagModifications = Tag m\u00f3dos\u00edt\u00e1sainak automatikus ment\u00e9se config.description.autoSaveTagModifications = V\u00e1ltoz\u00e1sok ment\u00e9se amikor \u00faj tag-et v\u00e1laszt ki a f\u00e1ban + +config.name.saveSessionOnExit = Munkamenet ment\u00e9se kil\u00e9p\u00e9skor +config.description.saveSessionOnExit = Elmenti az aktu\u00e1lis munkamenetet \u00e9s vissza\u00e1ll\u00edtja azt az FFDec \u00fajraind\u00edt\u00e1sa ut\u00e1n (csak igazi f\u00e1jlokkal m\u0171k\u00f6dik)