updater changed extends thread to implementsa runnable
This commit is contained in:
parent
86c84479d8
commit
edcbe4b278
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -32,7 +32,6 @@ import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.lang.Thread.State;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
@ -184,7 +183,7 @@ public class MainWindowController {
|
||||||
static boolean firststart = false;
|
static boolean firststart = false;
|
||||||
private int hashA = -2055934614;
|
private int hashA = -2055934614;
|
||||||
private String version = "0.5.1";
|
private String version = "0.5.1";
|
||||||
private String buildNumber = "125";
|
private String buildNumber = "127";
|
||||||
private String versionName = "plasma cow";
|
private String versionName = "plasma cow";
|
||||||
private String buildURL = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/buildNumber.txt";
|
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";
|
private String downloadLink = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/downloadLink.txt";
|
||||||
|
@ -470,13 +469,9 @@ public class MainWindowController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private void updateBtnAction(){
|
private void updateBtnAction(){
|
||||||
System.out.println(Updater.getState());
|
Thread updateThread = new Thread(Updater);
|
||||||
if(Updater.getState() == State.NEW){
|
updateThread.setName("Updater");
|
||||||
Updater.start();
|
updateThread.start();
|
||||||
}else{
|
|
||||||
Updater.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -763,8 +758,10 @@ public class MainWindowController {
|
||||||
if(autoUpdate){
|
if(autoUpdate){
|
||||||
autoupdateBtn.setSelected(true);
|
autoupdateBtn.setSelected(true);
|
||||||
try {
|
try {
|
||||||
Updater.start();
|
Thread updateThread = new Thread(Updater);
|
||||||
Updater.join();
|
updateThread.setName("Updater");
|
||||||
|
updateThread.start();
|
||||||
|
updateThread.join();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
|
|
||||||
public class updater extends Thread{
|
public class updater implements Runnable{
|
||||||
|
|
||||||
private MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
private String buildURL;
|
private String buildURL;
|
||||||
|
|
Loading…
Reference in New Issue