from subtree: improve progress names
authorNiki Roo <niki@nikiroo.be>
Sat, 18 Apr 2020 15:33:15 +0000 (17:33 +0200)
committerNiki Roo <niki@nikiroo.be>
Sat, 18 Apr 2020 15:33:15 +0000 (17:33 +0200)
src/.gitattributes [deleted file]
src/.gitignore [deleted file]
src/be/nikiroo/fanfix/library/BasicLibrary.java
src/be/nikiroo/fanfix/supported/BasicSupport.java
src/be/nikiroo/fanfix/supported/Cbz.java

diff --git a/src/.gitattributes b/src/.gitattributes
deleted file mode 100644 (file)
index 409851f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# Auto detect text files and perform LF normalization
-*            text=auto
-
-*.java       text diff=java
-*.properties text
-*.js         text
-*.css        text
-*.less       text
-*.html       text diff=html
-*.jsp        text diff=html
-*.jspx       text diff=html
-*.tag        text diff=html
-*.tagx       text diff=html
-*.tld        text
-*.xml        text
-*.gradle     text
-
-*.sql        text
-
-*.xsd        text
-*.dtd        text
-*.mod        text
-*.ent        text
-
-*.txt        text
-*.md         text
-*.markdown   text
-
-*.thtest     text
-*.thindex    text
-*.common     text
-
-*.odt        binary
-*.pdf        binary
-
-*.sh         text eol=lf
-*.bat        text eol=crlf
-
-*.ico        binary
-*.png        binary
-*.svg        binary
-*.woff       binary
-
-*.rar        binary
-*.zargo      binary
-*.zip        binary
-
-CNAME        text
-*.MF         text
diff --git a/src/.gitignore b/src/.gitignore
deleted file mode 100644 (file)
index 5c79834..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.classpath
-.project
-target/
-bin/
-.settings/
-.idea/
-*.iml
-
index c2ab12b7b735d8349b51ea1beaaeab3ca7bac8e8..7f286079ed1fe87c88f2ec798a85c26774950089 100644 (file)
@@ -755,6 +755,7 @@ abstract public class BasicLibrary {
                }
 
                Story story = save(support.process(pgProcess), pgSave);
+               pg.setName(story.getMeta().getTitle());
                pg.done();
 
                return story.getMeta();
@@ -872,13 +873,18 @@ abstract public class BasicLibrary {
         */
        public synchronized Story save(Story story, String luid, Progress pg)
                        throws IOException {
-
+               if (pg == null) {
+                       pg = new Progress();
+               }
+               
                Instance.getInstance().getTraceHandler().trace(this.getClass().getSimpleName() + ": saving story " + luid);
 
                // Do not change the original metadata, but change the original story
                MetaData meta = story.getMeta().clone();
                story.setMeta(meta);
 
+               pg.setName("Saving story");
+               
                if (luid == null || luid.isEmpty()) {
                        meta.setLuid(String.format("%03d", getNextId()));
                } else {
@@ -896,6 +902,8 @@ abstract public class BasicLibrary {
                Instance.getInstance().getTraceHandler()
                                .trace(this.getClass().getSimpleName() + ": story saved (" + luid + ")");
 
+               pg.setName(meta.getTitle());
+               pg.done();
                return story;
        }
 
index bc91e8b40d0688e96b8ae8698f9e252ae2fe3bec..ba2164cacac6f077ab1f4d1c97e23b9d9a56f31d 100644 (file)
@@ -336,6 +336,8 @@ public abstract class BasicSupport {
                } else {
                        pg.setMinMax(0, 100);
                }
+               
+               pg.setName("Initialising");
 
                pg.setProgress(1);
                Progress pgMeta = new Progress();
@@ -343,7 +345,7 @@ public abstract class BasicSupport {
                Story story = processMeta(true, pgMeta);
                pgMeta.done(); // 10%
 
-               pg.setName("Retrieving " + story.getMeta().getTitle());
+               pg.setName(story.getMeta().getTitle());
 
                Progress pgGetChapters = new Progress();
                pg.addProgress(pgGetChapters, 10);
@@ -390,6 +392,7 @@ public abstract class BasicSupport {
                        pgChaps.done();
                }
 
+               pg.setName(story.getMeta().getTitle());
                pg.done();
 
                return story;
index 76b66aba7c75fa24317eb4daca6ff75854658326..cf6033523a05cbb509ebab2052c2d285cfdffd4d 100644 (file)
@@ -63,6 +63,8 @@ class Cbz extends Epub {
                } else {
                        pg.setMinMax(0, 100);
                }
+               
+               pg.setName("Initialising");
 
                Progress pgMeta = new Progress();
                pg.addProgress(pgMeta, 10);
@@ -70,6 +72,8 @@ class Cbz extends Epub {
                MetaData meta = story.getMeta();
 
                pgMeta.done(); // 10%
+               
+               pg.setName(meta.getTitle());
 
                File tmpDir = Instance.getInstance().getTempFiles().createTempDir("info-text");
                String basename = null;
@@ -193,7 +197,9 @@ class Cbz extends Epub {
                        }
                }
 
-               pg.setProgress(100);
+               pg.setName(meta.getTitle());
+               pg.done();
+               
                return story;
        }