Browse Source

code cleanup

pull/18/head
Jannik 4 years ago
parent
commit
f9f63c0f3c
  1. 2
      src/main/java/com/cemu_UI/application/Main.java
  2. 25
      src/main/java/com/cemu_UI/application/MainWindowController.java
  3. 8
      src/main/java/com/cemu_UI/application/playGame.java

2
src/main/java/com/cemu_UI/application/Main.java

@ -176,7 +176,7 @@ public class Main extends Application {
// init here as it loads the games to the mwc and the gui, therefore the window must exist
mainWindowController.init();
mainWindowController.dbController.init();
mainWindowController.getDbController().init();
// if cloud sync is activated start sync
if(mainWindowController.isCloudSync()) {

25
src/main/java/com/cemu_UI/application/MainWindowController.java

@ -265,11 +265,15 @@ public class MainWindowController {
@FXML
private JFXTreeTableColumn<CourseTableDataType, Integer> timeColumn = new JFXTreeTableColumn<>("time");
private enum CloudService {
GoogleDrive, Dropbox
}
Main main;
DBController dbController;
SmmdbAPIController smmdbAPIController;
playGame playGame;
private Main main;
private DBController dbController;
private SmmdbAPIController smmdbAPIController;
private playGame playGame;
private static MainWindowController MWC;
private UpdateController updateController;
private boolean menuTrue = false;
@ -1050,6 +1054,7 @@ public class MainWindowController {
public void handle(ActionEvent event){
cloudSync = true;
//TODO rework for other cloud services
// CloudService service = CloudService.GoogleDrive;
cloudService = "GoogleDrive";
// start cloud sync in new thread
@ -1832,6 +1837,18 @@ public class MainWindowController {
return resizedImage;
}
public Main getMain() {
return main;
}
public DBController getDbController() {
return dbController;
}
public void setMainAnchorPane(AnchorPane mainAnchorPane) {
this.mainAnchorPane = mainAnchorPane;
}
public String getCemuPath() {
return cemuPath;
}

8
src/main/java/com/cemu_UI/application/playGame.java

@ -54,7 +54,7 @@ public class playGame extends Thread{
Process p;
Platform.runLater(() -> {
mainWindowController.main.getPrimaryStage().setIconified(true); // minimize cemu_UI
mainWindowController.getMain().getPrimaryStage().setIconified(true); // minimize cemu_UI
});
startTime = System.currentTimeMillis();
try {
@ -86,14 +86,14 @@ public class playGame extends Thread{
} else {
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID) + " min");
}
mainWindowController.main.getPrimaryStage().setIconified(false); // maximize cemu_UI
mainWindowController.getMain().getPrimaryStage().setIconified(false); // maximize cemu_UI
});
//sync savegame with cloud service
if (mainWindowController.isCloudSync()) {
mainWindowController.setLastLocalSync(Instant.now().getEpochSecond());
mainWindowController.main.getCloudController().sync(mainWindowController.getCloudService(),
mainWindowController.getCemuPath(), mainWindowController.main.getDirectory().getPath());
mainWindowController.getMain().getCloudController().sync(mainWindowController.getCloudService(),
mainWindowController.getCemuPath(), mainWindowController.getMain().getDirectory().getPath());
}
} catch (IOException | InterruptedException e) {

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close