X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FLocalReader.java;h=2b92e721db959fc52aa46af7ebb7799daa4afec5;hb=c1873e5678fabf306915c54f9c1736e03e027d60;hp=45fca8c10a41feb43e2fb9d13bf406241de4e88b;hpb=edd4628984f5f06e955606651fc828ac839f7f43;p=fanfix.git
diff --git a/src/be/nikiroo/fanfix/reader/LocalReader.java b/src/be/nikiroo/fanfix/reader/LocalReader.java
index 45fca8c..2b92e72 100644
--- a/src/be/nikiroo/fanfix/reader/LocalReader.java
+++ b/src/be/nikiroo/fanfix/reader/LocalReader.java
@@ -4,14 +4,22 @@ import java.awt.Desktop;
import java.awt.EventQueue;
import java.io.File;
import java.io.IOException;
+import java.net.URISyntaxException;
+
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.Library;
+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.output.BasicOutput.OutputType;
import be.nikiroo.utils.Progress;
+import be.nikiroo.utils.Version;
class LocalReader extends BasicReader {
private Library lib;
@@ -102,29 +110,6 @@ class LocalReader extends BasicReader {
}
}
- /**
- * Get the target file related to this {@link Story}.
- *
- * @param luid
- * the LUID of the {@link Story}
- * @param pg
- * the optional progress reporter
- *
- * @return the target file
- *
- * @throws IOException
- * in case of I/O error
- */
- public File getTarget(String luid, Progress pg) throws IOException {
- File file = lib.getFile(luid);
- if (file == null) {
- imprt(luid, pg);
- file = lib.getFile(luid);
- }
-
- return file;
- }
-
/**
* Check if the {@link Story} denoted by this Library UID is present in the
* {@link LocalReader} cache.
@@ -140,17 +125,70 @@ class LocalReader extends BasicReader {
@Override
public void start(String type) {
+ // TODO: improve presentation of update message
+ final VersionCheck updates = VersionCheck.check();
+ StringBuilder builder = new StringBuilder();
+
+ final JEditorPane updateMessage = new JEditorPane("text/html", "");
+ if (updates.isNewVersionAvailable()) {
+ builder.append("A new version of the program is available at https://github.com/nikiroo/fanfix/releases");
+ builder.append("
");
+ builder.append("
");
+ for (Version v : updates.getNewer()) {
+ builder.append("\tVersion " + v + "");
+ builder.append("
");
+ builder.append("