mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-07 19:18:18 +00:00
Refreshing Save buttons when files were modified outside application
This commit is contained in:
@@ -18,7 +18,9 @@ package com.jpexs.decompiler.flash.treeitems;
|
||||
|
||||
import com.jpexs.decompiler.flash.Bundle;
|
||||
import com.jpexs.decompiler.flash.OpenableSourceInfo;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFContainerItem;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@@ -184,4 +186,17 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setModified() {
|
||||
for (Openable openable : this) {
|
||||
if (openable instanceof SWF) {
|
||||
SWF swf = (SWF) openable;
|
||||
swf.setModified(true);
|
||||
}
|
||||
if (openable instanceof ABC) {
|
||||
ABC abc = (ABC) openable;
|
||||
abc.getSwf().setModified(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.treeitems.Openable;
|
||||
import com.jpexs.decompiler.flash.treeitems.OpenableList;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Container;
|
||||
@@ -150,8 +154,8 @@ public class FilesChangedDialog extends AppDialog {
|
||||
filesList.setModel(listModel);
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
clearList();
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
clearList();
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2364,12 +2364,19 @@ public class Main {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (OpenableSourceInfo info : sourceInfos) {
|
||||
final String infoFile = info.getFile();
|
||||
if (infoFile != null && new File(infoFile).equals(fullPath)) {
|
||||
for (OpenableSourceInfo info : sourceInfos) {
|
||||
final String infoFile = info.getFile();
|
||||
if (infoFile != null && new File(infoFile).equals(fullPath)) {
|
||||
for (OpenableList list :Main.getMainFrame().getPanel().getSwfs()) {
|
||||
if (info == list.sourceInfo) {
|
||||
list.setModified();
|
||||
}
|
||||
}
|
||||
|
||||
View.execInEventDispatchLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mainFrame.getPanel().refreshTree();
|
||||
if (filesChangedDialog == null) {
|
||||
filesChangedDialog = new FilesChangedDialog(Main.mainFrame.getWindow());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user