X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FTuiReader.java;h=8456da3f29d1b02ad0f05958c774925a81d443de;hp=91b62683aff9de15da1645a7ac08e62cacb7c916;hb=bc2ea776b67cabcbdcbbc6d8a4e2df1aafa9101a;hpb=6322ab64949f9f4ae2b04b9504d58a301039d670 diff --git a/src/be/nikiroo/fanfix/reader/TuiReader.java b/src/be/nikiroo/fanfix/reader/TuiReader.java index 91b6268..8456da3 100644 --- a/src/be/nikiroo/fanfix/reader/TuiReader.java +++ b/src/be/nikiroo/fanfix/reader/TuiReader.java @@ -49,27 +49,9 @@ class TuiReader extends BasicReader { return backendType; } - public void read(int chapter) throws IOException { - if (getStory() == null) { - throw new IOException("No story to read"); - } - - start(getStory().getMeta(), chapter); - } - - public void browse(String source) { - start(getLibrary().getListBySource(source)); - } - - /** - * Start the application with the given stories. - * - * @param metas - * the stories to display - */ - private void start(List metas) { + public void read() throws IOException { try { - TuiReaderApplication app = new TuiReaderApplication(metas, this, + TuiReaderApplication app = new TuiReaderApplication(this, guessBackendType()); new Thread(app).start(); } catch (Exception e) { @@ -77,19 +59,11 @@ class TuiReader extends BasicReader { } } - /** - * Start the application with the given {@link MetaData} at the given open - * chapter. - * - * @param meta - * the story to display - * @param chapter - * the chapter to open - */ - private void start(MetaData meta, int chapter) { + public void browse(String source) { + List metas = getLibrary().getListBySource(source); try { - TuiReaderApplication app = new TuiReaderApplication(meta, chapter, - this, guessBackendType()); + TuiReaderApplication app = new TuiReaderApplication(metas, this, + guessBackendType()); new Thread(app).start(); } catch (Exception e) { Instance.syserr(e);