autosave bug fixed

This commit is contained in:
2015-03-02 22:46:29 +01:00
parent f8385fad28
commit 128717a5e9
5 changed files with 21 additions and 7 deletions
@@ -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<TreeItem>());
folderPreviewPanel.setItems(new ArrayList<>());
previewPanel.clear();
stopFlashPlayer();
if (treeItem instanceof ScriptPack) {
@@ -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();
}
}
}
@@ -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)
@@ -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)