GUI_NON_IMAGES_DOCUMENT_TYPE, //
@Meta(format = Format.COMBO_LIST, list = { "CBZ", "HTML" }, description = "The type of output for the GUI Reader for images documents")
GUI_IMAGES_DOCUMENT_TYPE, //
+ @Meta(format = Format.BOOLEAN, description = "Use the internal reader for images documents -- this is TRUE by default")
+ IMAGES_DOCUMENT_USE_INTERNAL_READER, //
@Meta(info = "A command to start", description = "The command launched for images documents -- default to the system default for the current file type")
IMAGES_DOCUMENT_READER, //
+ @Meta(format = Format.BOOLEAN, description = "Use the internal reader for non images documents -- this is TRUE by default")
+ NON_IMAGES_DOCUMENT_USE_INTERNAL_READER, //
@Meta(info = "A command to start", description = "The command launched for non images documents -- default to the system default for the current file type")
NON_IMAGES_DOCUMENT_READER, //
@Meta(format = Format.COLOR, description = "The background colour if you don't want the default system one")
-# United States (en_US) resources translation file (UTF-8)
+# United Kingdom (en_GB) resources translation file (UTF-8)
#
# Note that any key can be doubled with a _NOUTF suffix
# to use when the NOUTF env variable is set to 1
INPUT_DESC_E_HENTAI = Website offering many comics/mangas, mostly but not always NSFW
# Description of this input type
# (FORMAT: STRING)
-INPUT_DESC_MANGA_LEL = Website offering many mangas, in French
-# Description of this input type
-# (FORMAT: STRING)
INPUT_DESC_YIFFSTAR = A Furry website, story-oriented
# Description of this input type
# (FORMAT: STRING)
INPUT_DESC_E_HENTAI = Un site web proposant beaucoup de comics/mangas, souvent mais pas toujours NSFW
# Description of this input type
# (FORMAT: STRING)
-INPUT_DESC_MANGA_LEL = Un site web proposant beaucoup de mangas, en Français
-# Description of this input type
-# (FORMAT: STRING)
INPUT_DESC_YIFFSTAR = Un site web Furry, orienté sur les histoires plutôt que les images
# Description of this input type
# (FORMAT: STRING)
# (FORMAT: COMBO_LIST)
# ALLOWED VALUES: "CBZ" "HTML"
GUI_IMAGES_DOCUMENT_TYPE = CBZ
+# Use the internal reader for images documents -- this is TRUE by default
+# (FORMAT: BOOLEAN)
+IMAGES_DOCUMENT_USE_INTERNAL_READER =
# The command launched for images documents -- default to the system default for the current file type
# (FORMAT: STRING) A command to start
IMAGES_DOCUMENT_READER =
+# Use the internal reader for non images documents -- this is TRUE by default
+# (FORMAT: BOOLEAN)
+NON_IMAGES_DOCUMENT_USE_INTERNAL_READER =
# The command launched for non images documents -- default to the system default for the current file type
# (FORMAT: STRING) A command to start
NON_IMAGES_DOCUMENT_READER =
#
-# The directory where to store temporary files, defaults to directory 'tmp.reader' in the conig directory (usually $HOME/.fanfix)
+# The directory where to store temporary files, defaults to directory 'tmp.reader' in the config directory (usually $HOME/.fanfix)
# (FORMAT: DIRECTORY) absolute path, $HOME variable supported, / is always accepted as dir separator
CACHE_DIR_LOCAL_READER = The directory where to store temporary files, defaults to directory 'tmp.reader' in the config directory (usually $HOME/.fanfix) -- this is an absolute path, $HOME variable supported, / is always accepted as dir separator
# The type of output for the GUI Reader for non-images documents
# (FORMAT: COMBO_LIST)
# ALLOWED VALUES: "CBZ" "HTML"
GUI_IMAGES_DOCUMENT_TYPE =
+# Use the internal reader for images documents -- this is TRUE by default
+# (FORMAT: BOOLEAN)
+IMAGES_DOCUMENT_USE_INTERNAL_READER =
# The command launched for images documents -- default to the system default for the current file type
# (FORMAT: STRING) A command to start
IMAGES_DOCUMENT_READER =
+# Use the internal reader for non images documents -- this is TRUE by default
+# (FORMAT: BOOLEAN)
+NON_IMAGES_DOCUMENT_USE_INTERNAL_READER =
# The command launched for non images documents -- default to the system default for the current file type
# (FORMAT: STRING) A command to start
NON_IMAGES_DOCUMENT_READER =
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.VersionCheck;
+import be.nikiroo.fanfix.bundles.UiConfig;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.library.BasicLibrary;
* in case of I/O errors
*/
void read(String luid, boolean sync, Progress pg) throws IOException {
- File file = cacheLib.getFile(luid, pg);
+ MetaData meta = cacheLib.getInfo(luid);
- GuiReaderViewer viewer = new GuiReaderViewer(cacheLib,
- cacheLib.getStory(luid, null));
+ boolean textInternal = Instance.getUiConfig().getBoolean(
+ UiConfig.NON_IMAGES_DOCUMENT_USE_INTERNAL_READER, true);
+ boolean imageInternal = Instance.getUiConfig().getBoolean(
+ UiConfig.IMAGES_DOCUMENT_USE_INTERNAL_READER, true);
- // TODO: testing internal story viewer:
- if (false) {
+ boolean useInternalViewer = true;
+ if (meta.isImageDocument() && !imageInternal) {
+ useInternalViewer = false;
+ }
+ if (!meta.isImageDocument() && !textInternal) {
+ useInternalViewer = false;
+ }
+
+ if (useInternalViewer) {
+ GuiReaderViewer viewer = new GuiReaderViewer(cacheLib,
+ cacheLib.getStory(luid, null));
if (sync) {
sync(viewer);
} else {
viewer.setVisible(true);
}
} else {
- openExternal(getLibrary().getInfo(luid), file, sync);
+ File file = cacheLib.getFile(luid, pg);
+ openExternal(meta, file, sync);
}
}