Commit | Line | Data |
---|---|---|
c1873e56 NR |
1 | package be.nikiroo.fanfix.reader; |
2 | ||
3 | import java.io.IOException; | |
c1873e56 NR |
4 | |
5 | import be.nikiroo.fanfix.Instance; | |
c1873e56 NR |
6 | |
7 | class TuiReader extends BasicReader { | |
8 | @Override | |
9 | public void read() throws IOException { | |
10 | if (getStory() == null) { | |
11 | throw new IOException("No story to read"); | |
12 | } | |
13 | ||
b0e88ebd | 14 | open(getLibrary(), getStory().getMeta().getLuid()); |
c1873e56 NR |
15 | } |
16 | ||
17 | @Override | |
18 | public void read(int chapter) throws IOException { | |
19 | // TODO: show a special page? | |
20 | read(); | |
21 | } | |
22 | ||
23 | @Override | |
b0e88ebd | 24 | public void browse(String source) { |
c1873e56 | 25 | try { |
5dd985cf NR |
26 | TuiReaderApplication app = new TuiReaderApplication(getLibrary() |
27 | .getListBySource(source), this); | |
c1873e56 NR |
28 | new Thread(app).start(); |
29 | } catch (Exception e) { | |
30 | Instance.syserr(e); | |
31 | } | |
32 | } | |
33 | } |