mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-15 11:22:54 +00:00
Fixed Proper disabling switching items or other actions on editation
This commit is contained in:
@@ -128,6 +128,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Main.openFileDialog();
|
||||
return true;
|
||||
@@ -182,6 +185,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
}
|
||||
|
||||
protected void newActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
Main.newFile();
|
||||
}
|
||||
|
||||
@@ -189,6 +195,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
return saveOpenable(openable);
|
||||
}
|
||||
|
||||
@@ -196,6 +205,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (openable != null) {
|
||||
if (saveAs(openable, SaveFileMode.SAVEAS)) {
|
||||
@@ -230,6 +242,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (openable != null) {
|
||||
saveAs(openable, SaveFileMode.EXE);
|
||||
@@ -255,6 +270,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
Set<OpenableList> listsToClose = new LinkedHashSet<>();
|
||||
for (TreeItem item : mainFrame.getPanel().getCurrentTree().getSelected()) {
|
||||
if (item instanceof OpenableList) {
|
||||
@@ -285,6 +303,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (openable != null) {
|
||||
boolean result = Main.closeAll();
|
||||
@@ -308,6 +329,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().importText((SWF) openable);
|
||||
}
|
||||
@@ -316,6 +340,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().importScript(openable);
|
||||
}
|
||||
@@ -324,6 +351,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
mainFrame.getPanel().importImage((SWF) openable);
|
||||
}
|
||||
|
||||
@@ -331,6 +361,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
mainFrame.getPanel().importShape((SWF) openable, false);
|
||||
}
|
||||
|
||||
@@ -338,6 +371,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
mainFrame.getPanel().importShape((SWF) openable, true);
|
||||
}
|
||||
|
||||
@@ -345,6 +381,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().importSymbolClass((SWF) openable);
|
||||
}
|
||||
@@ -353,6 +392,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return export(false);
|
||||
}
|
||||
@@ -361,6 +403,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return false;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return export(true);
|
||||
}
|
||||
@@ -380,6 +425,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().exportFla((SWF) openable);
|
||||
}
|
||||
@@ -388,6 +436,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().importSwfXml(mainFrame.getPanel().getCurrentTree().getSelected());
|
||||
}
|
||||
@@ -396,6 +447,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().exportSwfXml(mainFrame.getPanel().getCurrentTree().getSelected());
|
||||
}
|
||||
@@ -436,6 +490,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Main.showProxy();
|
||||
}
|
||||
@@ -449,6 +506,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().renameOneIdentifier((SWF) openable);
|
||||
}
|
||||
@@ -459,6 +519,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().renameColliding(openable);
|
||||
}
|
||||
@@ -469,6 +532,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().renameIdentifiers(openable);
|
||||
}
|
||||
@@ -477,6 +543,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mainFrame.getPanel().deobfuscate();
|
||||
}
|
||||
@@ -485,6 +554,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AbstractButton button = (AbstractButton) evt.getSource();
|
||||
boolean selected = button.isSelected();
|
||||
@@ -600,6 +672,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Main.checkForUpdates()) {
|
||||
ViewMessages.showMessageDialog(Main.getDefaultMessagesComponent(), translate("update.check.nonewversion"), translate("update.check.title"), JOptionPane.INFORMATION_MESSAGE);
|
||||
@@ -610,6 +685,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String helpUsURL = ApplicationInfo.PROJECT_PAGE;
|
||||
if (!View.navigateUrl(helpUsURL)) {
|
||||
@@ -621,6 +699,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String homePageURL = ApplicationInfo.PROJECT_PAGE;
|
||||
if (!View.navigateUrl(homePageURL)) {
|
||||
@@ -632,11 +713,17 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
if (Main.isWorking()) {
|
||||
return;
|
||||
}
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Main.about();
|
||||
}
|
||||
|
||||
protected boolean reloadActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
if (openable != null) {
|
||||
if (!Configuration.showCloseConfirmation.get() || ViewMessages.showConfirmDialog(Main.getDefaultMessagesComponent(), translate("message.confirm.reload"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||
if (openable.getOpenableList() == null) {
|
||||
@@ -655,6 +742,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
}
|
||||
|
||||
protected boolean reloadAllActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return false;
|
||||
}
|
||||
if (openable != null) {
|
||||
if (!Configuration.showCloseConfirmation.get() || ViewMessages.showConfirmDialog(Main.getDefaultMessagesComponent(), translate("message.confirm.reloadAll"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||
Main.reloadApp();
|
||||
@@ -668,6 +758,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
}
|
||||
|
||||
protected void advancedSettingsActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
Main.advancedSettings();
|
||||
}
|
||||
|
||||
@@ -719,6 +812,9 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
}
|
||||
}*/
|
||||
protected void setLanguageActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
return;
|
||||
}
|
||||
new SelectLanguageDialog(Main.getDefaultDialogsOwner()).display();
|
||||
}
|
||||
|
||||
@@ -1303,15 +1399,37 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
public void showTagListView() {
|
||||
viewTagListActionPerformed(null);
|
||||
}
|
||||
|
||||
private void reselectView() {
|
||||
switch(mainFrame.getPanel().getCurrentView()) {
|
||||
case MainPanel.VIEW_RESOURCES:
|
||||
setMenuChecked("/file/view/viewResources", true);
|
||||
break;
|
||||
case MainPanel.VIEW_TAGLIST:
|
||||
setMenuChecked("/file/view/viewTagList", true);
|
||||
break;
|
||||
case MainPanel.VIEW_DUMP:
|
||||
setMenuChecked("/file/view/viewHex", true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void viewResourcesActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
reselectView();
|
||||
return;
|
||||
}
|
||||
Configuration.dumpView.set(false);
|
||||
mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES);
|
||||
setGroupSelection("view", "/file/view/viewResources");
|
||||
setMenuChecked("/tools/timeline", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void viewHexActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
reselectView();
|
||||
return;
|
||||
}
|
||||
Configuration.dumpView.set(true);
|
||||
MainPanel mainPanel = mainFrame.getPanel();
|
||||
if (mainPanel.isModified()) {
|
||||
@@ -1324,6 +1442,10 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
}
|
||||
|
||||
private void viewTagListActionPerformed(ActionEvent evt) {
|
||||
if (mainFrame.getPanel().checkEdited()) {
|
||||
reselectView();
|
||||
return;
|
||||
}
|
||||
Configuration.dumpView.set(false);
|
||||
MainPanel mainPanel = mainFrame.getPanel();
|
||||
mainPanel.showView(MainPanel.VIEW_TAGLIST);
|
||||
|
||||
Reference in New Issue
Block a user