mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 14:20:46 +00:00
This commit is contained in:
@@ -1072,6 +1072,12 @@ public class Main {
|
||||
bos.write((swfSize >> 24) & 0xff);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
stopSaving(savedFile);
|
||||
if (tmpFile.exists()) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
if (tmpFile.exists()) {
|
||||
if (tmpFile.length() > 0) {
|
||||
@@ -1534,13 +1540,36 @@ public class Main {
|
||||
Main.saveFile(swf, fileName, mode, exeExportMode);
|
||||
Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath());
|
||||
return true;
|
||||
} catch (IOException ex) {
|
||||
View.showMessageDialog(null, AppStrings.translate("error.file.write"));
|
||||
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
|
||||
handleSaveError(ex);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void handleSaveError(Throwable ex) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Error saving file", ex);
|
||||
if (ex instanceof OutOfMemoryError) {
|
||||
String errorMessage = AppStrings.translate("error.file.save") + ".";
|
||||
errorMessage += " ";
|
||||
long heapMaxSize = Runtime.getRuntime().maxMemory();
|
||||
long heapMaxSizeMb = heapMaxSize / 1024 / 1024;
|
||||
String currentMaxHeap = "" + heapMaxSizeMb + "m";
|
||||
errorMessage += AppStrings.translate("error.outOfMemory").replace("%maxheap%", currentMaxHeap);
|
||||
errorMessage += "\n";
|
||||
if (Platform.isWindows()) {
|
||||
errorMessage += AppStrings.translate("error.outOfMemory.windows");
|
||||
} else {
|
||||
errorMessage += AppStrings.translate("error.outOfMemory.unixmac");
|
||||
}
|
||||
errorMessage += "\n";
|
||||
errorMessage += AppStrings.translate("error.outOfMemory.64bit");
|
||||
View.showMessageDialog(null, errorMessage, AppStrings.translate("error.outOfMemory.title"), JOptionPane.ERROR_MESSAGE);
|
||||
} else {
|
||||
View.showMessageDialog(null, AppStrings.translate("error.file.save") + ": " + ex.getLocalizedMessage(), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean openFileDialog() {
|
||||
View.checkAccess();
|
||||
|
||||
|
||||
@@ -159,9 +159,8 @@ public abstract class MainFrameMenu implements MenuBuilder {
|
||||
try {
|
||||
Main.saveFile(swf, swf.getFile());
|
||||
saved = true;
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(MainFrameMenu.class.getName()).log(Level.SEVERE, null, ex);
|
||||
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
|
||||
Main.handleSaveError(ex);
|
||||
}
|
||||
}
|
||||
if (saved) {
|
||||
|
||||
@@ -807,4 +807,11 @@ message.character.notfound = Character %characterid% not found.
|
||||
FileChooser.preview = Preview
|
||||
FileChooser.previewNotAvailable = (preview not available)
|
||||
|
||||
button.freetransform = Free transform
|
||||
button.freetransform = Free transform
|
||||
|
||||
error.outOfMemory.title = Error - out of memory
|
||||
error.outOfMemory = The decompiler ran out of memory. Current maximum size of Java Heap is set to %maxheap%.
|
||||
error.outOfMemory.windows = You can increase this maximum by editing "ffdec.bat" file and then running the app via this file instead of "ffdec.exe".
|
||||
error.outOfMemory.unixmac = You can increase this maximum by editing "ffdec.sh" file.
|
||||
error.outOfMemory.64bit = You need 64 bit OS and 64 bit Java to use more than cca 1GB.
|
||||
|
||||
|
||||
@@ -783,4 +783,10 @@ message.character.notfound = Charakter %characterid% nenalezen.
|
||||
FileChooser.preview = N\u00e1hled
|
||||
FileChooser.previewNotAvailable = (n\u00e1hled nen\u00ed dostupn\u00fd)
|
||||
|
||||
button.freetransform = Voln\u00e1 transformace
|
||||
button.freetransform = Voln\u00e1 transformace
|
||||
|
||||
error.outOfMemory.title = Chyba - do\u0161la pam\u011b\u0165
|
||||
error.outOfMemory = Dekompil\u00e1toru do\u0161la pam\u011b\u0165. Aktu\u00e1ln\u00ed maxim\u00e1ln\u00ed velikost Java Heapu je nastavena na %maxheap%.
|
||||
error.outOfMemory.windows = Toto maximum m\u016f\u017eete nav\u00fd\u0161it upraven\u00edm souboru "ffdec.bat" a pak spou\u0161t\u011bn\u00edm aplikace p\u0159es tento soubor m\u00edsto "ffdec.exe".
|
||||
error.outOfMemory.unixmac = Toto maximum m\u016f\u017eete nav\u00fd\u0161it upraven\u00edm souboru "ffdec.sh".
|
||||
error.outOfMemory.64bit = Pro pou\u017eit\u00ed v\u00edc jak zhruba 1GB budete pot\u0159ebovat 64bitov\u00fd opera\u010dn\u00ed syst\u00e9m a 64bitovou Javu.
|
||||
Reference in New Issue
Block a user