code clean up

* removed old reloadRomBtn code
* fixed an issue where the saveSettings after successfully syncing to the cloud failed
This commit is contained in:
Jannik 2017-11-27 21:57:59 +01:00
parent e0a73a1fbe
commit 46c57ef330
2 changed files with 4 additions and 10 deletions

View File

@ -733,7 +733,6 @@ public class MainWindowController {
@FXML
void reloadRomsBtnAction() throws IOException {
//TODO needs testing
JFXSpinner spinner = new JFXSpinner();
spinner.setPrefSize(30, 30);
main.pane.getChildren().add(spinner);
@ -744,19 +743,14 @@ public class MainWindowController {
@Override
public void run() {
dbController.loadRomDirectory(getRomPath()); // reload the rom directory
refreshUIData(); // refresh the list of games displayed on screen
Platform.runLater(() -> {
refreshUIData(); // refresh the list of games displayed on screen
main.pane.getChildren().remove(spinner);
});
}
});
thread.start();
// reloadRomsBtn.setText("reloading...");
// dbController.loadRomDirectory(getRomPath());
// Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again (preventing Bugs)
// System.exit(0); // finishes itself
}
@FXML

View File

@ -106,7 +106,7 @@ public class CloudController {
@Override
public void run() {
Platform.runLater(() -> {
mwc.getPlayBtn().setText("syncing...");
mwc.getPlayBtn().setText("syncing..."); // FIXME we get a NullPointerException here, because playBtn dosen't exist
});
LOGGER.info("starting synchronization in new thread ...");
@ -121,9 +121,9 @@ public class CloudController {
}
Platform.runLater(() -> {
mwc.getPlayBtn().setText("play");
mwc.getPlayBtn().setText("play"); // FIXME we get a NullPointerException here, because playBtn dosen't exist
mwc.saveSettings();
});
mwc.saveSettings();
LOGGER.info("synchronization successful!");
}
});