mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 16:49:10 +00:00
[FEATURE] Added check for nightly version
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user