Progress handling in BasicOutput
[fanfix.git] / src / be / nikiroo / fanfix / Main.java
index e6f584f30388a29e530e4310caeef742ebd11454..09635da1e20243482401c5da545378ee97243489 100644 (file)
@@ -411,12 +411,19 @@ public class Main {
                                        BasicSupport support = BasicSupport.getSupport(source);
 
                                        if (support != null) {
-                                               Story story = support.process(source, pg);
+                                               Progress pgIn = new Progress();
+                                               Progress pgOut = new Progress();
+                                               if (pg != null) {
+                                                       pg.setMax(2);
+                                                       pg.addProgress(pgIn, 1);
+                                                       pg.addProgress(pgOut, 1);
+                                               }
 
+                                               Story story = support.process(source, pgIn);
                                                try {
                                                        target = new File(target).getAbsolutePath();
                                                        BasicOutput.getOutput(type, infoCover).process(
-                                                                       story, target);
+                                                                       story, target, pgOut);
                                                } catch (IOException e) {
                                                        Instance.syserr(new IOException(trans(
                                                                        StringId.ERR_SAVING, target), e));