diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index a9e8aed6c..bb80fdced 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -542,19 +542,18 @@ public class SWF { String directory; List abcList; boolean pcode; - String informStr; ClassPath path; AtomicInteger index; int count; boolean paralel; AbortRetryIgnoreHandler handler; + long startTime; + long stopTime; - public ExportPackTask(AbortRetryIgnoreHandler handler, AtomicInteger index, int count, ClassPath path, ScriptPack pack, String directory, List abcList, boolean pcode, String informStr, boolean paralel) { + public ExportPackTask(AbortRetryIgnoreHandler handler, AtomicInteger index, int count, ClassPath path, ScriptPack pack, String directory, List abcList, boolean pcode, boolean paralel) { this.pack = pack; this.directory = directory; this.abcList = abcList; - this.pcode = pcode; - this.informStr = informStr; this.path = path; this.index = index; this.count = count; @@ -567,12 +566,15 @@ public class SWF { RunnableIOExResult rio = new RunnableIOExResult() { @Override public void run() throws IOException { + startTime = System.currentTimeMillis(); this.result = pack.export(directory, abcList, pcode, paralel); + stopTime = System.currentTimeMillis(); } }; new RetryTask(rio, handler).run(); synchronized (ABC.class) { - informListeners("export", "Exported " + informStr + " script " + index.getAndIncrement() + "/" + count + " " + path); + long time=stopTime-startTime; + informListeners("export", "Exported script " + index.getAndIncrement() + "/" + count + " " + path+", "+Helper.formatTimeSec(time)); } return null; } @@ -605,7 +607,7 @@ public class SWF { } List> packs = getAS3Packs(); for (MyEntry item : packs) { - Future future = executor.submit(new ExportPackTask(handler, cnt, packs.size(), item.key, item.value, outdir, abcTags, isPcode, "", paralel)); + Future future = executor.submit(new ExportPackTask(handler, cnt, packs.size(), item.key, item.value, outdir, abcTags, isPcode,paralel)); futureResults.add(future); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 373f35155..eb1d2027c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -2598,19 +2598,8 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel Main.stopWork(); long timeAfter = System.currentTimeMillis(); long timeMs = timeAfter - timeBefore; - long timeS = timeMs / 1000; - timeMs = timeMs % 1000; - long timeM = timeS / 60; - timeS = timeS % 60; - long timeH = timeM / 60; - timeM = timeM % 60; - String timeStr = ""; - if (timeH > 0) { - timeStr += Helper.padZeros(timeH, 2) + ":"; - } - timeStr += Helper.padZeros(timeM, 2) + ":"; - timeStr += Helper.padZeros(timeS, 2) + "." + Helper.padZeros(timeMs, 3); - setStatus(translate("export.finishedin").replace("%time%", timeStr)); + + setStatus(translate("export.finishedin").replace("%time%", Helper.formatTimeSec(timeMs))); } }).start(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index a313c381e..dd47425c3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -260,7 +260,7 @@ public class ActionPanel extends JPanel implements ActionListener { }else{ editor.setContentType("text/flasm"); }*/ - editor.setText(stripped); + editor.setText(stripped); for (Highlighting h : disassembledHilights) { if (h.offset == offset) { if (h.startPos <= editor.getText().length()) { diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/Helper.java b/trunk/src/com/jpexs/decompiler/flash/helpers/Helper.java index 3aaa014d8..71089a1ed 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/Helper.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/Helper.java @@ -482,4 +482,20 @@ public class Helper { } } } + + public static String formatTimeSec(long timeMs) { + long timeS = timeMs / 1000; + timeMs = timeMs % 1000; + long timeM = timeS / 60; + timeS = timeS % 60; + long timeH = timeM / 60; + timeM = timeM % 60; + String timeStr = ""; + if (timeH > 0) { + timeStr += Helper.padZeros(timeH, 2) + ":"; + } + timeStr += Helper.padZeros(timeM, 2) + ":"; + timeStr += Helper.padZeros(timeS, 2) + "." + Helper.padZeros(timeMs, 3); + return timeStr; + } }