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 { | |
c1873e56 NR |
8 | public void read() throws IOException { |
9 | if (getStory() == null) { | |
10 | throw new IOException("No story to read"); | |
11 | } | |
12 | ||
b0e88ebd | 13 | open(getLibrary(), getStory().getMeta().getLuid()); |
c1873e56 NR |
14 | } |
15 | ||
c1873e56 NR |
16 | public void read(int chapter) throws IOException { |
17 | // TODO: show a special page? | |
18 | read(); | |
19 | } | |
20 | ||
b0e88ebd | 21 | public void browse(String source) { |
c1873e56 | 22 | try { |
5dd985cf NR |
23 | TuiReaderApplication app = new TuiReaderApplication(getLibrary() |
24 | .getListBySource(source), this); | |
c1873e56 NR |
25 | new Thread(app).start(); |
26 | } catch (Exception e) { | |
27 | Instance.syserr(e); | |
28 | } | |
29 | } | |
30 | } |