diff --git a/bin/.gitignore b/bin/.gitignore index 925b114..18eab41 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,2 +1,3 @@ /application/ /resources/ +/cloudControllerInstances/ diff --git a/bin/application/MainWindowController$1.class b/bin/application/MainWindowController$1.class index b945f90..2b64862 100644 Binary files a/bin/application/MainWindowController$1.class and b/bin/application/MainWindowController$1.class differ diff --git a/bin/application/MainWindowController$10.class b/bin/application/MainWindowController$10.class index 7af7784..75d243b 100644 Binary files a/bin/application/MainWindowController$10.class and b/bin/application/MainWindowController$10.class differ diff --git a/bin/application/MainWindowController$11.class b/bin/application/MainWindowController$11.class index f83b0a5..f9edae0 100644 Binary files a/bin/application/MainWindowController$11.class and b/bin/application/MainWindowController$11.class differ diff --git a/bin/application/MainWindowController$12.class b/bin/application/MainWindowController$12.class index 6d345d8..4583258 100644 Binary files a/bin/application/MainWindowController$12.class and b/bin/application/MainWindowController$12.class differ diff --git a/bin/application/MainWindowController$2.class b/bin/application/MainWindowController$2.class index 2e2e389..8ad358a 100644 Binary files a/bin/application/MainWindowController$2.class and b/bin/application/MainWindowController$2.class differ diff --git a/bin/application/MainWindowController$3.class b/bin/application/MainWindowController$3.class index 368fbc1..69261b1 100644 Binary files a/bin/application/MainWindowController$3.class and b/bin/application/MainWindowController$3.class differ diff --git a/bin/application/MainWindowController$4.class b/bin/application/MainWindowController$4.class index 340ef4e..ccc034a 100644 Binary files a/bin/application/MainWindowController$4.class and b/bin/application/MainWindowController$4.class differ diff --git a/bin/application/MainWindowController$5.class b/bin/application/MainWindowController$5.class index d591a99..a4ee54d 100644 Binary files a/bin/application/MainWindowController$5.class and b/bin/application/MainWindowController$5.class differ diff --git a/bin/application/MainWindowController$6.class b/bin/application/MainWindowController$6.class index 2fb460e..f1b268b 100644 Binary files a/bin/application/MainWindowController$6.class and b/bin/application/MainWindowController$6.class differ diff --git a/bin/application/MainWindowController$7.class b/bin/application/MainWindowController$7.class index e66cce6..cd9ba87 100644 Binary files a/bin/application/MainWindowController$7.class and b/bin/application/MainWindowController$7.class differ diff --git a/bin/application/MainWindowController$8.class b/bin/application/MainWindowController$8.class index adc1094..5cbc121 100644 Binary files a/bin/application/MainWindowController$8.class and b/bin/application/MainWindowController$8.class differ diff --git a/bin/application/MainWindowController$9.class b/bin/application/MainWindowController$9.class index 4fc774c..808809e 100644 Binary files a/bin/application/MainWindowController$9.class and b/bin/application/MainWindowController$9.class differ diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class index 00cae42..48f09c4 100644 Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java index cfac03f..ceb16bc 100644 --- a/src/application/MainWindowController.java +++ b/src/application/MainWindowController.java @@ -286,6 +286,7 @@ public class MainWindowController { Properties props = new Properties(); Properties gameProps = new Properties(); private static final Logger LOGGER = LogManager.getLogger(MainWindowController.class.getName()); + private HamburgerBackArrowBasicTransition burgerTask; private MenuItem edit = new MenuItem("edit"); private MenuItem remove = new MenuItem("remove"); private MenuItem update = new MenuItem("update"); @@ -325,8 +326,8 @@ public class MainWindowController { fullscreenToggleBtn.setSelected(isFullscreen()); cloudSyncToggleBtn.setSelected(isCloudSync()); edit.setDisable(true); - updateBtn.setDisable(true); - autoUpdateToggleBtn.setDisable(true); + updateBtn.setDisable(true); // TODO + autoUpdateToggleBtn.setDisable(true); // TODO applyColor(); //initialize courseTable @@ -358,7 +359,7 @@ public class MainWindowController { void initActions() { LOGGER.info("initializing Actions ..."); - HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam); + burgerTask = new HamburgerBackArrowBasicTransition(menuHam); menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e)->{ if (playTrue) { playBtnSlideOut(); @@ -368,7 +369,7 @@ public class MainWindowController { burgerTask.setRate(-1.0); burgerTask.play(); menuTrue = false; - }else{ + } else { sideMenuSlideIn(); burgerTask.setRate(1.0); burgerTask.play(); @@ -856,7 +857,7 @@ public class MainWindowController { content.setBody(new Text("You just activate the cloud savegame sync function of cemu_UI, \nwhich is currently in beta. Are you sure you want to do this?")); StackPane stackPane = new StackPane(); stackPane.autosize(); - JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true); + JFXDialog betaDialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true); JFXButton okayBtn = new JFXButton("Okay"); okayBtn.setOnAction(new EventHandler(){ @Override @@ -869,11 +870,35 @@ public class MainWindowController { saveSettings(); } else { cloudSyncToggleBtn.setSelected(false); - // TODO show error message + + //cloud sync init error dialog + JFXDialogLayout content= new JFXDialogLayout(); + content.setHeading(new Text("Error while initializing cloud sync!")); + content.setBody(new Text("There was some truble initializing the cloud sync." + + "\nPlease upload the app.log (which can be found in the cemu_UI directory)" + + "\nto \"https://github.com/Seil0/cemu_UI/issues\" so we can fix this.")); + content.setPrefSize(450, 170); + StackPane stackPane = new StackPane(); + stackPane.autosize(); + JFXDialog dialog =new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true); + JFXButton button=new JFXButton("Okay"); + button.setOnAction(new EventHandler(){ + @Override + public void handle(ActionEvent event){ + dialog.close(); + } + }); + button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED); + button.setPrefHeight(32); + button.setStyle(dialogBtnStyle); + content.setActions(button); + main.pane.getChildren().add(stackPane); + AnchorPane.setTopAnchor(stackPane, (main.pane.getHeight()-content.getPrefHeight())/2); + AnchorPane.setLeftAnchor(stackPane, (main.pane.getWidth()-content.getPrefWidth())/2); + dialog.show(); } -// saveSettings(); - dialog.close(); + betaDialog.close(); } }); JFXButton cancelBtn = new JFXButton("Cancel"); @@ -881,7 +906,7 @@ public class MainWindowController { @Override public void handle(ActionEvent event){ cloudSyncToggleBtn.setSelected(false); - dialog.close(); + betaDialog.close(); } }); Label placeholder = new Label(); @@ -897,7 +922,7 @@ public class MainWindowController { main.pane.getChildren().add(stackPane); AnchorPane.setTopAnchor(stackPane, (main.pane.getHeight()-content.getPrefHeight())/2); AnchorPane.setLeftAnchor(stackPane, (main.pane.getWidth()-content.getPrefWidth())/2); - dialog.show(); + betaDialog.show(); } } @@ -916,14 +941,9 @@ public class MainWindowController { String titleID = null; File pictureCache; - //TESTING - Dialog dialog = new Dialog<>(); - dialog.setTitle("add Dialog"); - dialog.setHeaderText("Look, a Custom Login Dialog"); - - // Set the icon (must be included in the project). -// dialog.setGraphic(new ImageView(this.getClass().getResource("login.png").toString())); + dialog.setTitle("add a new game"); + dialog.setHeaderText("add a new game manually to cemu UI"); // Set the button types. ButtonType okayBtn = new ButtonType("Okay", ButtonData.OK_DONE); @@ -945,7 +965,7 @@ public class MainWindowController { gameCoverTF.setPromptText("cover path"); Button selectPathBtn = new Button("select .rpx file"); - Button selectCoverBtn = new Button("select .rpx file"); + Button selectCoverBtn = new Button("select cover file"); selectPathBtn.setOnAction(new EventHandler() { @Override @@ -990,72 +1010,7 @@ public class MainWindowController { System.out.println("ROM path: " + romPath); System.out.println("Game cover: " + coverPath); } - - - // END TESTING - -// TextInputDialog titleDialog = new TextInputDialog(); -// titleDialog.setTitle("cemu_UI"); -// titleDialog.setHeaderText("add new Game"); -// titleDialog.setContentText("Please enter the name of the game you want to add:"); -// titleDialog.initOwner(main.primaryStage); -// -// Optional titleResult = titleDialog.showAndWait(); -// if (titleResult.isPresent()){ -// title = titleResult.get(); -// }else{ -// exit = true; -// } -// -// if(exit == false){ -// TextInputDialog titleIDDialog = new TextInputDialog(); -// titleIDDialog.setTitle("cemu_UI"); -// titleIDDialog.setHeaderText("add new Game"); -// titleIDDialog.setContentText("Please enter the title-ID (12345678-12345678) \nof the game you want to add:"); -// titleIDDialog.initOwner(main.primaryStage); -// -// Optional titleIDResult = titleIDDialog.showAndWait(); -// if (titleIDResult.isPresent()){ -// titleID = titleIDResult.get(); -// }else{ -// exit = true; -// } -// } -// -// if(exit == false){ -// Alert romAlert = new Alert(AlertType.CONFIRMATION); //new alert with file-chooser -// romAlert.setTitle("cemu_UI"); -// romAlert.setHeaderText("add new Game"); -// romAlert.setContentText("Please select the .rpx file from the game you want to add."); -// romAlert.initOwner(main.primaryStage); -// -// Optional result = romAlert.showAndWait(); -// if (result.get() == ButtonType.OK){ -// FileChooser directoryChooser = new FileChooser(); -// File selectedDirectory = directoryChooser.showOpenDialog(main.primaryStage); -// romPath = selectedDirectory.getAbsolutePath(); -// } else { -// exit = true; -// } -// } -// -// if(exit == false){ -// Alert coverAlert = new Alert(AlertType.CONFIRMATION); //new alert with file-chooser -// coverAlert.setTitle("cemu_UI"); -// coverAlert.setHeaderText("add new Game"); -// coverAlert.setContentText("Please select the cover for the game you want to add."); -// coverAlert.initOwner(main.primaryStage); -// -// Optional coverResult = coverAlert.showAndWait(); -// if (coverResult.get() == ButtonType.OK){ -// FileChooser directoryChooser = new FileChooser(); -// File selectedDirectory = directoryChooser.showOpenDialog(main.primaryStage); -// coverPath = selectedDirectory.getAbsolutePath(); -// } else { -// exit = true; -// } -// } - + /** * FIXME if statement is useless at the moment * else convert the cover to .png add copy it into the picture cache @@ -1084,6 +1039,7 @@ public class MainWindowController { try { dbController.addRom(title, coverPath, romPath, titleID, "", "", "", "0"); dbController.loadSingleRom(titleID); + refreshUIData(); } catch (SQLException e) { LOGGER.error("Oops, something went wrong! Error while adding a game.", e); } @@ -1176,6 +1132,9 @@ public class MainWindowController { } if (menuTrue) { sideMenuSlideOut(); + burgerTask.setRate(-1.0); + burgerTask.play(); + menuTrue = false; } } @@ -1356,7 +1315,6 @@ public class MainWindowController { int xPosHelperMax; /**FIXME somehow the window width is set to 8, if we can find a way to get always the real window with - * PRIORITY_HIGH check if we can use main.pane.getWidth()!! *(at the beginning we have to use prefWidth after resizing Width) we can remove this */ if (mainAnchorPane.getWidth() < 10) {