Skip to content

Commit

Permalink
reworked loadSettings
Browse files Browse the repository at this point in the history
* loadSettings() should be 100% bulletproof
* replaced a few more syso with logger
  • Loading branch information
Seil0 committed Aug 30, 2017
1 parent 71cf031 commit 6c1663f
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 81 deletions.
Binary file modified bin/application/CloudController$1.class
Binary file not shown.
Binary file modified bin/application/CloudController$2.class
Binary file not shown.
Binary file modified bin/application/CloudController$3.class
Binary file not shown.
Binary file modified bin/application/CloudController.class
Binary file not shown.
Binary file modified bin/application/Main.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$1.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$10.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$11.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$12.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$2.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$3.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$4.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$5.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$6.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$7.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$8.class
Binary file not shown.
Binary file modified bin/application/MainWindowController$9.class
Binary file not shown.
Binary file modified bin/application/MainWindowController.class
Binary file not shown.
Binary file modified bin/application/SmmdbApiQuery.class
Binary file not shown.
Binary file modified bin/application/playGame.class
Binary file not shown.
7 changes: 5 additions & 2 deletions src/application/CloudController.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void stratupCheck(String cloudService, String cemuDirectory) {
main.mainWindowController.saveSettings();

Thread thread = new Thread(new Runnable() {
public void run() {
@Override
public void run() {
Platform.runLater(() -> {
main.mainWindowController.getPlayBtn().setText("syncing...");
});
Expand Down Expand Up @@ -82,6 +83,7 @@ void sync(String cloudService, String cemuDirectory) {

//running sync in a new thread, instead of blocking the main thread
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
Platform.runLater(() -> {
main.mainWindowController.getPlayBtn().setText("syncing...");
Expand Down Expand Up @@ -113,7 +115,8 @@ void uploadFile(String cloudService, File file) {

//running uploadFile in a new thread, instead of blocking the main thread
new Thread() {
public void run() {
@Override
public void run() {
System.out.println("starting uploadFile in new thread...");

if(cloudService.equals("GoogleDrive")) {
Expand Down
7 changes: 0 additions & 7 deletions src/application/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ private void mainWindow(){
//check if client_secret.jason is present
if (Main.class.getResourceAsStream("/resources/client_secret.json") == null) {
LOGGER.error("client_secret is missing!!!!!");
// System.err.println("client_secret is missing!!!!!");

Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("cemu_UI");
Expand All @@ -102,18 +101,14 @@ private void mainWindow(){

LOGGER.info("Directory: " + directory.exists());
LOGGER.info("Configfile: " + configFile.exists());
// System.out.println("Directory: " + directory.exists());
// System.out.println("configfile: " + configFile.exists());
if(!directory.exists()){
LOGGER.info("creating cemu_UI directory");
// System.out.println("mkdir all");
directory.mkdir();
pictureCache.mkdir();
}

if(!configFile.exists()){
LOGGER.info("firststart, setting default values");
// System.out.println("firststart");
firstStart();
mainWindowController.setColor("00a8cc");
mainWindowController.setxPosHelper(0);
Expand All @@ -129,14 +124,12 @@ private void mainWindow(){
if(gamesDBFile.exists() != true){
try {
LOGGER.info("downloading games.db... ");
// System.out.print("downloading games.db... ");
URL website = new URL(gamesDBdownloadURL);
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(gamesDBFile);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
LOGGER.info("finished downloading games.db");
// System.out.println("done!");
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Loading

0 comments on commit 6c1663f

Please sign in to comment.