updater changed extends thread to implementsa runnable

This commit is contained in:
Seil0 2017-05-07 18:56:41 +02:00
parent 86c84479d8
commit edcbe4b278
11 changed files with 9 additions and 12 deletions

Binary file not shown.

View File

@ -32,7 +32,6 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.Thread.State;
import java.math.BigInteger;
import java.net.URI;
import java.net.URISyntaxException;
@ -184,7 +183,7 @@ public class MainWindowController {
static boolean firststart = false;
private int hashA = -2055934614;
private String version = "0.5.1";
private String buildNumber = "125";
private String buildNumber = "127";
private String versionName = "plasma cow";
private String buildURL = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/buildNumber.txt";
private String downloadLink = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/downloadLink.txt";
@ -470,13 +469,9 @@ public class MainWindowController {
@FXML
private void updateBtnAction(){
System.out.println(Updater.getState());
if(Updater.getState() == State.NEW){
Updater.start();
}else{
Updater.run();
}
Thread updateThread = new Thread(Updater);
updateThread.setName("Updater");
updateThread.start();
}
@FXML
@ -763,8 +758,10 @@ public class MainWindowController {
if(autoUpdate){
autoupdateBtn.setSelected(true);
try {
Updater.start();
Updater.join();
Thread updateThread = new Thread(Updater);
updateThread.setName("Updater");
updateThread.start();
updateThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}

View File

@ -17,7 +17,7 @@ import org.apache.commons.io.FileUtils;
import javafx.application.Platform;
public class updater extends Thread{
public class updater implements Runnable{
private MainWindowController mainWindowController;
private String buildURL;