X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FGuiReader.java;h=2c30ab6740ad49a46a070585fbe581326b75fc1f;hb=6322ab64949f9f4ae2b04b9504d58a301039d670;hp=cdf80d0c9fda7b3d02b0d4b7d045a011f877b551;hpb=5dd985cf7d5e2bb88b07fd43e7b4a4eda4647181;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/reader/GuiReader.java b/src/be/nikiroo/fanfix/reader/GuiReader.java index cdf80d0..2c30ab6 100644 --- a/src/be/nikiroo/fanfix/reader/GuiReader.java +++ b/src/be/nikiroo/fanfix/reader/GuiReader.java @@ -13,10 +13,10 @@ import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import be.nikiroo.fanfix.Instance; -import be.nikiroo.fanfix.LocalLibrary; import be.nikiroo.fanfix.VersionCheck; import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.data.Story; +import be.nikiroo.fanfix.library.LocalLibrary; import be.nikiroo.fanfix.output.BasicOutput.OutputType; import be.nikiroo.utils.Progress; import be.nikiroo.utils.Version; @@ -69,7 +69,6 @@ class GuiReader extends BasicReader { localLibrary = new LocalLibrary(dir, text, images); } - @Override public void read() throws IOException { if (getStory() == null) { throw new IOException("No story to read"); @@ -78,7 +77,6 @@ class GuiReader extends BasicReader { open(getStory().getMeta().getLuid(), null); } - @Override public void read(int chapter) throws IOException { // TODO: show a special page? read(); @@ -105,7 +103,7 @@ class GuiReader extends BasicReader { } try { - Story story = Instance.getLibrary().getStory(luid, pgGetStory); + Story story = getLibrary().getStory(luid, pgGetStory); if (story != null) { story = localLibrary.save(story, luid, pgSave); } else { @@ -131,7 +129,6 @@ class GuiReader extends BasicReader { return localLibrary.getInfo(luid) != null; } - @Override public void browse(String type) { // TODO: improve presentation of update message final VersionCheck updates = VersionCheck.check(); @@ -189,8 +186,7 @@ class GuiReader extends BasicReader { } } - new GuiReaderFrame(GuiReader.this, typeFinal) - .setVisible(true); + new GuiReaderFrame(GuiReader.this, typeFinal).setVisible(true); } }); } @@ -208,7 +204,7 @@ class GuiReader extends BasicReader { void delete(String luid) { try { localLibrary.delete(luid); - Instance.getLibrary().delete(luid); + getLibrary().delete(luid); } catch (IOException e) { Instance.syserr(e); } @@ -222,13 +218,13 @@ class GuiReader extends BasicReader { file = localLibrary.getFile(luid); } - open(getLibrary().getInfo(luid), file); + openExternal(getLibrary().getInfo(luid), file); } void changeType(String luid, String newType) { try { localLibrary.changeSource(luid, newType, null); - Instance.getLibrary().changeSource(luid, newType, null); + getLibrary().changeSource(luid, newType, null); } catch (IOException e) { Instance.syserr(e); }