X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FGuiReader.java;h=932425838629c945309cfd3979f285ee5b1d0e9a;hp=2c30ab6740ad49a46a070585fbe581326b75fc1f;hb=bc2ea776b67cabcbdcbbc6d8a4e2df1aafa9101a;hpb=6322ab64949f9f4ae2b04b9504d58a301039d670 diff --git a/src/be/nikiroo/fanfix/reader/GuiReader.java b/src/be/nikiroo/fanfix/reader/GuiReader.java index 2c30ab6..9324258 100644 --- a/src/be/nikiroo/fanfix/reader/GuiReader.java +++ b/src/be/nikiroo/fanfix/reader/GuiReader.java @@ -15,6 +15,7 @@ import javax.swing.event.HyperlinkListener; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.VersionCheck; import be.nikiroo.fanfix.bundles.UiConfig; +import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.LocalLibrary; import be.nikiroo.fanfix.output.BasicOutput.OutputType; @@ -70,16 +71,13 @@ class GuiReader extends BasicReader { } public void read() throws IOException { - if (getStory() == null) { + MetaData meta = getMeta(); + + if (meta == null) { throw new IOException("No story to read"); } - open(getStory().getMeta().getLuid(), null); - } - - public void read(int chapter) throws IOException { - // TODO: show a special page? - read(); + read(meta.getLuid(), null); } /** @@ -211,20 +209,21 @@ class GuiReader extends BasicReader { } // open the given book - void open(String luid, Progress pg) throws IOException { + void read(String luid, Progress pg) throws IOException { File file = localLibrary.getFile(luid); if (file == null) { imprt(luid, pg); file = localLibrary.getFile(luid); } + // TODO: show a special page for the chapter? openExternal(getLibrary().getInfo(luid), file); } - void changeType(String luid, String newType) { + void changeType(String luid, String newSource) { try { - localLibrary.changeSource(luid, newType, null); - getLibrary().changeSource(luid, newType, null); + localLibrary.changeSource(luid, newSource, null); + getLibrary().changeSource(luid, newSource, null); } catch (IOException e) { Instance.syserr(e); }