commit
f1bb0607f7
|
@ -18,12 +18,12 @@
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" path="src/test/main"/>
|
<classpathentry kind="src" path="src/test/main"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-9">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
|
<classpathentry exported="true" kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=9
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
org.eclipse.jdt.core.compiler.compliance=9
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=9
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
language: java
|
language: java
|
||||||
|
jdk:
|
||||||
|
- oraclejdk9
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# cemu_UI
|
# cemu_UI
|
||||||
|
|
||||||
![Total Downloads](https://img.shields.io/github/downloads/Seil0/cemu_UI/total.svg?style=flat-square)
|
![Total Downloads](https://img.shields.io/github/downloads/Seil0/cemu_UI/total.svg?style=flat-square)
|
||||||
[![](https://img.shields.io/travis/Seil0/cemu_UI/master.svg?style=flat-square)](https://travis-ci.org/Seil0/cemu_UI)
|
[![Build](https://img.shields.io/travis/Seil0/cemu_UI/master.svg?style=flat-square)](https://travis-ci.org/Seil0/cemu_UI)
|
||||||
[![Latest](https://img.shields.io/github/release/Seil0/cemu_UI/all.svg?style=flat-square)](https://github.com/Seil0/cemu_UI/releases)
|
[![Latest](https://img.shields.io/github/release/Seil0/cemu_UI/all.svg?style=flat-square)](https://github.com/Seil0/cemu_UI/releases)
|
||||||
|
[![HitCount](http://hits.dwyl.io/Seil0/cemu_UI.svg)](http://hits.dwyl.io/Seil0/cemu_UI)
|
||||||
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0)
|
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0)
|
||||||
|
|
||||||
cemu_UI is a simple, material design graphical frontend for [cemu](http://cemu.info/), a Wii U emulator. Downloads can be found [here](https://github.com/Seil0/cemu_UI/releases).
|
cemu_UI is a simple, material design graphical frontend for [cemu](http://cemu.info/), a Wii U emulator. Downloads can be found [here](https://github.com/Seil0/cemu_UI/releases).
|
||||||
|
@ -28,7 +29,6 @@ If you want to use the cloud sync function read the [wiki](https://github.com/Se
|
||||||
## [planed Features](https://github.com/Seil0/cemu_UI/projects/1) (no ETA)
|
## [planed Features](https://github.com/Seil0/cemu_UI/projects/1) (no ETA)
|
||||||
|
|
||||||
* Controller support
|
* Controller support
|
||||||
* support more rom file formats in automatic detection
|
|
||||||
|
|
||||||
### If you have another idea, make a "new issue" with the ![#f03c15](https://placehold.it/15/fbca04/000000?text=+)`idea` lable
|
### If you have another idea, make a "new issue" with the ![#f03c15](https://placehold.it/15/fbca04/000000?text=+)`idea` lable
|
||||||
|
|
||||||
|
|
75
pom.xml
75
pom.xml
|
@ -4,16 +4,14 @@
|
||||||
|
|
||||||
<groupId>com</groupId>
|
<groupId>com</groupId>
|
||||||
<artifactId>cemu_UI</artifactId>
|
<artifactId>cemu_UI</artifactId>
|
||||||
<version>0.2.3-SNAPSHOT</version>
|
<version>0.3.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>cemu_UI</name>
|
<name>cemu_UI</name>
|
||||||
|
<description>cemu_UI is a simple, material design graphical frontend for cemu, a Wii U emulator</description>
|
||||||
<url>http://www.kellerkinder.xyz</url>
|
<url>http://www.kellerkinder.xyz</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -21,20 +19,20 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>4.11</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jfoenix</groupId>
|
<groupId>com.jfoenix</groupId>
|
||||||
<artifactId>jfoenix</artifactId>
|
<artifactId>jfoenix</artifactId>
|
||||||
<version>1.11.1</version>
|
<version>9.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.eclipsesource.minimal-json</groupId>
|
<groupId>com.eclipsesource.minimal-json</groupId>
|
||||||
<artifactId>minimal-json</artifactId>
|
<artifactId>minimal-json</artifactId>
|
||||||
<version>0.9.4</version>
|
<version>0.9.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -43,22 +41,22 @@
|
||||||
<version>3.21.0.1</version>
|
<version>3.21.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-api</artifactId>
|
<artifactId>log4j-api</artifactId>
|
||||||
<version>2.9.1</version>
|
<version>2.11.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-core</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
<version>2.9.1</version>
|
<version>2.11.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2 -->
|
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2 -->
|
||||||
|
@ -109,7 +107,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.apis</groupId>
|
<groupId>com.google.apis</groupId>
|
||||||
<artifactId>google-api-services-drive</artifactId>
|
<artifactId>google-api-services-drive</artifactId>
|
||||||
<version>v3-rev87-1.23.0</version>
|
<version>v3-rev99-1.23.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client -->
|
<!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client -->
|
||||||
|
@ -152,14 +150,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-core</artifactId>
|
<artifactId>jackson-core</artifactId>
|
||||||
<version>2.9.2</version>
|
<version>2.9.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
|
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<version>4.0.0-b01</version>
|
<version>4.0.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -180,13 +178,24 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.7.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>9</source>
|
||||||
|
<target>9</target>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<showDeprecation>true</showDeprecation>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
|
@ -194,18 +203,18 @@
|
||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<finalName>cemu_UI</finalName>
|
||||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||||
<transformers>
|
<transformers>
|
||||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
<mainClass>com.cemu_UI.application.Main</mainClass>
|
<mainClass>com.cemu_UI.application.Main</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
</transformers>
|
</transformers>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.application;
|
package com.cemu_UI.application;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -116,7 +115,7 @@ public class Main extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
// startup checks
|
// startup checks
|
||||||
// check if client_secret.jason is present
|
// check if client_secret.json is present
|
||||||
if (Main.class.getResourceAsStream("/client_secret.json") == null) {
|
if (Main.class.getResourceAsStream("/client_secret.json") == null) {
|
||||||
LOGGER.error("client_secret is missing!!!!!");
|
LOGGER.error("client_secret is missing!!!!!");
|
||||||
|
|
||||||
|
@ -142,11 +141,9 @@ public class Main extends Application {
|
||||||
mainWindowController.setLastLocalSync(0);
|
mainWindowController.setLastLocalSync(0);
|
||||||
mainWindowController.setxPosHelper(0);
|
mainWindowController.setxPosHelper(0);
|
||||||
mainWindowController.saveSettings();
|
mainWindowController.saveSettings();
|
||||||
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); //start again (preventing Bugs)
|
|
||||||
System.exit(0); //finishes itself
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pictureCache.exists() != true) {
|
if (!pictureCache.exists()) {
|
||||||
pictureCache.mkdir();
|
pictureCache.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,27 +165,30 @@ public class Main extends Application {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// loading settings and initialize UI, dbController.main() loads all databases
|
// generate window
|
||||||
|
scene = new Scene(pane); // create new scene, append pane to scene
|
||||||
|
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
|
||||||
|
primaryStage.setMinWidth(265.00);
|
||||||
|
primaryStage.setMinHeight(425.00);
|
||||||
|
primaryStage.setScene(scene); // append scene to stage
|
||||||
|
primaryStage.show(); // show stage
|
||||||
|
|
||||||
|
// init here as it loads the games to the mwc and the gui, therefore the window must exist
|
||||||
mainWindowController.init();
|
mainWindowController.init();
|
||||||
mainWindowController.dbController.init();
|
mainWindowController.getDbController().init();
|
||||||
|
|
||||||
// if cloud sync is activated start sync
|
// if cloud sync is activated start sync
|
||||||
if(mainWindowController.isCloudSync()) {
|
if(mainWindowController.isCloudSync()) {
|
||||||
cloudController.initializeConnection(mainWindowController.getCloudService(), mainWindowController.getCemuPath());
|
cloudController.initializeConnection(mainWindowController.getCloudService(), mainWindowController.getCemuPath());
|
||||||
cloudController.sync(mainWindowController.getCloudService(), mainWindowController.getCemuPath(), directory.getPath());
|
cloudController.sync(mainWindowController.getCloudService(), mainWindowController.getCemuPath(), directory.getPath());
|
||||||
}
|
}
|
||||||
mainWindowController.addUIData();
|
|
||||||
|
|
||||||
scene = new Scene(pane); // create new scene, append pane to scene
|
|
||||||
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
|
|
||||||
primaryStage.setScene(scene); // append scene to stage
|
|
||||||
primaryStage.show(); // show stage
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void firstStart(){
|
private void firstStart() {
|
||||||
Alert alert = new Alert(AlertType.CONFIRMATION); // new alert with file-chooser
|
Alert alert = new Alert(AlertType.CONFIRMATION); // new alert with file-chooser
|
||||||
alert.setTitle("cemu_UI");
|
alert.setTitle("cemu_UI");
|
||||||
alert.setHeaderText("cemu installation");
|
alert.setHeaderText("cemu installation");
|
||||||
|
@ -212,11 +212,10 @@ public class Main extends Application {
|
||||||
Optional<ButtonType> result2 = alert2.showAndWait();
|
Optional<ButtonType> result2 = alert2.showAndWait();
|
||||||
if (result2.get() == ButtonType.OK) {
|
if (result2.get() == ButtonType.OK) {
|
||||||
DirectoryChooser directoryChooser = new DirectoryChooser();
|
DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||||
File selectedDirectory = directoryChooser.showDialog(primaryStage);
|
File selectedDirectory = directoryChooser.showDialog(primaryStage);
|
||||||
mainWindowController.setRomPath(selectedDirectory.getAbsolutePath());
|
mainWindowController.setRomDirectoryPath(selectedDirectory.getAbsolutePath());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mainWindowController.setRomPath(null);
|
mainWindowController.setRomDirectoryPath(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +240,7 @@ public class Main extends Application {
|
||||||
|
|
||||||
saveTask = new TimerTask() {
|
saveTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mainWindowController.saveSettings();
|
mainWindowController.saveSettings();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -262,7 +261,7 @@ public class Main extends Application {
|
||||||
|
|
||||||
saveTask = new TimerTask() {
|
saveTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mainWindowController.saveSettings();
|
mainWindowController.saveSettings();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -295,11 +294,11 @@ public class Main extends Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// delete old log file and create new
|
// delete old log file and create new
|
||||||
if(osName.equals("Linux")){
|
if (osName.equals("Linux")) {
|
||||||
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
|
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
|
||||||
File logFile = new File(userHome + "/cemu_UI/app.log");
|
File logFile = new File(userHome + "/cemu_UI/app.log");
|
||||||
logFile.delete();
|
logFile.delete();
|
||||||
}else{
|
} else {
|
||||||
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
|
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
|
||||||
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
|
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
|
||||||
logFile.delete();
|
logFile.delete();
|
||||||
|
@ -341,7 +340,19 @@ public class Main extends Application {
|
||||||
return directory;
|
return directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDirectory(File directory) {
|
public File getConfigFile() {
|
||||||
this.directory = directory;
|
return configFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getGamesDBFile() {
|
||||||
|
return gamesDBFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getReference_gamesFile() {
|
||||||
|
return reference_gamesFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getPictureCache() {
|
||||||
|
return pictureCache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.application;
|
package com.cemu_UI.application;
|
||||||
|
|
||||||
import java.awt.Desktop;
|
import java.awt.Desktop;
|
||||||
|
@ -54,9 +53,9 @@ import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cemu_UI.controller.DBController;
|
||||||
import com.cemu_UI.controller.SmmdbAPIController;
|
import com.cemu_UI.controller.SmmdbAPIController;
|
||||||
import com.cemu_UI.controller.UpdateController;
|
import com.cemu_UI.controller.UpdateController;
|
||||||
import com.cemu_UI.controller.DBController;
|
|
||||||
import com.cemu_UI.datatypes.CourseTableDataType;
|
import com.cemu_UI.datatypes.CourseTableDataType;
|
||||||
import com.cemu_UI.datatypes.SmmdbApiDataType;
|
import com.cemu_UI.datatypes.SmmdbApiDataType;
|
||||||
import com.cemu_UI.datatypes.UIROMDataType;
|
import com.cemu_UI.datatypes.UIROMDataType;
|
||||||
|
@ -157,6 +156,9 @@ public class MainWindowController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private JFXTextField courseSearchTextFiled;
|
private JFXTextField courseSearchTextFiled;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private JFXTextField executeCommandTextFiled;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private TextFlow smmdbTextFlow;
|
private TextFlow smmdbTextFlow;
|
||||||
|
@ -262,11 +264,16 @@ public class MainWindowController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private JFXTreeTableColumn<CourseTableDataType, Integer> timeColumn = new JFXTreeTableColumn<>("time");
|
private JFXTreeTableColumn<CourseTableDataType, Integer> timeColumn = new JFXTreeTableColumn<>("time");
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private enum CloudService {
|
||||||
|
GoogleDrive, Dropbox
|
||||||
|
}
|
||||||
|
|
||||||
Main main;
|
private Main main;
|
||||||
DBController dbController;
|
private DBController dbController;
|
||||||
SmmdbAPIController smmdbAPIController;
|
private SmmdbAPIController smmdbAPIController;
|
||||||
playGame playGame;
|
private playGame playGame;
|
||||||
private static MainWindowController MWC;
|
private static MainWindowController MWC;
|
||||||
private UpdateController updateController;
|
private UpdateController updateController;
|
||||||
private boolean menuTrue = false;
|
private boolean menuTrue = false;
|
||||||
|
@ -279,16 +286,16 @@ public class MainWindowController {
|
||||||
private boolean cloudSync;
|
private boolean cloudSync;
|
||||||
private String cloudService = ""; // set cloud provider (at the moment only GoogleDrive, Dropbox is planed)
|
private String cloudService = ""; // set cloud provider (at the moment only GoogleDrive, Dropbox is planed)
|
||||||
private String cemuPath;
|
private String cemuPath;
|
||||||
private String romPath;
|
private String romDirectoryPath;
|
||||||
private String gameExecutePath;
|
private String gameExecutePath;
|
||||||
private String color;
|
private String color;
|
||||||
private String dialogBtnStyle;
|
private String dialogBtnStyle;
|
||||||
private String selectedGameTitleID;
|
private String selectedGameTitleID;
|
||||||
private String selectedGameTitle;
|
private String selectedGameTitle;
|
||||||
private String id;
|
private String id;
|
||||||
private String version = "0.2.3";
|
private String version = "0.3.0";
|
||||||
private String buildNumber = "071";
|
private String buildNumber = "077";
|
||||||
private String versionName = "Puzzle Plank Galaxy";
|
private String versionName = "Purple Comet";
|
||||||
private int xPos = -200;
|
private int xPos = -200;
|
||||||
private int yPos = 17;
|
private int yPos = 17;
|
||||||
private int xPosHelper;
|
private int xPosHelper;
|
||||||
|
@ -299,15 +306,9 @@ public class MainWindowController {
|
||||||
private double windowWidth;
|
private double windowWidth;
|
||||||
private double windowHeight;
|
private double windowHeight;
|
||||||
private DirectoryChooser directoryChooser = new DirectoryChooser();
|
private DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||||
private File dirWin = new File(System.getProperty("user.home") + "/Documents/cemu_UI");
|
|
||||||
private File dirLinux = new File(System.getProperty("user.home") + "/cemu_UI");
|
|
||||||
private File configFileWin = new File(dirWin + "/config.xml");
|
|
||||||
private File configFileLinux = new File(dirLinux + "/config.xml");
|
|
||||||
private File pictureCacheWin = new File(dirWin + "/picture_cache");
|
|
||||||
private File pictureCacheLinux = new File(dirLinux + "/picture_cache");
|
|
||||||
private ObservableList<String> branches = FXCollections.observableArrayList("stable", "beta");
|
private ObservableList<String> branches = FXCollections.observableArrayList("stable", "beta");
|
||||||
private ObservableList<String> languages = FXCollections.observableArrayList("English (en_US)", "Deutsch (de_DE)");
|
private ObservableList<String> languages = FXCollections.observableArrayList("English (en_US)", "Deutsch (de_DE)");
|
||||||
private ObservableList<String> smmIDs = FXCollections.observableArrayList("fe31b7f2", "44fc5929"); // TODO add more IDs
|
private ObservableList<String> smmIDs = FXCollections.observableArrayList("fe31b7f2", "44fc5929");
|
||||||
private ObservableList<UIROMDataType> games = FXCollections.observableArrayList();
|
private ObservableList<UIROMDataType> games = FXCollections.observableArrayList();
|
||||||
ObservableList<SmmdbApiDataType> courses = FXCollections.observableArrayList();
|
ObservableList<SmmdbApiDataType> courses = FXCollections.observableArrayList();
|
||||||
ObservableList<SmmdbApiDataType> filteredCourses = FXCollections.observableArrayList();
|
ObservableList<SmmdbApiDataType> filteredCourses = FXCollections.observableArrayList();
|
||||||
|
@ -373,7 +374,7 @@ public class MainWindowController {
|
||||||
|
|
||||||
public void setMain(Main m) {
|
public void setMain(Main m) {
|
||||||
this.main = m;
|
this.main = m;
|
||||||
dbController = new DBController(this);
|
dbController = new DBController(main, this);
|
||||||
smmdbAPIController = new SmmdbAPIController();
|
smmdbAPIController = new SmmdbAPIController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,7 +400,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
cemuTextField.setText(cemuPath);
|
cemuTextField.setText(cemuPath);
|
||||||
romTextField.setText(romPath);
|
romTextField.setText(romDirectoryPath);
|
||||||
colorPicker.setValue(Color.valueOf(getColor()));
|
colorPicker.setValue(Color.valueOf(getColor()));
|
||||||
fullscreenToggleBtn.setSelected(isFullscreen());
|
fullscreenToggleBtn.setSelected(isFullscreen());
|
||||||
cloudSyncToggleBtn.setSelected(isCloudSync());
|
cloudSyncToggleBtn.setSelected(isCloudSync());
|
||||||
|
@ -722,7 +723,7 @@ public class MainWindowController {
|
||||||
try {
|
try {
|
||||||
Desktop.getDesktop().browse(new URI("https://github.com/Seil0/cemu_UI/issues/3"));
|
Desktop.getDesktop().browse(new URI("https://github.com/Seil0/cemu_UI/issues/3"));
|
||||||
} catch (IOException | URISyntaxException e) {
|
} catch (IOException | URISyntaxException e) {
|
||||||
e.printStackTrace();
|
LOGGER.error("An error ocoured while trying to open a Website.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -800,12 +801,43 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cemuTextField.textProperty().addListener(new ChangeListener<String>() {
|
||||||
|
@Override
|
||||||
|
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
|
||||||
|
if (new File(newValue).exists()) {
|
||||||
|
setCemuPath(newValue);
|
||||||
|
saveSettings();
|
||||||
|
} else {
|
||||||
|
String bodyText = newValue + ": No such file or directory";
|
||||||
|
JFXInfoDialog fileErrorDialog = new JFXInfoDialog("Waring!", bodyText, dialogBtnStyle, 190, 150, main.getPane());
|
||||||
|
fileErrorDialog.show();
|
||||||
|
LOGGER.warn(newValue + ": No such file or directory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
romTextField.textProperty().addListener(new ChangeListener<String>() {
|
||||||
|
@Override
|
||||||
|
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
|
||||||
|
if (new File(newValue).exists()) {
|
||||||
|
setRomDirectoryPath(newValue);
|
||||||
|
saveSettings();
|
||||||
|
reloadRoms();
|
||||||
|
} else {
|
||||||
|
String bodyText = newValue + ": No such file or directory";
|
||||||
|
JFXInfoDialog fileErrorDialog = new JFXInfoDialog("Waring!", bodyText, dialogBtnStyle, 190, 150, main.getPane());
|
||||||
|
fileErrorDialog.show();
|
||||||
|
LOGGER.warn(newValue + ": No such file or directory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
LOGGER.info("initializing Actions done!");
|
LOGGER.info("initializing Actions done!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void detailsSlideoutBtnAction(ActionEvent event) {
|
void detailsSlideoutBtnAction() {
|
||||||
playBtnSlideOut();
|
playBtnSlideOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -818,7 +850,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void settingsBtnAction(ActionEvent event) {
|
void settingsBtnAction() {
|
||||||
if (smmdbTrue) {
|
if (smmdbTrue) {
|
||||||
smmdbAnchorPane.setVisible(false);
|
smmdbAnchorPane.setVisible(false);
|
||||||
smmdbTrue = false;
|
smmdbTrue = false;
|
||||||
|
@ -835,26 +867,7 @@ public class MainWindowController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void reloadRomsBtnAction() throws IOException {
|
void reloadRomsBtnAction() throws IOException {
|
||||||
|
reloadRoms();
|
||||||
JFXSpinner spinner = new JFXSpinner();
|
|
||||||
spinner.setPrefSize(30, 30);
|
|
||||||
spinner.setStyle(" -fx-background-color: #f4f4f4;");
|
|
||||||
main.getPane().getChildren().add(spinner);
|
|
||||||
AnchorPane.setTopAnchor(spinner, (main.getPane().getHeight()-spinner.getPrefHeight())/2);
|
|
||||||
AnchorPane.setLeftAnchor(spinner, (main.getPane().getWidth()-spinner.getPrefWidth())/2);
|
|
||||||
|
|
||||||
Thread thread = new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
dbController.loadRomDirectory(getRomPath()); // reload the rom directory
|
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
|
||||||
refreshUIData(); // refresh the list of games displayed on screen
|
|
||||||
main.getPane().getChildren().remove(spinner);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
thread.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -897,7 +910,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void playBtnAction(ActionEvent event) throws InterruptedException, IOException {
|
void playBtnAction() throws InterruptedException, IOException {
|
||||||
dbController.setLastPlayed(selectedGameTitleID);
|
dbController.setLastPlayed(selectedGameTitleID);
|
||||||
playGame = new playGame(this, dbController);
|
playGame = new playGame(this, dbController);
|
||||||
|
|
||||||
|
@ -905,53 +918,33 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void totalPlaytimeBtnAction(ActionEvent event) {
|
void totalPlaytimeBtnAction() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void lastTimePlayedBtnAction(ActionEvent event) {
|
void lastTimePlayedBtnAction() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void cemuTFBtnAction(ActionEvent event) {
|
void cemuTFBtnAction() {
|
||||||
File cemuDirectory = directoryChooser.showDialog(main.getPrimaryStage());
|
File cemuDirectory = directoryChooser.showDialog(main.getPrimaryStage());
|
||||||
if (cemuDirectory == null) {
|
if (cemuDirectory != null) {
|
||||||
LOGGER.info("No Directory selected");
|
cemuTextField.setText(cemuDirectory.getAbsolutePath());
|
||||||
} else {
|
|
||||||
setCemuPath(cemuDirectory.getAbsolutePath());
|
|
||||||
saveSettings();
|
|
||||||
cemuTextField.setText(getCemuPath());
|
|
||||||
try {
|
|
||||||
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again
|
|
||||||
System.exit(0); // finishes itself
|
|
||||||
} catch (IOException e) {
|
|
||||||
LOGGER.error("an error occurred", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void romTFBtnAction(ActionEvent event) {
|
void romTFBtnAction() {
|
||||||
File romDirectory = directoryChooser.showDialog(main.getPrimaryStage());
|
File romDirectory = directoryChooser.showDialog(main.getPrimaryStage());
|
||||||
if (romDirectory == null) {
|
if (romDirectory != null) {
|
||||||
LOGGER.info("No Directory selected");
|
romTextField.setText(romDirectory.getAbsolutePath());
|
||||||
} else {
|
|
||||||
setRomPath(romDirectory.getAbsolutePath());
|
|
||||||
saveSettings();
|
|
||||||
cemuTextField.setText(getCemuPath());
|
|
||||||
try {
|
|
||||||
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again
|
|
||||||
System.exit(0); // finishes itself
|
|
||||||
} catch (IOException e) {
|
|
||||||
LOGGER.error("an error occurred", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void updateBtnAction(ActionEvent event) {
|
void updateBtnAction() {
|
||||||
updateController = new UpdateController(this, buildNumber, useBeta);
|
updateController = new UpdateController(this, buildNumber, useBeta);
|
||||||
Thread updateThread = new Thread(updateController);
|
Thread updateThread = new Thread(updateController);
|
||||||
updateThread.setName("Updater");
|
updateThread.setName("Updater");
|
||||||
|
@ -959,7 +952,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void autoUpdateToggleBtnAction(ActionEvent event) {
|
void autoUpdateToggleBtnAction() {
|
||||||
if (isAutoUpdate()) {
|
if (isAutoUpdate()) {
|
||||||
setAutoUpdate(false);
|
setAutoUpdate(false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -969,12 +962,12 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void courseSearchTextFiledAction(ActionEvent event) {
|
void courseSearchTextFiledAction() {
|
||||||
// not in use
|
// not in use
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void smmdbDownloadBtnAction(ActionEvent event) {
|
void smmdbDownloadBtnAction() {
|
||||||
String downloadUrl = "http://smmdb.ddns.net/api/downloadcourse?id=" + id + "&type=zip";
|
String downloadUrl = "http://smmdb.ddns.net/api/downloadcourse?id=" + id + "&type=zip";
|
||||||
String downloadFileURL = getCemuPath() + "/" + id + ".zip"; // getCemuPath() + "/" + smmID + "/" + id + ".rar"
|
String downloadFileURL = getCemuPath() + "/" + id + ".zip"; // getCemuPath() + "/" + smmID + "/" + id + ".rar"
|
||||||
String outputFile = getCemuPath() + "/";
|
String outputFile = getCemuPath() + "/";
|
||||||
|
@ -1042,19 +1035,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void cemuTextFieldAction(ActionEvent event) {
|
void fullscreenToggleBtnAction() {
|
||||||
setCemuPath(cemuTextField.getText());
|
|
||||||
saveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
void romTextFieldAction(ActionEvent event) {
|
|
||||||
setRomPath(romTextField.getText());
|
|
||||||
saveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
void fullscreenToggleBtnAction(ActionEvent event) {
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
fullscreen = false;
|
fullscreen = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1064,7 +1045,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void cloudSyncToggleBtnAction(ActionEvent event) {
|
void cloudSyncToggleBtnAction() {
|
||||||
if(cloudSync) {
|
if(cloudSync) {
|
||||||
cloudSync = false;
|
cloudSync = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1073,27 +1054,28 @@ public class MainWindowController {
|
||||||
public void handle(ActionEvent event){
|
public void handle(ActionEvent event){
|
||||||
cloudSync = true;
|
cloudSync = true;
|
||||||
//TODO rework for other cloud services
|
//TODO rework for other cloud services
|
||||||
|
// CloudService service = CloudService.GoogleDrive;
|
||||||
cloudService = "GoogleDrive";
|
cloudService = "GoogleDrive";
|
||||||
|
|
||||||
// start cloud sync in new thread
|
// start cloud sync in new thread
|
||||||
Thread thread = new Thread(new Runnable() {
|
Thread thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
if (main.getCloudController().initializeConnection(getCloudService(), getCemuPath())) {
|
|
||||||
main.getCloudController().sync(getCloudService(), getCemuPath(), main.getDirectory().getPath());
|
|
||||||
saveSettings();
|
|
||||||
} else {
|
|
||||||
cloudSyncToggleBtn.setSelected(false);
|
|
||||||
|
|
||||||
//cloud sync init error dialog
|
if (main.getCloudController().initializeConnection(getCloudService(), getCemuPath())) {
|
||||||
|
main.getCloudController().sync(getCloudService(), getCemuPath(), main.getDirectory().getPath());
|
||||||
|
saveSettings();
|
||||||
|
} else {
|
||||||
|
cloudSyncToggleBtn.setSelected(false);
|
||||||
|
|
||||||
|
// cloud sync init error dialog
|
||||||
JFXInfoDialog cloudSyncErrorDialog = new JFXInfoDialog(cloudSyncErrorHeadingText,
|
JFXInfoDialog cloudSyncErrorDialog = new JFXInfoDialog(cloudSyncErrorHeadingText,
|
||||||
cloudSyncErrorBodyText, dialogBtnStyle, 450, 170, main.getPane());
|
cloudSyncErrorBodyText, dialogBtnStyle, 450, 170, main.getPane());
|
||||||
cloudSyncErrorDialog.show();
|
cloudSyncErrorDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1113,13 +1095,13 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void colorPickerAction(ActionEvent event) {
|
void colorPickerAction() {
|
||||||
editColor(colorPicker.getValue().toString());
|
editColor(colorPicker.getValue().toString());
|
||||||
applyColor();
|
applyColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
void addBtnAction(ActionEvent event) {
|
void addBtnAction() {
|
||||||
String headingText = addGameBtnHeadingText;
|
String headingText = addGameBtnHeadingText;
|
||||||
String bodyText = addGameBtnBodyText;
|
String bodyText = addGameBtnBodyText;
|
||||||
JFXEditGameDialog addGameDialog = new JFXEditGameDialog(headingText, bodyText, dialogBtnStyle, 450, 300, 0,
|
JFXEditGameDialog addGameDialog = new JFXEditGameDialog(headingText, bodyText, dialogBtnStyle, 450, 300, 0,
|
||||||
|
@ -1146,15 +1128,9 @@ public class MainWindowController {
|
||||||
errorDialog.show();
|
errorDialog.show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
File pictureCache;
|
File pictureCache = main.getPictureCache();
|
||||||
String coverName = new File(coverPath).getName();
|
String coverName = new File(coverPath).getName();
|
||||||
try {
|
try {
|
||||||
if (System.getProperty("os.name").equals("Linux")) {
|
|
||||||
pictureCache = getPictureCacheLinux();
|
|
||||||
} else {
|
|
||||||
pictureCache = getPictureCacheWin();
|
|
||||||
}
|
|
||||||
|
|
||||||
BufferedImage originalImage = ImageIO.read(new File(coverPath)); //load cover
|
BufferedImage originalImage = ImageIO.read(new File(coverPath)); //load cover
|
||||||
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
|
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
|
||||||
BufferedImage resizeImagePNG = resizeImage(originalImage, type, 400, 600);
|
BufferedImage resizeImagePNG = resizeImage(originalImage, type, 400, 600);
|
||||||
|
@ -1293,15 +1269,39 @@ public class MainWindowController {
|
||||||
games.add(uiROMElement);
|
games.add(uiROMElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add all games saved in games(ArrayList) to gamesAnchorPane
|
/**
|
||||||
void addUIData() {
|
* reload all ROMs from the ROM directory
|
||||||
for (int i = 0; i < games.size(); i++) {
|
*/
|
||||||
gamesAnchorPane.getChildren().add(games.get(i).getVBox());
|
public void reloadRoms() {
|
||||||
}
|
JFXSpinner spinner = new JFXSpinner();
|
||||||
}
|
spinner.setPrefSize(30, 30);
|
||||||
|
AnchorPane.setTopAnchor(spinner, (main.getPane().getPrefHeight()-spinner.getPrefHeight())/2);
|
||||||
|
AnchorPane.setLeftAnchor(spinner, (main.getPane().getPrefWidth()-spinner.getPrefWidth())/2);
|
||||||
|
|
||||||
|
Thread thread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
//remove all games form gamesAnchorPane
|
||||||
|
gamesAnchorPane.getChildren().removeAll(gamesAnchorPane.getChildren());
|
||||||
|
main.getPane().getChildren().add(spinner); // add spinner to pane
|
||||||
|
});
|
||||||
|
|
||||||
|
dbController.loadRomDirectory(getRomDirectoryPath()); // reload the ROM directory
|
||||||
|
games.removeAll(games); // remove all games from the mwc game list
|
||||||
|
dbController.loadAllGames(); // load all games from the database to the mwc
|
||||||
|
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
refreshUIData(); // refresh the list of games displayed on screen
|
||||||
|
main.getPane().getChildren().remove(spinner);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
|
||||||
//remove all games from gamesAnchorPane and add them afterwards
|
//remove all games from gamesAnchorPane and add them afterwards
|
||||||
void refreshUIData() {
|
public void refreshUIData() {
|
||||||
//remove all games form gamesAnchorPane
|
//remove all games form gamesAnchorPane
|
||||||
gamesAnchorPane.getChildren().removeAll(gamesAnchorPane.getChildren());
|
gamesAnchorPane.getChildren().removeAll(gamesAnchorPane.getChildren());
|
||||||
|
|
||||||
|
@ -1319,6 +1319,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the selected local strings to all needed elements
|
||||||
void setUILanguage(){
|
void setUILanguage(){
|
||||||
switch(getLanguage()){
|
switch(getLanguage()){
|
||||||
case "en_US":
|
case "en_US":
|
||||||
|
@ -1401,6 +1402,7 @@ public class MainWindowController {
|
||||||
smmdbDownloadBtnDownload = bundle.getString("smmdbDownloadBtnDownload");
|
smmdbDownloadBtnDownload = bundle.getString("smmdbDownloadBtnDownload");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if AutoUpdate, then check for updates
|
||||||
private void checkAutoUpdate() {
|
private void checkAutoUpdate() {
|
||||||
|
|
||||||
if (isAutoUpdate()) {
|
if (isAutoUpdate()) {
|
||||||
|
@ -1542,16 +1544,7 @@ public class MainWindowController {
|
||||||
* calculates how many games can be displayed in one row
|
* calculates how many games can be displayed in one row
|
||||||
*/
|
*/
|
||||||
private void generatePosition() {
|
private void generatePosition() {
|
||||||
int xPosHelperMax;
|
int xPosHelperMax = (int) Math.floor((mainAnchorPane.getWidth() - 36) / 217);
|
||||||
|
|
||||||
/**FIXME somehow the window width is set to 8, if we can find a way to get always the real window with
|
|
||||||
*(at the beginning we have to use prefWidth after resizing Width) we can remove this
|
|
||||||
*/
|
|
||||||
if (mainAnchorPane.getWidth() < 10) {
|
|
||||||
xPosHelperMax = (int) Math.floor((mainAnchorPane.getPrefWidth() - 36) / 217);
|
|
||||||
} else {
|
|
||||||
xPosHelperMax = (int) Math.floor((mainAnchorPane.getWidth() - 36) / 217);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(xPosHelper == xPosHelperMax){
|
if(xPosHelper == xPosHelperMax){
|
||||||
oldXPosHelper = xPosHelper;
|
oldXPosHelper = xPosHelper;
|
||||||
|
@ -1562,14 +1555,9 @@ public class MainWindowController {
|
||||||
xPos = xPos + 217;
|
xPos = xPos + 217;
|
||||||
xPosHelper++;
|
xPosHelper++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// System.out.println("Breit: " + main.pane.getWidth());
|
|
||||||
// System.out.println("Breit2: " + mainAnchorPane.getWidth());
|
|
||||||
// System.out.println("xPosHelper: " + xPosHelper);
|
|
||||||
// System.out.println("yPos: " + yPos);
|
|
||||||
// System.out.println("xPos: " + xPos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// change the color of all needed GUI elements
|
||||||
private void applyColor() {
|
private void applyColor() {
|
||||||
String boxStyle = "-fx-background-color: #"+getColor()+";";
|
String boxStyle = "-fx-background-color: #"+getColor()+";";
|
||||||
String btnStyleBlack = "-fx-button-type: RAISED; -fx-background-color: #"+getColor()+"; -fx-text-fill: BLACK;";
|
String btnStyleBlack = "-fx-button-type: RAISED; -fx-background-color: #"+getColor()+"; -fx-text-fill: BLACK;";
|
||||||
|
@ -1632,13 +1620,16 @@ public class MainWindowController {
|
||||||
games.get(i).getButton().setRipplerFill(Paint.valueOf(getColor()));
|
games.get(i).getButton().setRipplerFill(Paint.valueOf(getColor()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveSettings(){
|
/**
|
||||||
LOGGER.info("saving Settings ...");
|
* save settings to the config.xml file
|
||||||
OutputStream outputStream; //new output-stream
|
*/
|
||||||
try {
|
public void saveSettings() {
|
||||||
props.setProperty("cemuPath", getCemuPath());
|
LOGGER.info("saving Settings ...");
|
||||||
props.setProperty("romPath", getRomPath());
|
|
||||||
|
try {
|
||||||
|
props.setProperty("cemuPath", getCemuPath());
|
||||||
|
props.setProperty("romPath", getRomDirectoryPath());
|
||||||
props.setProperty("color", getColor());
|
props.setProperty("color", getColor());
|
||||||
props.setProperty("language", getLanguage());
|
props.setProperty("language", getLanguage());
|
||||||
props.setProperty("fullscreen", String.valueOf(isFullscreen()));
|
props.setProperty("fullscreen", String.valueOf(isFullscreen()));
|
||||||
|
@ -1654,97 +1645,89 @@ public class MainWindowController {
|
||||||
props.setProperty("lastLocalSync", String.valueOf(getLastLocalSync()));
|
props.setProperty("lastLocalSync", String.valueOf(getLastLocalSync()));
|
||||||
props.setProperty("windowWidth", String.valueOf(mainAnchorPane.getWidth()));
|
props.setProperty("windowWidth", String.valueOf(mainAnchorPane.getWidth()));
|
||||||
props.setProperty("windowHeight", String.valueOf(mainAnchorPane.getHeight()));
|
props.setProperty("windowHeight", String.valueOf(mainAnchorPane.getHeight()));
|
||||||
if(System.getProperty("os.name").equals("Linux")){
|
|
||||||
outputStream = new FileOutputStream(configFileLinux);
|
OutputStream outputStream = new FileOutputStream(main.getConfigFile()); // new output-stream
|
||||||
}else{
|
props.storeToXML(outputStream, "cemu_UI settings"); // write new .xml
|
||||||
outputStream = new FileOutputStream(configFileWin);
|
outputStream.close();
|
||||||
}
|
LOGGER.info("saving Settings done!");
|
||||||
props.storeToXML(outputStream, "cemu_UI settings"); //write new .xml
|
} catch (IOException e) {
|
||||||
outputStream.close();
|
LOGGER.error("an error occured", e);
|
||||||
LOGGER.info("saving Settings done!");
|
}
|
||||||
} catch (IOException e) {
|
}
|
||||||
LOGGER.error("an error occured", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loading saved settings from the config.xml file
|
* loading saved settings from the config.xml file
|
||||||
* if a value is not present, default is used instead
|
* if a value is not present, default is used instead
|
||||||
*/
|
*/
|
||||||
private void loadSettings(){
|
private void loadSettings() {
|
||||||
LOGGER.info("loading settings ...");
|
LOGGER.info("loading settings ...");
|
||||||
InputStream inputStream;
|
|
||||||
try {
|
try {
|
||||||
if(System.getProperty("os.name").equals("Linux")){
|
InputStream inputStream = new FileInputStream(main.getConfigFile());
|
||||||
inputStream = new FileInputStream(configFileLinux);
|
props.loadFromXML(inputStream); // new input-stream from .xml
|
||||||
}else{
|
|
||||||
inputStream = new FileInputStream(configFileWin);
|
|
||||||
}
|
|
||||||
props.loadFromXML(inputStream); //new input-stream from .xml
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setCemuPath(props.getProperty("cemuPath"));
|
setCemuPath(props.getProperty("cemuPath"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("cloud not load cemuPath", e);
|
LOGGER.error("cloud not load cemuPath", e);
|
||||||
setCemuPath("");
|
setCemuPath("");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setRomPath(props.getProperty("romPath"));
|
setRomDirectoryPath(props.getProperty("romPath"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load romPath", e);
|
LOGGER.error("could not load romPath", e);
|
||||||
setRomPath("");
|
setRomDirectoryPath("");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setColor(props.getProperty("color"));
|
setColor(props.getProperty("color"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load color value, setting default instead", e);
|
LOGGER.error("could not load color value, setting default instead", e);
|
||||||
setColor("00a8cc");
|
setColor("00a8cc");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.getProperty("language") == null) {
|
if (props.getProperty("language") == null) {
|
||||||
LOGGER.error("cloud not load language, setting default instead");
|
LOGGER.error("cloud not load language, setting default instead");
|
||||||
setLanguage("en_US");
|
setLanguage("en_US");
|
||||||
} else {
|
} else {
|
||||||
setLanguage(props.getProperty("language"));
|
setLanguage(props.getProperty("language"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setFullscreen(Boolean.parseBoolean(props.getProperty("fullscreen")));
|
setFullscreen(Boolean.parseBoolean(props.getProperty("fullscreen")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load fullscreen, setting default instead", e);
|
LOGGER.error("could not load fullscreen, setting default instead", e);
|
||||||
setFullscreen(false);
|
setFullscreen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setCloudSync(Boolean.parseBoolean(props.getProperty("cloudSync")));
|
setCloudSync(Boolean.parseBoolean(props.getProperty("cloudSync")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load cloudSync, setting default instead", e);
|
LOGGER.error("could not load cloudSync, setting default instead", e);
|
||||||
setCloudSync(false);
|
setCloudSync(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setAutoUpdate(Boolean.parseBoolean(props.getProperty("autoUpdate")));
|
setAutoUpdate(Boolean.parseBoolean(props.getProperty("autoUpdate")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("cloud not load autoUpdate", e);
|
LOGGER.error("cloud not load autoUpdate", e);
|
||||||
setAutoUpdate(false);
|
setAutoUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setUseBeta(Boolean.parseBoolean(props.getProperty("useBeta")));
|
setUseBeta(Boolean.parseBoolean(props.getProperty("useBeta")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("cloud not load autoUpdate", e);
|
LOGGER.error("cloud not load autoUpdate", e);
|
||||||
setUseBeta(false);
|
setUseBeta(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setCloudService(props.getProperty("cloudService"));
|
setCloudService(props.getProperty("cloudService"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load cloudSync", e);
|
LOGGER.error("could not load cloudSync", e);
|
||||||
setCloudService("");
|
setCloudService("");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
main.getCloudController().setFolderID(props.getProperty("folderID"), getCloudService());
|
main.getCloudController().setFolderID(props.getProperty("folderID"), getCloudService());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -1758,27 +1741,27 @@ public class MainWindowController {
|
||||||
LOGGER.error("could not load lastSuccessSync, setting default instead", e);
|
LOGGER.error("could not load lastSuccessSync, setting default instead", e);
|
||||||
setLastLocalSync(0);
|
setLastLocalSync(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setWindowWidth(Double.parseDouble(props.getProperty("windowWidth")));
|
setWindowWidth(Double.parseDouble(props.getProperty("windowWidth")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load windowWidth, setting default instead", e);
|
LOGGER.error("could not load windowWidth, setting default instead", e);
|
||||||
setWindowWidth(904);
|
setWindowWidth(904);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setWindowHeight(Double.parseDouble(props.getProperty("windowHeight")));
|
setWindowHeight(Double.parseDouble(props.getProperty("windowHeight")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("could not load windowHeight, setting default instead", e);
|
LOGGER.error("could not load windowHeight, setting default instead", e);
|
||||||
setWindowHeight(600);
|
setWindowHeight(600);
|
||||||
}
|
}
|
||||||
|
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
LOGGER.info("loading settings done!");
|
LOGGER.info("loading settings done!");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("an error occured", e);
|
LOGGER.error("an error occured", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sideMenuSlideIn(){
|
private void sideMenuSlideIn(){
|
||||||
sideMenuVBox.setVisible(true);
|
sideMenuVBox.setVisible(true);
|
||||||
|
@ -1854,6 +1837,18 @@ public class MainWindowController {
|
||||||
return resizedImage;
|
return resizedImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Main getMain() {
|
||||||
|
return main;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBController getDbController() {
|
||||||
|
return dbController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainAnchorPane(AnchorPane mainAnchorPane) {
|
||||||
|
this.mainAnchorPane = mainAnchorPane;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCemuPath() {
|
public String getCemuPath() {
|
||||||
return cemuPath;
|
return cemuPath;
|
||||||
}
|
}
|
||||||
|
@ -1862,14 +1857,14 @@ public class MainWindowController {
|
||||||
this.cemuPath = cemuPath;
|
this.cemuPath = cemuPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRomPath() {
|
public String getRomDirectoryPath() {
|
||||||
return romPath;
|
return romDirectoryPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRomPath(String romPath) {
|
public void setRomDirectoryPath(String romDirectoryPath) {
|
||||||
this.romPath = romPath;
|
this.romDirectoryPath = romDirectoryPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getColor() {
|
public String getColor() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -1878,22 +1873,6 @@ public class MainWindowController {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getPictureCacheLinux() {
|
|
||||||
return pictureCacheLinux;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPictureCacheLinux(File pictureCacheLinux) {
|
|
||||||
this.pictureCacheLinux = pictureCacheLinux;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getPictureCacheWin() {
|
|
||||||
return pictureCacheWin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPictureCacheWin(File pictureCacheWin) {
|
|
||||||
this.pictureCacheWin = pictureCacheWin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getxPos() {
|
public int getxPos() {
|
||||||
return xPos;
|
return xPos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.application;
|
package com.cemu_UI.application;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -33,19 +32,20 @@ import javafx.application.Platform;
|
||||||
|
|
||||||
public class playGame extends Thread{
|
public class playGame extends Thread{
|
||||||
|
|
||||||
MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
DBController dbController;
|
private DBController dbController;
|
||||||
private static final Logger LOGGER = LogManager.getLogger(playGame.class.getName());
|
private static final Logger LOGGER = LogManager.getLogger(playGame.class.getName());
|
||||||
|
|
||||||
public playGame(MainWindowController m, com.cemu_UI.controller.DBController db){
|
public playGame(MainWindowController m, com.cemu_UI.controller.DBController db) {
|
||||||
mainWindowController = m;
|
mainWindowController = m;
|
||||||
dbController = db;
|
dbController = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(){
|
public void run() {
|
||||||
String selectedGameTitleID = mainWindowController.getSelectedGameTitleID();
|
String selectedGameTitleID = mainWindowController.getSelectedGameTitleID();
|
||||||
String executeComand;
|
String cemuBin = mainWindowController.getCemuPath() + "/Cemu.exe";
|
||||||
|
String gameExec = "\"" + mainWindowController.getGameExecutePath() + "\"";
|
||||||
long startTime;
|
long startTime;
|
||||||
long endTime;
|
long endTime;
|
||||||
int timePlayedNow;
|
int timePlayedNow;
|
||||||
|
@ -53,52 +53,50 @@ public class playGame extends Thread{
|
||||||
Process p;
|
Process p;
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
mainWindowController.main.getPrimaryStage().setIconified(true); // minimize cemu_UI
|
mainWindowController.getMain().getPrimaryStage().setIconified(true); // minimize cemu_UI
|
||||||
});
|
});
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
try{
|
try {
|
||||||
if(mainWindowController.isFullscreen()){
|
if (System.getProperty("os.name").equals("Linux")) {
|
||||||
if(System.getProperty("os.name").equals("Linux")){
|
if(mainWindowController.isFullscreen()){
|
||||||
executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\"";
|
p = new ProcessBuilder("wine", cemuBin, "-f", "-g", gameExec).start();
|
||||||
} else {
|
} else {
|
||||||
executeComand = mainWindowController.getCemuPath()+"\\Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\"";
|
p = new ProcessBuilder("wine", cemuBin, "-g", gameExec).start();
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if(System.getProperty("os.name").equals("Linux")){
|
if(mainWindowController.isFullscreen()){
|
||||||
executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -g \""+mainWindowController.getGameExecutePath()+"\"";
|
p = new ProcessBuilder(cemuBin, "-f", "-g", gameExec).start();
|
||||||
} else {
|
} else {
|
||||||
executeComand = mainWindowController.getCemuPath()+"\\Cemu.exe -g \""+mainWindowController.getGameExecutePath()+"\"";
|
p = new ProcessBuilder(cemuBin, "-g", gameExec).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.info(executeComand);
|
|
||||||
|
|
||||||
p = Runtime.getRuntime().exec(executeComand);
|
p.waitFor(); // wait until cemu is closed so we can calculate the played time
|
||||||
p.waitFor();
|
|
||||||
endTime = System.currentTimeMillis();
|
endTime = System.currentTimeMillis();
|
||||||
timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60));
|
timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60));
|
||||||
timePlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))+timePlayedNow;
|
timePlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))+timePlayedNow;
|
||||||
|
|
||||||
dbController.setTotalPlaytime(Integer.toString(timePlayed), selectedGameTitleID);
|
dbController.setTotalPlaytime(Integer.toString(timePlayed), selectedGameTitleID);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
if(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) > 60){
|
if (Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) > 60) {
|
||||||
int hoursPlayed = (int) Math.floor(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))/60);
|
int hoursPlayed = (int) Math.floor(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) / 60);
|
||||||
int minutesPlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))-60*hoursPlayed;
|
int minutesPlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) - 60 * hoursPlayed;
|
||||||
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed+"h "+minutesPlayed+"min");
|
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed + "h " + minutesPlayed + "min");
|
||||||
}else{
|
} else {
|
||||||
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID)+ " min");
|
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
|
//sync savegame with cloud service
|
||||||
if (mainWindowController.isCloudSync()) {
|
if (mainWindowController.isCloudSync()) {
|
||||||
mainWindowController.setLastLocalSync(Instant.now().getEpochSecond());
|
mainWindowController.setLastLocalSync(Instant.now().getEpochSecond());
|
||||||
mainWindowController.main.getCloudController().sync(mainWindowController.getCloudService(),
|
mainWindowController.getMain().getCloudController().sync(mainWindowController.getCloudService(),
|
||||||
mainWindowController.getCemuPath(), mainWindowController.main.getDirectory().getPath());
|
mainWindowController.getCemuPath(), mainWindowController.getMain().getDirectory().getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch (IOException | InterruptedException e){
|
} catch (IOException | InterruptedException e) {
|
||||||
e.printStackTrace();
|
LOGGER.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.controller;
|
package com.cemu_UI.controller;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.controller;
|
package com.cemu_UI.controller;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
@ -45,14 +44,17 @@ import org.apache.logging.log4j.Logger;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
import com.cemu_UI.application.Main;
|
||||||
import com.cemu_UI.application.MainWindowController;
|
import com.cemu_UI.application.MainWindowController;
|
||||||
|
|
||||||
public class DBController {
|
public class DBController {
|
||||||
|
|
||||||
public DBController(MainWindowController mwc) {
|
public DBController(Main main, MainWindowController mainWindowController) {
|
||||||
mainWindowController = mwc;
|
this.main = main;
|
||||||
|
this.mainWindowController = mainWindowController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Main main;
|
||||||
private MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
private ArrayList<String> entries = new ArrayList<>();
|
private ArrayList<String> entries = new ArrayList<>();
|
||||||
private String DB_PATH_localRoms;
|
private String DB_PATH_localRoms;
|
||||||
|
@ -66,14 +68,12 @@ public class DBController {
|
||||||
* load ROM and games database
|
* load ROM and games database
|
||||||
* load all games
|
* load all games
|
||||||
*/
|
*/
|
||||||
public void init(){
|
public void init() {
|
||||||
LOGGER.info("<==========starting loading sql==========>");
|
LOGGER.info("<========== starting loading sql ==========>");
|
||||||
loadRomDatabase();
|
loadRomDatabase();
|
||||||
loadGamesDatabase();
|
loadGamesDatabase();
|
||||||
createRomDatabase();
|
createRomDatabase();
|
||||||
loadAllGames();
|
LOGGER.info("<========== finished loading sql ==========>");
|
||||||
checkRemoveEntry();
|
|
||||||
LOGGER.info("<==========finished loading sql==========>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,18 +81,18 @@ public class DBController {
|
||||||
*
|
*
|
||||||
* TODO this should be called LocalGames
|
* TODO this should be called LocalGames
|
||||||
*/
|
*/
|
||||||
private void loadRomDatabase(){
|
private void loadRomDatabase() {
|
||||||
if (System.getProperty("os.name").equals("Linux")) {
|
if (System.getProperty("os.name").equals("Linux")) {
|
||||||
DB_PATH_localRoms = System.getProperty("user.home") + "/cemu_UI/localRoms.db";
|
DB_PATH_localRoms = System.getProperty("user.home") + "/cemu_UI/localRoms.db";
|
||||||
}else{
|
} else {
|
||||||
DB_PATH_localRoms = System.getProperty("user.home") + "\\Documents\\cemu_UI" + "\\" + "localRoms.db";
|
DB_PATH_localRoms = System.getProperty("user.home") + "\\Documents\\cemu_UI" + "\\" + "localRoms.db";
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// create a database connection
|
// create a database connection
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_localRoms);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_localRoms);
|
||||||
connection.setAutoCommit(false); //AutoCommit to false -> manual commit is active
|
connection.setAutoCommit(false); // AutoCommit to false -> manual commit is active
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
// if the error message is "out of memory", it probably means no database file is found
|
// if the error message is "out of memory", probably no database file is found
|
||||||
LOGGER.error("error while loading the ROM database", e);
|
LOGGER.error("error while loading the ROM database", e);
|
||||||
}
|
}
|
||||||
LOGGER.info("ROM database loaded successfull");
|
LOGGER.info("ROM database loaded successfull");
|
||||||
|
@ -100,16 +100,10 @@ public class DBController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the path to the localRoms.db file and initialize the connection
|
* set the path to the localRoms.db file and initialize the connection
|
||||||
*
|
* games.db contains a reverence list to for the automatic detection mode
|
||||||
* games.dbcontains a reverence list to for the automatic detection mode
|
|
||||||
* TODO rework paths
|
|
||||||
*/
|
*/
|
||||||
private void loadGamesDatabase() {
|
private void loadGamesDatabase() {
|
||||||
if (System.getProperty("os.name").equals("Linux")) {
|
DB_PATH_games = main.getReference_gamesFile().getAbsolutePath();
|
||||||
DB_PATH_games = System.getProperty("user.home") + "/cemu_UI/reference_games.db";
|
|
||||||
} else {
|
|
||||||
DB_PATH_games = System.getProperty("user.home") + "\\Documents\\cemu_UI" + "\\" + "reference_games.db";
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// create a database connection
|
// create a database connection
|
||||||
connectionGames = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_games);
|
connectionGames = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_games);
|
||||||
|
@ -149,11 +143,14 @@ public class DBController {
|
||||||
LOGGER.error("error while loading ROMs from ROM database, local_roms table", e);
|
LOGGER.error("error while loading ROMs from ROM database, local_roms table", e);
|
||||||
}
|
}
|
||||||
if (entries.size() == 0) {
|
if (entries.size() == 0) {
|
||||||
loadRomDirectory(mainWindowController.getRomPath());
|
mainWindowController.reloadRoms();
|
||||||
|
} else {
|
||||||
|
loadAllGames();
|
||||||
|
mainWindowController.refreshUIData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a Ggame to the database
|
// add a game to the database
|
||||||
public void addGame(String title, String coverPath, String romPath, String titleID, String productCode, String region, String lastPlayed, String timePlayed) throws SQLException{
|
public void addGame(String title, String coverPath, String romPath, String titleID, String productCode, String region, String lastPlayed, String timePlayed) throws SQLException{
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
stmt.executeUpdate("insert into local_roms values ('"+title+"','"+coverPath+"','"+romPath+"','"+titleID+"',"
|
stmt.executeUpdate("insert into local_roms values ('"+title+"','"+coverPath+"','"+romPath+"','"+titleID+"',"
|
||||||
|
@ -163,6 +160,7 @@ public class DBController {
|
||||||
LOGGER.info("added \""+title+"\" to ROM database");
|
LOGGER.info("added \""+title+"\" to ROM database");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove a game from the database
|
||||||
public void removeGame(String titleID) throws SQLException{
|
public void removeGame(String titleID) throws SQLException{
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
stmt.executeUpdate("delete from local_roms where titleID = '"+titleID+"'");
|
stmt.executeUpdate("delete from local_roms where titleID = '"+titleID+"'");
|
||||||
|
@ -171,8 +169,8 @@ public class DBController {
|
||||||
LOGGER.info("removed \""+titleID+"\" from ROM database");
|
LOGGER.info("removed \""+titleID+"\" from ROM database");
|
||||||
}
|
}
|
||||||
|
|
||||||
//load all ROMs on startup to the mainWindowController
|
//load all ROMs to the mainWindowController
|
||||||
void loadAllGames(){
|
public void loadAllGames(){
|
||||||
LOGGER.info("loading all games on startup into the mainWindowController ...");
|
LOGGER.info("loading all games on startup into the mainWindowController ...");
|
||||||
try {
|
try {
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
|
@ -187,7 +185,7 @@ public class DBController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//load one single ROM after manual adding into the mainWindowController
|
//load a single ROM to the mainWindowController
|
||||||
public void loadSingleGame(String titleID){
|
public void loadSingleGame(String titleID){
|
||||||
LOGGER.info("loading a single game (ID: "+titleID+") into the mainWindowController ...");
|
LOGGER.info("loading a single game (ID: "+titleID+") into the mainWindowController ...");
|
||||||
try {
|
try {
|
||||||
|
@ -211,18 +209,12 @@ public class DBController {
|
||||||
File dir = new File(directory);
|
File dir = new File(directory);
|
||||||
File appFile;
|
File appFile;
|
||||||
String[] extensions = new String[] { "rpx", "jsp" };
|
String[] extensions = new String[] { "rpx", "jsp" };
|
||||||
File pictureCache;
|
File pictureCache = main.getPictureCache();
|
||||||
String coverPath;
|
String coverPath;
|
||||||
|
|
||||||
if(System.getProperty("os.name").equals("Linux")){
|
|
||||||
pictureCache = mainWindowController.getPictureCacheLinux();
|
|
||||||
}else{
|
|
||||||
pictureCache = mainWindowController.getPictureCacheWin();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Statement stmt = connectionGames.createStatement();
|
Statement stmt = connectionGames.createStatement();
|
||||||
List<File> files = (List<File>) FileUtils.listFiles(dir, extensions, true);
|
List<File> files = (List<File>) FileUtils.listFiles(dir, extensions, true);
|
||||||
|
LOGGER.info("<============================== start loading ROM Directory ==============================>");
|
||||||
LOGGER.info("Getting all .rpx files in " + dir.getCanonicalPath()+" including those in subdirectories");
|
LOGGER.info("Getting all .rpx files in " + dir.getCanonicalPath()+" including those in subdirectories");
|
||||||
// for all files in dir get the app.xml
|
// for all files in dir get the app.xml
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
|
@ -237,7 +229,7 @@ public class DBController {
|
||||||
|
|
||||||
// for all elements in the games table check if it's already present, else add it
|
// for all elements in the games table check if it's already present, else add it
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
if (checkEntry(rs.getString(2))) {
|
if (checkAddEntry(rs.getString(2))) {
|
||||||
LOGGER.info(rs.getString(2) + ": game already in database");
|
LOGGER.info(rs.getString(2) + ": game already in database");
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("adding cover to cache ...");
|
LOGGER.info("adding cover to cache ...");
|
||||||
|
@ -253,12 +245,19 @@ public class DBController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LOGGER.info("<============================= finished loading ROM Directory ============================>");
|
||||||
} catch (IOException | SQLException | ParserConfigurationException | SAXException e) {
|
} catch (IOException | SQLException | ParserConfigurationException | SAXException e) {
|
||||||
LOGGER.error("error while loading ROMs from directory", e);
|
LOGGER.error("error while loading ROMs from directory", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkEntry(String title) throws SQLException{
|
/**
|
||||||
|
* check if there is a game with the given name already in the database
|
||||||
|
* @param title game title
|
||||||
|
* @return true if the game exists, false if not
|
||||||
|
* @throws SQLException
|
||||||
|
*/
|
||||||
|
private boolean checkAddEntry(String title) throws SQLException{
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
boolean check = false;
|
boolean check = false;
|
||||||
ResultSet rs = stmt.executeQuery("SELECT * FROM local_roms WHERE title = '"+title+"';");
|
ResultSet rs = stmt.executeQuery("SELECT * FROM local_roms WHERE title = '"+title+"';");
|
||||||
|
@ -268,6 +267,7 @@ public class DBController {
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private void checkRemoveEntry() {
|
private void checkRemoveEntry() {
|
||||||
/**
|
/**
|
||||||
* TODO needs to be implemented!
|
* TODO needs to be implemented!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.controller;
|
package com.cemu_UI.controller;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.controller;
|
package com.cemu_UI.controller;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
@ -59,8 +58,7 @@ public class UpdateController implements Runnable {
|
||||||
private static final Logger LOGGER = LogManager.getLogger(UpdateController.class.getName());
|
private static final Logger LOGGER = LogManager.getLogger(UpdateController.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updater for cemu_UI based on Project HomeFlix checks for Updates and download
|
* updater for cemu_UI, checks for Updates and download it
|
||||||
* it in case there is one
|
|
||||||
*/
|
*/
|
||||||
public UpdateController(MainWindowController mwc, String buildNumber, boolean useBeta) {
|
public UpdateController(MainWindowController mwc, String buildNumber, boolean useBeta) {
|
||||||
mainWindowController = mwc;
|
mainWindowController = mwc;
|
||||||
|
@ -149,7 +147,7 @@ public class UpdateController implements Runnable {
|
||||||
FileUtils.copyInputStreamToFile(pmis, new File("cemu_UI_update.jar")); // download update
|
FileUtils.copyInputStreamToFile(pmis, new File("cemu_UI_update.jar")); // download update
|
||||||
org.apache.commons.io.FileUtils.copyFile(new File("cemu_UI_update.jar"), new File("cemu_UI.jar"));
|
org.apache.commons.io.FileUtils.copyFile(new File("cemu_UI_update.jar"), new File("cemu_UI.jar"));
|
||||||
org.apache.commons.io.FileUtils.deleteQuietly(new File("cemu_UI_update.jar")); // delete update
|
org.apache.commons.io.FileUtils.deleteQuietly(new File("cemu_UI_update.jar")); // delete update
|
||||||
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again
|
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again TODO consider ProcessBuilder to execute
|
||||||
System.exit(0); // finishes itself
|
System.exit(0); // finishes itself
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.datatypes;
|
package com.cemu_UI.datatypes;
|
||||||
|
|
||||||
import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject;
|
import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.datatypes;
|
package com.cemu_UI.datatypes;
|
||||||
|
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.datatypes;
|
package com.cemu_UI.datatypes;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,8 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package com.cemu_UI.uiElements;
|
package com.cemu_UI.uiElements;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.uiElements;
|
package com.cemu_UI.uiElements;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,8 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package com.cemu_UI.uiElements;
|
package com.cemu_UI.uiElements;
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.uiElements;
|
package com.cemu_UI.uiElements;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* cemu_UI
|
* cemu_UI
|
||||||
*
|
*
|
||||||
* Copyright 2017 <@Seil0>
|
* Copyright 2017-2018 <@Seil0>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cemu_UI.vendorCloudController;
|
package com.cemu_UI.vendorCloudController;
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
|
|
@ -81,6 +81,38 @@
|
||||||
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
|
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
|
||||||
-fx-background-insets: -1.4, 0, 1;
|
-fx-background-insets: -1.4, 0, 1;
|
||||||
-fx-background-radius: 1.4, 0, 0;
|
-fx-background-radius: 1.4, 0, 0;
|
||||||
/*....*/
|
|
||||||
-fx-padding: 1; /* 0.083333em; */
|
-fx-padding: 1; /* 0.083333em; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ChoiceBox
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
.choice-box {
|
||||||
|
-fx-background-color: transparent;
|
||||||
|
-fx-border-color: #000000;
|
||||||
|
-fx-border-width: 0 0 1 0;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choice-box:focused {
|
||||||
|
-fx-border-color: #9E9E9E;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choice-box>.open-button>.arrow {
|
||||||
|
-fx-background-color: #757575;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item:focused {
|
||||||
|
-fx-background-color: #00A8CC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Spinner
|
||||||
|
*/
|
||||||
|
.spinner {
|
||||||
|
-fx-background-color: #f4f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.TextFlow?>
|
<?import javafx.scene.text.TextFlow?>
|
||||||
|
|
||||||
<AnchorPane fx:id="mainAnchorPane" prefHeight="600.0" prefWidth="904.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.cemu_UI.application.MainWindowController">
|
<AnchorPane fx:id="mainAnchorPane" minHeight="405.0" minWidth="260.0" prefHeight="600.0" prefWidth="904.0" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.cemu_UI.application.MainWindowController">
|
||||||
<children>
|
<children>
|
||||||
<ScrollPane fx:id="mainScrollPane" fitToWidth="true" layoutY="38.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
<ScrollPane fx:id="mainScrollPane" fitToWidth="true" layoutY="38.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||||
<content>
|
<content>
|
||||||
|
@ -91,12 +91,12 @@
|
||||||
<Insets left="-14.0" />
|
<Insets left="-14.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</VBox>
|
</VBox>
|
||||||
<VBox spacing="10.0">
|
<VBox spacing="7.0">
|
||||||
<children>
|
<children>
|
||||||
<Label fx:id="cemuDirectoryLbl" text="Cemu Directory" />
|
<Label fx:id="cemuDirectoryLbl" text="Cemu Directory" />
|
||||||
<HBox spacing="10.0">
|
<HBox spacing="10.0">
|
||||||
<children>
|
<children>
|
||||||
<JFXTextField fx:id="cemuTextField" maxWidth="305.0" minWidth="305.0" onAction="#cemuTextFieldAction" prefHeight="32.0" prefWidth="305.0" promptText="cemu directory" />
|
<JFXTextField fx:id="cemuTextField" maxWidth="305.0" minWidth="305.0" prefHeight="32.0" prefWidth="305.0" promptText="cemu directory" />
|
||||||
<JFXButton fx:id="cemuTFBtn" onAction="#cemuTFBtnAction" prefHeight="32.0" text="choose directory" />
|
<JFXButton fx:id="cemuTFBtn" onAction="#cemuTFBtnAction" prefHeight="32.0" text="choose directory" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
|
@ -105,12 +105,12 @@
|
||||||
<Insets right="5.0" />
|
<Insets right="5.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</VBox>
|
</VBox>
|
||||||
<VBox spacing="10.0">
|
<VBox spacing="7.0">
|
||||||
<children>
|
<children>
|
||||||
<Label fx:id="romDirectoryLbl" text="Rom Directory" />
|
<Label fx:id="romDirectoryLbl" text="Rom Directory" />
|
||||||
<HBox spacing="10.0">
|
<HBox spacing="10.0">
|
||||||
<children>
|
<children>
|
||||||
<JFXTextField fx:id="romTextField" maxWidth="305.0" minWidth="305.0" onAction="#romTextFieldAction" prefHeight="32.0" prefWidth="305.0" promptText="rom directory" />
|
<JFXTextField fx:id="romTextField" maxWidth="305.0" minWidth="305.0" prefHeight="32.0" prefWidth="305.0" promptText="rom directory" />
|
||||||
<JFXButton fx:id="romTFBtn" onAction="#romTFBtnAction" prefHeight="32.0" text="choose directory" />
|
<JFXButton fx:id="romTFBtn" onAction="#romTFBtnAction" prefHeight="32.0" text="choose directory" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
|
@ -213,14 +213,14 @@
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<HBox fx:id="bottomHBox" alignment="CENTER" layoutX="326.0" layoutY="602.0" prefHeight="48.0" prefWidth="200.0" spacing="10.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
<HBox fx:id="bottomHBox" alignment="CENTER" layoutX="326.0" layoutY="602.0" prefHeight="48.0" prefWidth="200.0" spacing="10.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<JFXButton fx:id="totalPlaytimeBtn" buttonType="RAISED" maxHeight="32.0" maxWidth="150.0" minWidth="125.0" onAction="#totalPlaytimeBtnAction" prefHeight="32.0" style="-fx-background-color: #ffffff; -fx-button-type: RAISED; -fx-text-fill: BLACK;" text="0 h 0 min">
|
<JFXButton fx:id="totalPlaytimeBtn" buttonType="RAISED" maxHeight="32.0" maxWidth="156.0" minHeight="32.0" minWidth="156.0" onAction="#totalPlaytimeBtnAction" style="-fx-background-color: #ffffff; -fx-button-type: RAISED; -fx-text-fill: BLACK;" text="0 h 0 min">
|
||||||
</JFXButton>
|
</JFXButton>
|
||||||
<JFXButton fx:id="playBtn" buttonType="RAISED" maxHeight="28.0" minWidth="100.0" onAction="#playBtnAction" ripplerFill="#00aacc" text="play" textAlignment="CENTER">
|
<JFXButton fx:id="playBtn" buttonType="RAISED" maxHeight="28.0" minWidth="100.0" onAction="#playBtnAction" ripplerFill="#00aacc" text="play" textAlignment="CENTER">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="14.0" />
|
<Font name="System Bold" size="14.0" />
|
||||||
</font>
|
</font>
|
||||||
</JFXButton>
|
</JFXButton>
|
||||||
<JFXButton fx:id="lastTimePlayedBtn" buttonType="RAISED" maxHeight="32.0" maxWidth="150.0" minWidth="125.0" onAction="#lastTimePlayedBtnAction" prefHeight="32.0" style="-fx-background-color: #ffffff; -fx-button-type: RAISED; -fx-text-fill: BLACK;" text="Last played, never" />
|
<JFXButton fx:id="lastTimePlayedBtn" buttonType="RAISED" maxHeight="32.0" maxWidth="156.0" minHeight="32.0" minWidth="156.0" onAction="#lastTimePlayedBtnAction" style="-fx-background-color: #ffffff; -fx-button-type: RAISED; -fx-text-fill: BLACK;" text="Last played, never" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
</children>
|
</children>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
aboutBtn = About
|
aboutBtn = About
|
||||||
settingsBtn = Setting
|
settingsBtn = Settings
|
||||||
addBtn = Add new Game
|
addBtn = Add new Game
|
||||||
reloadRomsBtn = reload ROMs
|
reloadRomsBtn = reload ROMs
|
||||||
smmdbBtn = smmdb
|
smmdbBtn = smmdb
|
||||||
|
@ -33,7 +33,7 @@ timeColumn = time
|
||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
editHeadingText = edit
|
editHeadingText = edit
|
||||||
editBodyText = You can edit the tile and rom/cover path.
|
editBodyText = You can edit the tile and ROM/cover path.
|
||||||
removeHeadingText = remove
|
removeHeadingText = remove
|
||||||
removeBodyText = Are you sure you want to delete
|
removeBodyText = Are you sure you want to delete
|
||||||
addUpdateHeadingText = update
|
addUpdateHeadingText = update
|
||||||
|
@ -49,15 +49,15 @@ aboutBtnHeadingText = cemu_UI
|
||||||
aboutBtnBodyText = This Application is made with free Software\nand licensed under the terms of GNU GPL 3.\n\nwww.kellerkinder.xyz
|
aboutBtnBodyText = This Application is made with free Software\nand licensed under the terms of GNU GPL 3.\n\nwww.kellerkinder.xyz
|
||||||
|
|
||||||
cloudSyncWaringHeadingText = activate cloud savegame sync (beta)
|
cloudSyncWaringHeadingText = activate cloud savegame sync (beta)
|
||||||
cloudSyncWaringBodyText = WARNING this is a completly WIP cloud save integration,\nit's NOT recomended to use this!!\n\nUse it on your own risk and backup everthing before!
|
cloudSyncWaringBodyText = WARNING this is a completely WIP cloud save integration,\nit's NOT recommended to use this!!\n\nUse it on your own risk and backup everything before!
|
||||||
|
|
||||||
cloudSyncErrorHeadingText = Error while initializing cloud sync!
|
cloudSyncErrorHeadingText = Error while initializing cloud sync!
|
||||||
cloudSyncErrorBodyText = There was some truble while initializing 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.
|
cloudSyncErrorBodyText = There was some trouble while initializing 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.
|
||||||
|
|
||||||
addGameBtnHeadingText = add a new game to cemu_UI
|
addGameBtnHeadingText = add a new game to cemu_UI
|
||||||
addGameBtnBodyText =
|
addGameBtnBodyText =
|
||||||
addBtnReturnErrorHeadingText = Error while adding a new Game!
|
addBtnReturnErrorHeadingText = Error while adding a new Game!
|
||||||
addBtnReturnErrorBodyText = There was some truble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
addBtnReturnErrorBodyText = There was some trouble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
||||||
lastPlayed = Last played,
|
lastPlayed = Last played,
|
||||||
today = today
|
today = today
|
||||||
yesterday = yesterday
|
yesterday = yesterday
|
||||||
|
@ -82,6 +82,6 @@ titleID = title ID
|
||||||
romPath = ROM path
|
romPath = ROM path
|
||||||
coverPath = cover path
|
coverPath = cover path
|
||||||
editGameDialogHeadingTextError = Error while adding a new Game!
|
editGameDialogHeadingTextError = Error while adding a new Game!
|
||||||
editGameDialogBodyTextError = There was some truble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
editGameDialogBodyTextError = There was some trouble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
||||||
editGameDialogSelectPathBtn = select .rpx file
|
editGameDialogSelectPathBtn = select .rpx file
|
||||||
editGameDialogSelectCoverBtn = select cover file
|
editGameDialogSelectCoverBtn = select cover file
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package com.cemu_UI.test;
|
package com.cemu_UI.test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import junit.framework.Assert;
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
@ -24,8 +21,7 @@ public class AppTest extends TestCase {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private void testClientsSecret() {
|
private void testClientsSecret() {
|
||||||
File client_secret = new File("/client_secret.json");
|
|
||||||
Assert.assertTrue(client_secret.exists());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue