[FEATURE] Added check for nightly version

This commit is contained in:
JKetelaar
2016-10-18 20:58:45 +02:00
parent ab707bece5
commit 51859b90ff
+19
View File
@@ -3,15 +3,19 @@ package org.parabot.core;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import org.parabot.Landing;
import org.parabot.api.translations.TranslationHelper;
import org.parabot.core.ui.utils.UILog;
import org.parabot.environment.api.utils.Version;
import org.parabot.environment.api.utils.WebUtil;
import javax.swing.*;
import java.awt.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.security.MessageDigest;
@@ -229,6 +233,21 @@ public class Core {
}
}
public static void downloadNewVersion(){
UILog.log(TranslationHelper.translate("UPDATES"),
TranslationHelper.translate("DOWNLOAD_UPDATE_PARABOT_AT")
+ Configuration.DOWNLOAD_BOT + (currentVersion.isNightly() ? Configuration.NIGHTLY_APPEND : ""),
JOptionPane.INFORMATION_MESSAGE);
URI uri = URI.create(Configuration.API_DOWNLOAD_BOT + (currentVersion.isNightly() ? Configuration.NIGHTLY_APPEND : ""));
try {
Desktop.getDesktop().browse(uri);
} catch (IOException e1) {
JOptionPane.showMessageDialog(null, TranslationHelper.translate("CONNECTION_ERROR"),
TranslationHelper.translate("ERROR"), JOptionPane.ERROR_MESSAGE);
e1.printStackTrace();
}
}
/**
* Checks for updates.
*