mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-30 07:48:38 +00:00
ignore case is selected by default in search window, addes some hotkeys
This commit is contained in:
@@ -21,18 +21,13 @@ import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.console.ContextMenuTools;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import com.jpexs.helpers.Cache;
|
||||
import com.sun.jna.Platform;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
@@ -43,7 +38,7 @@ import javax.swing.JOptionPane;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
public class MainFrameClassicMenu extends MainFrameMenu implements ActionListener {
|
||||
|
||||
private static final String ACTION_RELOAD = "RELOAD";
|
||||
private static final String ACTION_ADVANCED_SETTINGS = "ADVANCEDSETTINGS";
|
||||
@@ -109,6 +104,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
private JMenuItem gotoDocumentClassCommandButton;
|
||||
|
||||
public MainFrameClassicMenu(MainFrameClassic mainFrame, boolean externalFlashPlayerUnavailable) {
|
||||
super(mainFrame);
|
||||
this.mainFrame = mainFrame;
|
||||
|
||||
createMenuBar(externalFlashPlayerUnavailable);
|
||||
@@ -119,10 +115,6 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
return miInternalViewer.isSelected();
|
||||
}
|
||||
|
||||
private String translate(String key) {
|
||||
return mainFrame.translate(key);
|
||||
}
|
||||
|
||||
private void assignListener(JMenuItem b, final String command) {
|
||||
final MainFrameClassicMenu t = this;
|
||||
b.addActionListener(new ActionListener() {
|
||||
@@ -336,6 +328,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
|
||||
@Override
|
||||
public void updateComponents(SWF swf) {
|
||||
super.updateComponents(swf);
|
||||
boolean swfLoaded = swf != null;
|
||||
List<ABCContainerTag> abcList = swfLoaded ? swf.abcList : null;
|
||||
boolean hasAbc = swfLoaded && abcList != null && !abcList.isEmpty();
|
||||
@@ -357,15 +350,6 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
deobfuscationCommandButton.setEnabled(hasAbc);*/
|
||||
}
|
||||
|
||||
private boolean saveAs(SWF swf, SaveFileMode mode) {
|
||||
if (Main.saveFileDialog(swf, mode)) {
|
||||
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
|
||||
updateComponents(mainFrame.panel.getCurrentSwf());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (e.getActionCommand()) {
|
||||
@@ -402,7 +386,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
break;
|
||||
case ACTION_DISABLE_DECOMPILATION:
|
||||
Configuration.decompile.set(!miDecompile.isSelected());
|
||||
mainFrame.panel.disableDecompilationChanged();
|
||||
mainFrame.getPanel().disableDecompilationChanged();
|
||||
break;
|
||||
case ACTION_ASSOCIATE:
|
||||
if (miAssociate.isSelected() == ContextMenuTools.isAddedToContextMenu()) {
|
||||
@@ -419,7 +403,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
}, 1000); //It takes some time registry change to apply
|
||||
break;
|
||||
case ACTION_GOTO_DOCUMENT_CLASS:
|
||||
mainFrame.panel.gotoDocumentClass(mainFrame.panel.getCurrentSwf());
|
||||
mainFrame.getPanel().gotoDocumentClass(mainFrame.getPanel().getCurrentSwf());
|
||||
break;
|
||||
case ACTION_PARALLEL_SPEED_UP:
|
||||
String confStr = translate("message.confirm.parallel") + "\r\n";
|
||||
@@ -436,21 +420,21 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
break;
|
||||
case ACTION_INTERNAL_VIEWER_SWITCH:
|
||||
Configuration.internalFlashViewer.set(miInternalViewer.isSelected());
|
||||
mainFrame.panel.reload(true);
|
||||
mainFrame.getPanel().reload(true);
|
||||
break;
|
||||
case ACTION_SEARCH_AS:
|
||||
mainFrame.panel.searchAs();
|
||||
search(false);
|
||||
break;
|
||||
case ACTION_AUTO_DEOBFUSCATE:
|
||||
if (View.showConfirmDialog(mainFrame.panel, translate("message.confirm.autodeobfuscate") + "\r\n" + (miAutoDeobfuscation.isSelected() ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
|
||||
if (View.showConfirmDialog(mainFrame.getPanel(), translate("message.confirm.autodeobfuscate") + "\r\n" + (miAutoDeobfuscation.isSelected() ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
|
||||
Configuration.autoDeobfuscate.set(miAutoDeobfuscation.isSelected());
|
||||
mainFrame.panel.autoDeobfuscateChanged();
|
||||
mainFrame.getPanel().autoDeobfuscateChanged();
|
||||
} else {
|
||||
miAutoDeobfuscation.setSelected(!miAutoDeobfuscation.isSelected());
|
||||
}
|
||||
break;
|
||||
case ACTION_EXIT:
|
||||
mainFrame.panel.setVisible(false);
|
||||
mainFrame.getPanel().setVisible(false);
|
||||
if (Main.proxyFrame != null) {
|
||||
if (Main.proxyFrame.isVisible()) {
|
||||
return;
|
||||
@@ -466,7 +450,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_RENAME_ONE_IDENTIFIER:
|
||||
mainFrame.panel.renameOneIdentifier(mainFrame.panel.getCurrentSwf());
|
||||
mainFrame.getPanel().renameOneIdentifier(mainFrame.getPanel().getCurrentSwf());
|
||||
break;
|
||||
case ACTION_ABOUT:
|
||||
Main.about();
|
||||
@@ -479,60 +463,33 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
Main.setSubLimiter(((JCheckBoxMenuItem) e.getSource()).getState());
|
||||
}
|
||||
break;
|
||||
case ACTION_SAVE: {
|
||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||
if (swf != null) {
|
||||
boolean saved = false;
|
||||
if (swf.binaryData != null) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try {
|
||||
swf.saveTo(baos);
|
||||
swf.binaryData.binaryData = new ByteArrayRange(baos.toByteArray());
|
||||
swf.binaryData.setModified(true);
|
||||
saved = true;
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(MainFrameClassicMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
|
||||
}
|
||||
} else if (swf.file == null) {
|
||||
saved = saveAs(swf, SaveFileMode.SAVEAS);
|
||||
} else {
|
||||
try {
|
||||
Main.saveFile(swf, swf.file);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(MainFrameClassicMenu.class.getName()).log(Level.SEVERE, null, ex);
|
||||
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
if (saved) {
|
||||
swf.clearModified();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_SAVE:
|
||||
save();
|
||||
break;
|
||||
case ACTION_SAVE_AS: {
|
||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||
SWF swf = mainFrame.getPanel().getCurrentSwf();
|
||||
if (swf != null && saveAs(swf, SaveFileMode.SAVEAS)) {
|
||||
swf.clearModified();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_SAVE_AS_EXE: {
|
||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||
SWF swf = mainFrame.getPanel().getCurrentSwf();
|
||||
if (swf != null) {
|
||||
saveAs(swf, SaveFileMode.EXE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_OPEN:
|
||||
Main.openFileDialog();
|
||||
open();
|
||||
break;
|
||||
case ACTION_EXPORT_FLA:
|
||||
mainFrame.panel.exportFla(mainFrame.panel.getCurrentSwf());
|
||||
mainFrame.getPanel().exportFla(mainFrame.getPanel().getCurrentSwf());
|
||||
break;
|
||||
case ACTION_EXPORT_SEL:
|
||||
case ACTION_EXPORT:
|
||||
boolean onlySel = e.getActionCommand().endsWith("SEL");
|
||||
mainFrame.panel.export(onlySel);
|
||||
mainFrame.getPanel().export(onlySel);
|
||||
break;
|
||||
case ACTION_CHECK_UPDATES:
|
||||
if (!Main.checkForUpdates()) {
|
||||
@@ -554,20 +511,20 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
case ACTION_RESTORE_CONTROL_FLOW:
|
||||
case ACTION_RESTORE_CONTROL_FLOW_ALL:
|
||||
boolean all = e.getActionCommand().endsWith("ALL");
|
||||
mainFrame.panel.restoreControlFlow(all);
|
||||
mainFrame.getPanel().restoreControlFlow(all);
|
||||
break;
|
||||
case ACTION_RENAME_IDENTIFIERS:
|
||||
mainFrame.panel.renameIdentifiers(mainFrame.panel.getCurrentSwf());
|
||||
mainFrame.getPanel().renameIdentifiers(mainFrame.getPanel().getCurrentSwf());
|
||||
break;
|
||||
case ACTION_DEOBFUSCATE:
|
||||
case ACTION_DEOBFUSCATE_ALL:
|
||||
mainFrame.panel.deobfuscate();
|
||||
mainFrame.getPanel().deobfuscate();
|
||||
break;
|
||||
case ACTION_REMOVE_NON_SCRIPTS:
|
||||
mainFrame.panel.removeNonScripts(mainFrame.panel.getCurrentSwf());
|
||||
mainFrame.getPanel().removeNonScripts(mainFrame.getPanel().getCurrentSwf());
|
||||
break;
|
||||
case ACTION_REFRESH_DECOMPILED:
|
||||
mainFrame.panel.refreshDecompiled();
|
||||
mainFrame.getPanel().refreshDecompiled();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user