From b2612f9dcd0a37f4ec22fcabe55390280e06daf2 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 4 Mar 2017 10:28:46 +0100 Subject: [PATCH] (README update) --- README.md | 20 +++++++++--- src/be/nikiroo/fanfix/bundles/StringId.java | 5 +++ .../fanfix/bundles/resources.properties | 9 ++++++ src/be/nikiroo/fanfix/output/BasicOutput.java | 4 +++ .../fanfix/reader/LocalReaderFrame.java | 32 +++++++++++-------- 5 files changed, 51 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2f0c954..01f7419 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,10 @@ Note that calling ```make libs``` will export the libraries into the src/ direct ## TODO Currently missing, but either in progress or planned: +- [ ] Support new websites + - [x] YiffStar + - [ ] [Two Kinds](http://twokinds.keenspot.com/) + - [ ] [Slightly damned](http://www.sdamned.com/) - [ ] A GUI (work in progress) - [x] Make one - [x] Make it run when no args passed @@ -96,24 +100,30 @@ Currently missing, but either in progress or planned: - [x] Work on the UI thread is BAD - [x] Allow export - [x] Allow delete/refresh - - [ ] Show a list of types + - [x] Show a list of types - [x] ..in the menu - - [ ] ..as a screen view + - [x] ..as a screen view - [ ] options screen - [ ] A TUI reader - [ ] Check if it can work on Android + - [x] First checks: it should work, but with changes + - [ ] Adapt work on images :( + - [ ] Partial/Conditional compilation + - [ ] APK export - [ ] Translations - [x] i18n system in place - [x] Make use of it - - [x] Use it for most user ouput - [ ] Use it for all user output - [ ] French translation -- [x] Allow lauching a custom application instead of Desktop.start ? - - [ ] Make a wrapper for firefox to create a new, empty profile ? +- [x] Allow lauching a custom application instead of Desktop.start - [x] Install a mechanism to handle stories import/export progress update - [x] Progress system - [x] in support classes (import) - [x] in output classes (export) - [x] CLI usage of such - [x] GUI usage of such +- [ ] Version + - [x] Use a version number + - [x] Show it in UI + - [ ] A check-update feature diff --git a/src/be/nikiroo/fanfix/bundles/StringId.java b/src/be/nikiroo/fanfix/bundles/StringId.java index bf496fb..b910aef 100644 --- a/src/be/nikiroo/fanfix/bundles/StringId.java +++ b/src/be/nikiroo/fanfix/bundles/StringId.java @@ -89,9 +89,12 @@ public enum StringId { @Meta(what = "output format description", where = "OutputType", format = "", info = "Description of this output type") OUTPUT_DESC_CBZ, // @Meta(what = "output format description", where = "OutputType", format = "", info = "Description of this output type") + OUTPUT_DESC_HTML, // + @Meta(what = "output format description", where = "OutputType", format = "", info = "Description of this output type") OUTPUT_DESC_LATEX, // @Meta(what = "short output format description", where = "OutputType", format = "", info = "Description of this output type") OUTPUT_DESC_SYSOUT, // + @Meta(what = "short output format description", where = "OutputType", format = "%s = type", info = "Default description when the type is not known by i18n") OUTPUT_DESC_SHORT, // @Meta(what = "short output format description", where = "OutputType", format = "", info = "Description of this output type") OUTPUT_DESC_SHORT_EPUB, // @@ -105,6 +108,8 @@ public enum StringId { OUTPUT_DESC_SHORT_LATEX, // @Meta(what = "short output format description", where = "OutputType", format = "", info = "Description of this output type") OUTPUT_DESC_SHORT_SYSOUT, // + @Meta(what = "short output format description", where = "OutputType", format = "", info = "Description of this output type") + OUTPUT_DESC_SHORT_HTML, // @Meta(what = "error message", where = "LaTeX", format = "%s = the unknown 2-code language", info = "Error message for unknown 2-letter LaTeX language code") LATEX_LANG_UNKNOWN, // @Meta(what = "'by' prefix before author name", where = "", format = "", info = "used to output the author, make sure it is covered by Config.BYS for input detection") diff --git a/src/be/nikiroo/fanfix/bundles/resources.properties b/src/be/nikiroo/fanfix/bundles/resources.properties index a317eb1..1d142f3 100644 --- a/src/be/nikiroo/fanfix/bundles/resources.properties +++ b/src/be/nikiroo/fanfix/bundles/resources.properties @@ -125,10 +125,16 @@ OUTPUT_DESC_INFO_TEXT = Contains the same information as the TEXT format, but wi OUTPUT_DESC_CBZ = CBZ file (basically a ZIP file containing images -- we store the images in PNG format) # (WHAT: output format description, WHERE: OutputType) # Description of this output type +OUTPUT_DESC_HTML = HTML files (a directory containing the resources and "index.html") +# (WHAT: output format description, WHERE: OutputType) +# Description of this output type OUTPUT_DESC_LATEX = A LaTeX file using the "book" template # (WHAT: short output format description, WHERE: OutputType) # Description of this output type OUTPUT_DESC_SYSOUT = A simple DEBUG console output +# (WHAT: short output format description, WHERE: OutputType, FORMAT: %s = type) +# Default description when the type is not known by i18n +OUTPUT_DESC_SHORT = %s # (WHAT: short output format description, WHERE: OutputType) # Description of this output type OUTPUT_DESC_SHORT_EPUB = Electronic book (.epub) @@ -147,6 +153,9 @@ OUTPUT_DESC_SHORT_LATEX = LaTeX (.tex) # (WHAT: short output format description, WHERE: OutputType) # Description of this output type OUTPUT_DESC_SHORT_SYSOUT = Console output +# (WHAT: short output format description, WHERE: OutputType) +# Description of this output type +OUTPUT_DESC_SHORT_HTML = HTML files with resources (directory, .html) # (WHAT: error message, WHERE: LaTeX, FORMAT: %s = the unknown 2-code language) # Error message for unknown 2-letter LaTeX language code LATEX_LANG_UNKNOWN = Unknown language: %s diff --git a/src/be/nikiroo/fanfix/output/BasicOutput.java b/src/be/nikiroo/fanfix/output/BasicOutput.java index babe753..9bf096c 100644 --- a/src/be/nikiroo/fanfix/output/BasicOutput.java +++ b/src/be/nikiroo/fanfix/output/BasicOutput.java @@ -67,6 +67,10 @@ public abstract class BasicOutput { desc = Instance.getTrans().getString(id, this); } + if (desc == null) { + desc = this.toString(); + } + return desc; } diff --git a/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java b/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java index 1d303a2..d50669d 100644 --- a/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java +++ b/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java @@ -318,6 +318,7 @@ class LocalReaderFrame extends JFrame { for (OutputType type : OutputType.values()) { String ext = type.getDefaultExtension(false); String desc = type.getDesc(false); + if (ext == null || ext.isEmpty()) { filters.put(createAllFilter(desc), type); } else { @@ -343,21 +344,24 @@ class LocalReaderFrame extends JFrame { public void actionPerformed(ActionEvent e) { if (selectedBook != null) { fc.showDialog(LocalReaderFrame.this, "Save"); - final OutputType type = filters.get(fc.getFileFilter()); - final String path = fc.getSelectedFile().getAbsolutePath() - + type.getDefaultExtension(false); - final Progress pg = new Progress(); - outOfUi(pg, new Runnable() { - public void run() { - try { - Instance.getLibrary().export( - selectedBook.getMeta().getLuid(), type, - path, pg); - } catch (IOException e) { - Instance.syserr(e); + if (fc.getSelectedFile() != null) { + final OutputType type = filters.get(fc.getFileFilter()); + final String path = fc.getSelectedFile() + .getAbsolutePath() + + type.getDefaultExtension(false); + final Progress pg = new Progress(); + outOfUi(pg, new Runnable() { + public void run() { + try { + Instance.getLibrary().export( + selectedBook.getMeta().getLuid(), + type, path, pg); + } catch (IOException e) { + Instance.syserr(e); + } } - } - }); + }); + } } } }); -- 2.27.0