fix TUI
authorNiki Roo <niki@nikiroo.be>
Mon, 20 May 2019 04:41:56 +0000 (06:41 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 20 May 2019 04:41:56 +0000 (06:41 +0200)
libs/jexer-0.3.1-Gitlab_2019-03-09-niki2-sources.jar [moved from libs/jexer-0.3.1-Gitlab_2019-03-09-niki1-sources.jar with 54% similarity]
src/be/nikiroo/fanfix/reader/tui/TuiReader.java
src/be/nikiroo/fanfix/reader/tui/TuiReaderApplication.java

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 0e9c0c3a885aa926e1fd364630f34475567a1009..11786e2c92ecebb8a07d853bb91ea3bf1a7c8e0b 100644 (file)
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
index bef84eae46c92ae9f41ea14f0c69f75d99e5927d..4da86c51e7825b719c01260aa858891d100153d2 100644 (file)
@@ -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);
                }
index b6f31ff4e9b43b98e4fadf3bc655b66f02225fa4..2b02dd00060b067a0d44c3d4db9d9304e7577f60 100644 (file)
@@ -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);
        }