diff --git a/.classpath b/.classpath
index d230797..9454e24 100644
--- a/.classpath
+++ b/.classpath
@@ -17,6 +17,7 @@
+
diff --git a/README.md b/README.md
index 11c5323..868853b 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ If you want to use the cloud sync function read the [wiki](https://github.com/Se
* launch Games
* Time played in total
* last time played
-* easyer way to add updates & DLCs (only adding not downloading!)
+* add updates and dlcs easier (only adding not downloading!)
* automatic rom detection (only .rpx files with a app.xml)
* customisable UI
* [sync savegames via google drive](https://github.com/Seil0/cemu_UI/wiki)
diff --git a/pom.xml b/pom.xml
index 3ea9e73..3a37a6d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
com.jfoenix
jfoenix
- 1.10.0
+ 1.11.1
@@ -40,7 +40,7 @@
org.xerial
sqlite-jdbc
- 3.21.0
+ 3.21.0.1
diff --git a/src/main/java/com/cemu_UI/application/Main.java b/src/main/java/com/cemu_UI/application/Main.java
index 9459df2..18778cd 100644
--- a/src/main/java/com/cemu_UI/application/Main.java
+++ b/src/main/java/com/cemu_UI/application/Main.java
@@ -56,9 +56,16 @@ public class Main extends Application {
CloudController cloudController;
AnchorPane pane;
Scene scene; // TODO make private
- private String dirWin = System.getProperty("user.home") + "/Documents/cemu_UI"; // Windows: C:/Users/"User"/Documents/cemu_UI
- private String dirLinux = System.getProperty("user.home") + "/cemu_UI"; // Linux: /home/"User"/cemu_UI
+ private static String userHome = System.getProperty("user.home");
+ private static String userName = System.getProperty("user.name");
+ private static String osName = System.getProperty("os.name");
+ private static String osArch = System.getProperty("os.arch");
+ private static String osVers = System.getProperty("os.version");
+ private static String javaVers = System.getProperty("java.version");
+ private static String javaVend= System.getProperty("java.vendor");
private String gamesDBdownloadURL = "https://github.com/Seil0/cemu_UI/raw/master/downloadContent/games.db";
+ public String dirWin = userHome + "/Documents/cemu_UI"; // Windows: C:/Users/"User"/Documents/cemu_UI
+ public String dirLinux = userHome + "/cemu_UI"; // Linux: /home/"User"/cemu_UI
private File directory;
private File configFile;
private File gamesDBFile;
@@ -70,8 +77,10 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
+ LOGGER.info("OS: " + osName + " " + osVers + " " + osArch);
+ LOGGER.info("Java: " + javaVend + " " + javaVers);
+ LOGGER.info("User: " + userName + " " + userHome);
this.primaryStage = primaryStage;
- cloudController = new CloudController(mainWindowController);
mainWindow();
initActions();
} catch (Exception e) {
@@ -85,15 +94,15 @@ public class Main extends Application {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(ClassLoader.getSystemResource("fxml/MainWindow.fxml"));
pane = (AnchorPane) loader.load();
-// primaryStage.setResizable(false);
primaryStage.setTitle("cemu_UI");
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/resources/Homeflix_Icon_64x64.png"))); //adds application icon
mainWindowController = loader.getController(); // Link of FXMLController and controller class
mainWindowController.setMain(this); // call setMain
+ cloudController = new CloudController(mainWindowController); // call cloudController constructor
// get OS and the specific paths
- if (System.getProperty("os.name").equals("Linux")) {
+ if (osName.equals("Linux")) {
directory = new File(dirLinux);
configFile = new File(dirLinux + "/config.xml");
gamesDBFile = new File(dirLinux + "/games.db");
@@ -119,8 +128,6 @@ public class Main extends Application {
alert.showAndWait();
}
- LOGGER.info("Directory: " + directory.exists());
- LOGGER.info("Configfile: " + configFile.exists());
if (!directory.exists()) {
LOGGER.info("creating cemu_UI directory");
directory.mkdir();
@@ -157,11 +164,9 @@ public class Main extends Application {
}
// loading settings and initialize UI, dbController.main() loads all databases
- mainWindowController.loadSettings();
- mainWindowController.checkAutoUpdate();
- mainWindowController.initActions();
- mainWindowController.initUI();
+ mainWindowController.init();
mainWindowController.dbController.main();
+ // if cloud sync is activated start sync
if(mainWindowController.isCloudSync()) {
cloudController.initializeConnection(mainWindowController.getCloudService(), mainWindowController.getCemuPath());
cloudController.stratupCheck(mainWindowController.getCloudService(), mainWindowController.getCemuPath());
@@ -286,13 +291,13 @@ public class Main extends Application {
public static void main(String[] args) {
// delete old log file and create new
- if(System.getProperty("os.name").equals("Linux")){
- System.setProperty("logFilename", System.getProperty("user.home") + "/cemu_UI/app.log");
- File logFile = new File(System.getProperty("user.home") + "/cemu_UI/app.log");
+ if(osName.equals("Linux")){
+ System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
+ File logFile = new File(userHome + "/cemu_UI/app.log");
logFile.delete();
}else{
- System.setProperty("logFilename", System.getProperty("user.home") + "/Documents/cemu_UI/app.log");
- File logFile = new File(System.getProperty("user.home") + "/Documents/cemu_UI/app.log");
+ System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
+ File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
logFile.delete();
}
LOGGER = LogManager.getLogger(Main.class.getName());
diff --git a/src/main/java/com/cemu_UI/application/MainWindowController.java b/src/main/java/com/cemu_UI/application/MainWindowController.java
index 2011820..14a7c71 100644
--- a/src/main/java/com/cemu_UI/application/MainWindowController.java
+++ b/src/main/java/com/cemu_UI/application/MainWindowController.java
@@ -24,11 +24,13 @@ package com.cemu_UI.application;
import java.awt.Desktop;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
+import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.OutputStream;
import java.math.BigInteger;
import java.net.HttpURLConnection;
@@ -59,18 +61,19 @@ import com.cemu_UI.datatypes.UIROMDataType;
import com.cemu_UI.uiElements.JFXEditGameDialog;
import com.cemu_UI.uiElements.JFXInfoDialog;
import com.cemu_UI.uiElements.JFXOkayCancelDialog;
+import com.cemu_UI.uiElements.JFXTextAreaInfoDialog;
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXColorPicker;
import com.jfoenix.controls.JFXHamburger;
+import com.jfoenix.controls.JFXSpinner;
import com.jfoenix.controls.JFXTextField;
import com.jfoenix.controls.JFXToggleButton;
import com.jfoenix.controls.JFXTreeTableColumn;
import com.jfoenix.controls.JFXTreeTableView;
import com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition;
-import javafx.animation.FadeTransition;
-import javafx.animation.ParallelTransition;
import javafx.animation.TranslateTransition;
+import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
@@ -149,6 +152,9 @@ public class MainWindowController {
@FXML
private JFXTextField romTextField;
+
+ @FXML
+ private JFXTextField courseSearchTextFiled;
@FXML
private TextFlow smmdbTextFlow;
@@ -188,6 +194,9 @@ public class MainWindowController {
@FXML
private ScrollPane smmdbScrollPane;
+
+ @FXML
+ private ScrollPane smmdbImageViewScrollPane;
@FXML
private VBox sideMenuVBox;
@@ -266,8 +275,8 @@ public class MainWindowController {
private String selectedGameTitleID;
private String selectedGameTitle;
private String id;
- private String version = "0.2.1";
- private String buildNumber = "057";
+ private String version = "0.2.2";
+ private String buildNumber = "061";
private String versionName = "Puzzle Plank Galaxy";
private int xPos = -200;
private int yPos = 17;
@@ -288,6 +297,7 @@ public class MainWindowController {
private ObservableList smmIDs = FXCollections.observableArrayList("fe31b7f2", "44fc5929"); // TODO add more IDs
private ObservableList games = FXCollections.observableArrayList();
ObservableList courses = FXCollections.observableArrayList();
+ ObservableList filteredCourses = FXCollections.observableArrayList();
ArrayList courseText = new ArrayList();
ArrayList nameText = new ArrayList();
Properties props = new Properties();
@@ -319,7 +329,21 @@ public class MainWindowController {
smmdbAPIController = new SmmdbAPIController();
}
- void initUI() {
+ /**
+ * initialize the MainWindowController
+ * loadSettings, checkAutoUpdate, initUI and initActions
+ */
+ void init() {
+ loadSettings();
+ checkAutoUpdate();
+ initUI();
+ initActions();
+ }
+
+ /**
+ * initialize all variable UI parameters and elements
+ */
+ private void initUI() {
LOGGER.info("initializing UI ...");
if (getWindowWidth() > 100 && getWindowHeight() > 100) {
@@ -344,9 +368,9 @@ public class MainWindowController {
applyColor();
// initialize courseTable
- titleColumn.setPrefWidth(160);
- timeColumn.setPrefWidth(127);
- starsColumn.setPrefWidth(100);
+ titleColumn.setPrefWidth(185);
+ timeColumn.setPrefWidth(112);
+ starsColumn.setPrefWidth(90);
courseTreeTable.setRoot(root);
courseTreeTable.setShowRoot(false);
@@ -369,7 +393,7 @@ public class MainWindowController {
/**
* initialize all actions not initialized by a own method
*/
- void initActions() {
+ private void initActions() {
LOGGER.info("initializing Actions ...");
MWC = this;
@@ -391,7 +415,6 @@ public class MainWindowController {
}
if (settingsTrue) {
settingsScrollPane.setVisible(false);
-// setPath(tfPath.getText());
saveSettings();
settingsTrue = false;
}
@@ -437,7 +460,7 @@ public class MainWindowController {
public void handle(ActionEvent event) {
try {
games.remove(selectedUIDataIndex); // remove game form games-list
- dbController.removeRom(selectedGameTitleID); // remove game from database
+ dbController.removeGame(selectedGameTitleID); // remove game from database
refreshUIData(); // refresh all games at gamesAnchorPane (UI)
} catch (Exception e) {
LOGGER.error("error while removing ROM from database!", e);
@@ -595,24 +618,57 @@ public class MainWindowController {
}
});
+ courseSearchTextFiled.textProperty().addListener(new ChangeListener() {
+ @Override
+ public void changed(ObservableValue extends String> observable, String oldValue, String newValue) {
+
+ filteredCourses.removeAll(filteredCourses);
+ root.getChildren().remove(0, root.getChildren().size());
+
+ for (int i = 0; i < courses.size(); i++) {
+ if (courses.get(i).getTitle().toLowerCase()
+ .contains(courseSearchTextFiled.getText().toLowerCase())) {
+
+ // add data from courses to filteredCourses where title contains search input
+ filteredCourses.add(courses.get(i));
+ }
+ }
+
+ for (int i = 0; i < filteredCourses.size(); i++) {
+ CourseTableDataType helpCourse = new CourseTableDataType(filteredCourses.get(i).getTitle(),
+ filteredCourses.get(i).getId(), filteredCourses.get(i).getTime(),
+ filteredCourses.get(i).getStars());
+
+ root.getChildren().add(new TreeItem(helpCourse)); // add data to root-node
+ }
+ }
+ });
+
// Change-listener for TreeTable
courseTreeTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener