From: Niki Roo Date: Mon, 20 Feb 2017 14:45:31 +0000 (+0100) Subject: CSS change, some fallbacks programs for Desktop X-Git-Tag: fanfix-1.2.0~1 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=63985d926fe1649517bc06d8f50761925b4c9984;p=fanfix.git CSS change, some fallbacks programs for Desktop --- diff --git a/src/be/nikiroo/fanfix/output/epub.style.css b/src/be/nikiroo/fanfix/output/epub.style.css index 3999b9c..4bdab39 100644 --- a/src/be/nikiroo/fanfix/output/epub.style.css +++ b/src/be/nikiroo/fanfix/output/epub.style.css @@ -40,7 +40,7 @@ h1 { } .book, .chapter_content { - text-indent: 40px; + NO_text-indent: 40px; padding-top: 40px; padding-left: 5%; padding-right: 5%; @@ -83,19 +83,20 @@ h2 .chaptitle { } .normals { - /* padding-bottom: 20px; */ - } .normal { - /* padding-bottom: 20px; */ - + /* Can be removed if you want a more "compact" view */ + display: block; +} + +.blank { + /* Can be removed if you want a more "compact" view */ + height: 24px; + width: 100%; } .dialogues { - /* padding-top: 10px; - padding-bottom: 10px; */ - } .dialogue { diff --git a/src/be/nikiroo/fanfix/output/html.style.css b/src/be/nikiroo/fanfix/output/html.style.css index fd7cdec..2f88f0c 100644 --- a/src/be/nikiroo/fanfix/output/html.style.css +++ b/src/be/nikiroo/fanfix/output/html.style.css @@ -42,7 +42,7 @@ h1 { } .book, .chapter_content { - text-indent: 40px; + NO_text-indent: 40px; padding-top: 40px; padding-left: 5%; padding-right: 5%; @@ -85,19 +85,20 @@ h2 .chaptitle { } .normals { - /* padding-bottom: 20px; */ - } .normal { - /* padding-bottom: 20px; */ - + /* Can be removed if you want a more "compact" view */ + display: block; +} + +.blank { + /* Can be removed if you want a more "compact" view */ + height: 24px; + width: 100%; } .dialogues { - /* padding-top: 10px; - padding-bottom: 10px; */ - } .dialogue { diff --git a/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java b/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java index 966869f..9d39017 100644 --- a/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java +++ b/src/be/nikiroo/fanfix/reader/LocalReaderFrame.java @@ -99,7 +99,34 @@ class LocalReaderFrame extends JFrame { try { File target = LocalReaderFrame.this.reader .getTarget(luid, pg); - Desktop.getDesktop().browse(target.toURI()); + // TODO: allow custom programs, with + // Desktop/xdg-open fallback + try { + Desktop.getDesktop().browse(target.toURI()); + } catch (UnsupportedOperationException e) { + String browsers[] = new String[] { + "xdg-open", "epiphany", + "konqueror", "firefox", "chrome", + "google-chrome", "mozilla" }; + + Runtime runtime = Runtime.getRuntime(); + for (String browser : browsers) { + try { + runtime.exec(new String[] { + browser, + target.getAbsolutePath() }); + runtime = null; + break; + } catch (IOException ioe) { + // continue, try next browser + } + } + + if (runtime != null) { + throw new IOException( + "Cannot find a working GUI browser..."); + } + } } catch (IOException e) { Instance.syserr(e); }