From: Niki Roo Date: Thu, 14 May 2020 13:18:10 +0000 (+0200) Subject: update from master X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=b063fe0a74fdf17f440a850bbb98a2de6233a679;p=fanfix-swing.git update from master --- diff --git a/data/MetaData.java b/data/MetaData.java index 586196a6..bcebf754 100644 --- a/data/MetaData.java +++ b/data/MetaData.java @@ -34,6 +34,12 @@ public class MetaData implements Cloneable, Comparable, Serializable { private String creationDate; private boolean fakeCover; + /** + * Create an empty {@link MetaData}. + */ + public MetaData() { + } + /** * The title of the story. * @@ -479,8 +485,9 @@ public class MetaData implements Cloneable, Comparable, Serializable { } return String.format( - "Meta %s:\n\tTitle: [%s]\n\tAuthor: [%s]\n\tDate: [%s]\n\tTags: [%s]" - + "\n\tResume: [%s]\n\tCover: [%s]", luid, title, - getAuthor(), getDate(), tags.toString(), resume, cover); + "Meta %s:\n\tTitle: [%s]\n\tAuthor: [%s]\n\tDate: [%s]\n\tTags: [%s]\n\tWord count: [%s]" + + "\n\tResume: [%s]\n\tCover: [%s]", + luid, title, getAuthor(), getDate(), tags.toString(), + "" + words, resume, cover); } } diff --git a/library/WebLibraryServer.java b/library/WebLibraryServer.java index 9073b8ca..b3d897d0 100644 --- a/library/WebLibraryServer.java +++ b/library/WebLibraryServer.java @@ -28,6 +28,7 @@ import be.nikiroo.utils.NanoHTTPD; import be.nikiroo.utils.NanoHTTPD.Response; import be.nikiroo.utils.NanoHTTPD.Response.Status; import be.nikiroo.utils.Progress; +import be.nikiroo.utils.Progress.ProgressListener; public class WebLibraryServer extends WebLibraryServerHtml { class WLoginResult extends LoginResult { @@ -414,6 +415,14 @@ public class WebLibraryServer extends WebLibraryServerHtml { final Progress pg = new Progress(); final String luid = lib.getNextId(); + // Keep the latest name + pg.addProgressListener(new ProgressListener() { + @Override + public void progress(Progress progress, String name) { + pg.setName(name); + } + }); + synchronized (imprts) { imprts.put(luid, pg); }