Improve progress names
[nikiroo-utils.git] / library / BasicLibrary.java
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;
        }