From: Niki Roo Date: Mon, 20 May 2019 04:41:56 +0000 (+0200) Subject: fix TUI X-Git-Tag: fanfix-3.0.0~24 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=9cc8cf4a3b4b40d82e91cfcc7658c579a737bb87;p=fanfix.git fix TUI --- diff --git a/libs/jexer-0.3.1-Gitlab_2019-03-09-niki1-sources.jar b/libs/jexer-0.3.1-Gitlab_2019-03-09-niki2-sources.jar similarity index 54% rename from libs/jexer-0.3.1-Gitlab_2019-03-09-niki1-sources.jar rename to libs/jexer-0.3.1-Gitlab_2019-03-09-niki2-sources.jar index 0e9c0c3..11786e2 100644 Binary files a/libs/jexer-0.3.1-Gitlab_2019-03-09-niki1-sources.jar and b/libs/jexer-0.3.1-Gitlab_2019-03-09-niki2-sources.jar differ diff --git a/src/be/nikiroo/fanfix/reader/tui/TuiReader.java b/src/be/nikiroo/fanfix/reader/tui/TuiReader.java index bef84ea..4da86c5 100644 --- a/src/be/nikiroo/fanfix/reader/tui/TuiReader.java +++ b/src/be/nikiroo/fanfix/reader/tui/TuiReader.java @@ -52,10 +52,17 @@ class TuiReader extends BasicReader { @Override public void read(boolean sync) throws IOException { + // TODO + if (!sync) { + // How could you do a not-sync in TUI mode? + throw new java.lang.IllegalStateException( + "Async mode not implemented yet."); + } + try { TuiReaderApplication app = new TuiReaderApplication(this, guessBackendType()); - new Thread(app).start(); + app.run(); } catch (Exception e) { Instance.getTraceHandler().error(e); } @@ -66,7 +73,7 @@ class TuiReader extends BasicReader { try { TuiReaderApplication app = new TuiReaderApplication(this, source, guessBackendType()); - new Thread(app).start(); + app.run(); } catch (Exception e) { Instance.getTraceHandler().error(e); } diff --git a/src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java b/src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java index b6f31ff..2b02dd0 100644 --- a/src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java +++ b/src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java @@ -66,7 +66,7 @@ class TuiReaderApplication extends TApplication implements Reader { TApplication.BackendType backend) throws Exception { super(backend); init(reader); - + showMain(); main.setMode(Mode.SOURCE, source); }