56 Commits
077 ... 085

Author SHA1 Message Date
36fd86d15c Merge branch 'develop' 2018-11-19 23:21:53 +01:00
87eaec31ee „README.md“ ändern 2018-11-19 23:18:29 +01:00
a2f35de1c7 „README.md“ ändern 2018-11-19 23:18:07 +01:00
b879e22fcf deleted unused images 2018-11-19 23:17:13 +01:00
960bec5283 „README.md“ ändern 2018-11-19 23:02:26 +01:00
ffb7bc971c removed eclipse specific files 2018-10-25 16:42:45 +02:00
50088e0130 „.project“ löschen 2018-10-25 16:35:20 +02:00
a3fc8ba463 „.classpath“ löschen 2018-10-25 16:35:14 +02:00
ada6bec325 updated gitignore 2018-10-25 16:34:56 +02:00
bbfc9521a0 target java11/javafx11 2018-10-01 21:20:35 +02:00
2ac66978ba updated some libraries
* jfoenix 9.0.4 -> 9.0.6
* log4j 2.11.0 -> 2.11.1
* google apis 1.23.0 -> 1.25.0
* jackson-core 2.9.5 -> 2.9.6
* javax.servlet 4.0.0 -> 4.0.1
* maven-compiler-plugin 3.7.0 -> 3.8.0
2018-09-08 12:50:34 +02:00
ed99e45115 cleaned up games.csv
* use https now
* added a few covers
* added a few japanese titles
2018-08-16 13:27:31 +02:00
dcd928096a updated a few games in games.csv 2018-08-16 00:01:54 +02:00
1df6a91f41 Merge branch 'develop' of Seil0/cemu_UI into master 2018-08-14 21:35:57 +02:00
d46eace9d5 updated readme 2018-06-18 15:19:47 +02:00
9e58a30390 updated readme 2018-06-18 15:14:34 +02:00
010f109597 updated readme 2018-06-18 15:13:09 +02:00
d082482844 updated readme 2018-06-18 13:54:46 +02:00
fb1fd442f7 'README.md' ändern 2018-06-16 12:04:43 +02:00
9839c303da download the games.db from gitea 2018-06-16 00:03:23 +02:00
b610dc337b 'README.md' ändern 2018-06-14 15:24:33 +02:00
f195addea8 version 0.3.1 (81) 2018-06-13 18:29:16 +02:00
e371859987 test commit 2 2018-06-13 15:14:34 +02:00
8b62a732cd test commit 2018-06-13 15:08:34 +02:00
41a0becd4f typo 2018-06-13 13:49:47 +02:00
9b7a85cabe code clean up 2018-06-12 16:24:12 +02:00
cc4e73c45d InfoAlert & ProcessBuilder
* we use an Alert now to display Info Messages
* use ProcessBuilder instead of Runtime.exec()
2018-06-12 16:01:21 +02:00
c6a40f8937 updated some libs
* jfoenix 9.0.3 -> 9.0.4
* sqlite-jdbc 3.21.0.1 -> 3.23.1
* google-api-services-drive v3-rev99-1.23.0 -> v3-rev120-1.23.0
* jackson-core 2.9.4 -> 2.9.5
* maven-shade-plugin 3.1.0 -> 3.1.1
2018-06-06 17:54:22 +02:00
e13c84382f biuld against java 10 2018-05-30 19:41:49 +02:00
ea34f10c09 fixed Hamburger icon has wrong color after color change 2018-04-28 12:53:01 +02:00
4e4d32dc97 Update README.md 2018-04-28 12:24:40 +02:00
f1bb0607f7 Merge pull request #18 from Seil0/develop
release 0.3.0
2018-04-28 12:23:14 +02:00
5758b23bff Merge branch 'master' into develop 2018-04-28 12:21:37 +02:00
1e7cea86ad code cleanup
* log4j 2.10.0 -> 2.11.0
2018-04-28 12:17:12 +02:00
433767f81c Merge remote-tracking branch 'origin/develop' into develop 2018-04-05 09:55:09 +02:00
f9f63c0f3c code cleanup 2018-04-05 09:54:45 +02:00
fcaffecabf text fix 2018-03-22 18:54:56 +01:00
7813778502 small cleanup 2018-03-22 11:54:30 +01:00
662188813b removed workaround for xPosHelper Bug 2018-02-24 17:00:43 +01:00
b915cf7ad9 removed last unnecessary reboot
* needs more testing, especialy under Windows
* test on a completly fresh setup
2018-02-20 21:22:10 +01:00
b4fc36621a code cleanup
removed some unnecessary save calls
* removed some unnecessary things after opening a directorychooser
* typo fixes
2018-02-18 18:27:36 +01:00
061f58105a documentation cleanups, code cleanup
* removed one unnecessary restart
* added warning if the ROM directory could not be opened
2018-02-18 13:57:30 +01:00
3a6a7b7cce * jfoenix 9.0.1 -> 9.0.2
* code clean up
* last time played and playtime button are now large enough
2018-02-17 17:49:12 +01:00
f7675cf277 Update README.md 2018-02-14 22:55:27 +01:00
4932731987 Update README.md 2018-02-14 22:53:14 +01:00
2e3395caea minor fixes
* fixed a few typos
* fixed window is resiable to 0x0
* * formating work work
2018-02-04 15:19:36 +01:00
54078eb99f clean up 2018-02-03 17:51:38 +01:00
79cb1c2476 fixed games are not loaded to mwc
* fixed games are not loaded to mwc
* fixed processbuilder
2018-02-03 15:39:35 +01:00
b88c530ac2 use a ProcessBuilder instead of Runtime.exec 2018-02-03 14:22:41 +01:00
88e31468d4 made choicebox matreial styled
* made choicebox matreial styled
* little code clean up
2018-02-03 12:04:14 +01:00
84b5eaedcd reworked startup process
* cemu is showing a loading screen while loading the roms
* jackson core 2.9.3 -> 2.9.4
2018-01-31 17:01:47 +01:00
f331fb57a4 added ability to edit launch command, WIP
WARNING THIS IS NOT TESTED
2018-01-19 01:14:01 +01:00
a9f675ee5e Update README.md 2018-01-13 23:35:33 +01:00
fe4fcb45d7 travis fix, first try 2018-01-13 00:13:34 +01:00
52c2912ba2 maven compile plugin 3.7.0 2018-01-13 00:09:13 +01:00
46455e9e9d Java 9, updated a few libs
* cemu_UI targets now Java 9
* jfoenix 1.11.1 -> 9.0.1
* minimal-json 0.9.4 -> 0.9.5
* log4j 2.9.1 -> 2.10.0
* commons-io 2.5 -> 2.6
* jackson-core 2.9.2 -> 2.9.3
* javax.servlet-api 4.0.0-b01 -> 4.0.0
2018-01-12 23:52:44 +01:00
33 changed files with 3325 additions and 3372 deletions

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<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">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

3
.gitignore vendored
View File

@ -50,3 +50,6 @@ client_secret.json
.directory
target/
cemu_UI.jar
.classpath
.project
.settings/*

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cemu_UI</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,5 +0,0 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@ -1,13 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
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.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -1 +1,4 @@
language: java
jdk:
- oraclejdk9
- oraclejdk10

View File

@ -1,18 +1,17 @@
# cemu_UI
![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)
[![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://git.mosad.xyz/Seil0/cemu_UI/releases)
[![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://git.mosad.xyz/Seil0/cemu_UI/releases).
## Installation
Simply download the cemu_UI.jar from [releases](https://github.com/Seil0/cemu_UI/releases), make sure you have the latest version of java 8 oracle jre/jdk installed and open the file. cemu_UI creats a new directory "C:\Users\USERNAME\Documents\cemu_UI", where the database, settings and covers are stored. **first start can take while!**
Simply download the cemu_UI.jar from [Releases](https://git.mosad.xyz/Seil0/cemu_UI/releases), make sure you have the latest version of java 8 oracle jre/jdk installed and open the file. cemu_UI creats a new directory "C:\Users\USERNAME\Documents\cemu_UI", where the database, settings and covers are stored. **first start can take while!**
If you want to use the cloud sync function read the [wiki](https://github.com/Seil0/cemu_UI/wiki#cloud-savegame-syncronisation) carefully! If you have problems using the cloud synchronisation please update to version [075](https://github.com/Seil0/cemu_UI/releases/tag/075).
If you want to use the cloud sync function read the [wiki](https://git.mosad.xyz/Seil0/cemu_UI/wiki#cloud-savegame-syncronisation) carefully!
### [FAQ](https://github.com/Seil0/cemu_UI/wiki#faq)
### [FAQ](https://git.mosad.xyz/Seil0/cemu_UI/wiki#faq)
## Features
@ -22,20 +21,17 @@ If you want to use the cloud sync function read the [wiki](https://github.com/Se
* add updates and dlcs easier (only adding not downloading!)
* automatic rom detection (only .rpx files with a app.xml)
* customisable UI
* [sync savegames via google drive](https://github.com/Seil0/cemu_UI/wiki)
* [sync savegames via google drive](https://git.mosad.xyz/Seil0/cemu_UI/wiki)
* [smmdb api](https://github.com/Tarnadas/smmdb) integration
## [planed Features](https://github.com/Seil0/cemu_UI/projects/1) (no ETA)
## [planed Features](https://git.mosad.xyz/Seil0/cemu_UI/milestones)
* 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!
### [building from source](https://github.com/Seil0/cemu_UI/wiki/Documantation)
### [building from source](https://git.mosad.xyz/Seil0/cemu_UI/wiki/Documentation)
## Screenshots
![Screenshot](/downloadContent/cemu_UI4.png)
![Screenshot](https://www.mosad.xyz/images/cemu_UI_MainWindow.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff

102
pom.xml
View File

@ -1,19 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>cemu_UI</artifactId>
<version>0.2.3-SNAPSHOT</version>
<version>0.3.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cemu_UI</name>
<url>http://www.kellerkinder.xyz</url>
<description>cemu_UI is a simple, material design graphical frontend for cemu, a Wii U emulator</description>
<url>https://www.mosad.xyz</url>
<properties>
<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>
<dependencies>
@ -21,44 +20,62 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>com.jfoenix</groupId>
<artifactId>jfoenix</artifactId>
<version>1.11.1</version>
<version>9.0.6</version>
</dependency>
<dependency>
<groupId>com.eclipsesource.minimal-json</groupId>
<artifactId>minimal-json</artifactId>
<version>0.9.4</version>
<version>0.9.5</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.21.0.1</version>
<version>3.23.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.9.1</version>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.9.1</version>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2 -->
@ -90,7 +107,7 @@
<version>1.3.2</version>
</dependency>
<!-- Google Drive-API libraries-->
<!-- Google Drive-API libraries -->
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
@ -102,64 +119,63 @@
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-drive -->
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-drive</artifactId>
<version>v3-rev87-1.23.0</version>
<version>v3-rev129-1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client -->
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.http-client/google-http-client-jackson2 -->
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client -->
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-java6 -->
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-java6</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty -->
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.23.0</version>
<version>1.25.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.2</version>
<version>2.9.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0-b01</version>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
@ -180,13 +196,40 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.cemu_UI.application.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
@ -194,17 +237,18 @@
<goal>shade</goal>
</goals>
<configuration>
<finalName>cemu_UI</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.cemu_UI.application.Main</mainClass>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.cemu_UI.application.JavaFX11Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -0,0 +1,8 @@
package com.cemu_UI.application;
public class JavaFX11Main {
public static void main(String[] args) {
Main.main(args);
}
}

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.application;
import java.io.File;
@ -48,7 +47,6 @@ import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.layout.AnchorPane;
public class Main extends Application {
private Stage primaryStage;
@ -63,14 +61,13 @@ public class Main extends Application {
private static String osVers = System.getProperty("os.version");
private static String javaVers = System.getProperty("java.version");
private static String javaVend= System.getProperty("java.vendor");
private String gamesDBdownloadURL = "https://github.com/Seil0/cemu_UI/raw/master/downloadContent/games.db";
public String dirWin = userHome + "/Documents/cemu_UI"; // Windows: C:/Users/"User"/Documents/cemu_UI
public String dirLinux = userHome + "/cemu_UI"; // Linux: /home/"User"/cemu_UI
private File directory;
private File configFile;
private File gamesDBFile;
private File reference_gamesFile;
private File pictureCache;
private String gamesDBdownloadURL = "https://git.mosad.xyz/Seil0/cemu_UI/raw/branch/master/downloadContent/games.db";
private static String dirCemuUI;
private static File directory;
private static File configFile;
private static File gamesDBFile;
private static File reference_gamesFile;
private static File pictureCache;
private static Logger LOGGER;
@Override
@ -79,7 +76,10 @@ public class Main extends Application {
LOGGER.info("OS: " + osName + " " + osVers + " " + osArch);
LOGGER.info("Java: " + javaVend + " " + javaVers);
LOGGER.info("User: " + userName + " " + userHome);
this.primaryStage = primaryStage;
mainWindowController = new MainWindowController(this);
mainWindow();
initActions();
} catch (Exception e) {
@ -91,39 +91,32 @@ public class Main extends Application {
private void mainWindow(){
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(ClassLoader.getSystemResource("fxml/MainWindow.fxml"));
loader.setLocation(getClass().getResource("/fxml/MainWindow.fxml"));
loader.setController(mainWindowController);
pane = (AnchorPane) loader.load();
primaryStage.setMinWidth(265.00);
primaryStage.setMinHeight(425.00);
primaryStage.setTitle("cemu_UI");
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/resources/Homeflix_Icon_64x64.png"))); //adds application icon
// primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream(""))); //adds application icon
primaryStage.setOnCloseRequest(event -> System.exit(1));
// generate window
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
mainWindowController = loader.getController(); // Link of FXMLController and controller class
mainWindowController.setMain(this); // call setMain
cloudController = new CloudController(mainWindowController); // call cloudController constructor
// get OS and the specific paths
if (osName.equals("Linux")) {
directory = new File(dirLinux);
configFile = new File(dirLinux + "/config.xml");
gamesDBFile = new File(dirLinux + "/games.db");
reference_gamesFile = new File(dirLinux + "/reference_games.db");
pictureCache= new File(dirLinux+"/picture_cache");
} else {
directory = new File(dirWin);
configFile = new File(dirWin + "/config.xml");
gamesDBFile = new File(dirWin + "/games.db");
reference_gamesFile = new File(dirWin + "/reference_games.db");
pictureCache= new File(dirWin+"/picture_cache");
}
// startup checks
// check if client_secret.jason is present
// check if client_secret.json is present
if (Main.class.getResourceAsStream("/client_secret.json") == null) {
LOGGER.error("client_secret is missing!!!!!");
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("cemu_UI");
alert.setHeaderText("Error");
alert.setContentText("client_secret is missing! Please contact the maintainer. \nIf you compiled cemu_UI by yourself see: \nhttps://github.com/Seil0/cemu_UI/wiki/Documantation");
alert.setContentText("client_secret is missing! Please contact the maintainer. \nIf you compiled cemu_UI by yourself see: \nhttps://git.mosad.xyz/Seil0/cemu_UI/wiki/Documantation");
alert.showAndWait();
}
@ -142,11 +135,9 @@ public class Main extends Application {
mainWindowController.setLastLocalSync(0);
mainWindowController.setxPosHelper(0);
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();
}
@ -168,27 +159,44 @@ public class Main extends Application {
}
}
// loading settings and initialize UI, dbController.main() loads all databases
// init here as it loads the games to the mwc and the gui, therefore the window must exist
mainWindowController.init();
mainWindowController.dbController.init();
mainWindowController.getDbController().init();
// if cloud sync is activated start sync
if(mainWindowController.isCloudSync()) {
cloudController.initializeConnection(mainWindowController.getCloudService(), mainWindowController.getCemuPath());
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) {
e.printStackTrace();
}
}
private void firstStart(){
public static void main(String[] args) {
if (osName.contains("Windows")) {
dirCemuUI = userHome + "/Documents/cemu_UI";
} else {
dirCemuUI = userHome + "/cemu_UI";
}
directory = new File(dirCemuUI);
configFile = new File(dirCemuUI + "/config.xml");
gamesDBFile = new File(dirCemuUI + "/games.db");
reference_gamesFile = new File(dirCemuUI + "/reference_games.db");
pictureCache= new File(dirCemuUI+"/picture_cache");
// delete old log file and create new
System.setProperty("logFilename", dirCemuUI + "/app.log");
File logFile = new File(dirCemuUI + "/app.log");
logFile.delete();
LOGGER = LogManager.getLogger(Main.class.getName());
launch(args);
}
private void firstStart() {
Alert alert = new Alert(AlertType.CONFIRMATION); // new alert with file-chooser
alert.setTitle("cemu_UI");
alert.setHeaderText("cemu installation");
@ -213,10 +221,9 @@ public class Main extends Application {
if (result2.get() == ButtonType.OK) {
DirectoryChooser directoryChooser = new DirectoryChooser();
File selectedDirectory = directoryChooser.showDialog(primaryStage);
mainWindowController.setRomPath(selectedDirectory.getAbsolutePath());
mainWindowController.setRomDirectoryPath(selectedDirectory.getAbsolutePath());
} else {
mainWindowController.setRomPath(null);
mainWindowController.setRomDirectoryPath(null);
}
}
@ -293,26 +300,6 @@ public class Main extends Application {
primaryStage.maximizedProperty().addListener(maximizeListener);
}
public static void main(String[] args) {
// delete old log file and create new
if(osName.equals("Linux")){
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
File logFile = new File(userHome + "/cemu_UI/app.log");
logFile.delete();
}else{
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
logFile.delete();
}
LOGGER = LogManager.getLogger(Main.class.getName());
launch(args);
}
@Override
public void stop() {
System.exit(0);
}
public Stage getPrimaryStage() {
return primaryStage;
}
@ -341,7 +328,19 @@ public class Main extends Application {
return directory;
}
public void setDirectory(File directory) {
this.directory = directory;
public File getConfigFile() {
return configFile;
}
public File getGamesDBFile() {
return gamesDBFile;
}
public File getReference_gamesFile() {
return reference_gamesFile;
}
public File getPictureCache() {
return pictureCache;
}
}

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.application;
import java.awt.Desktop;
@ -54,14 +53,14 @@ import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.cemu_UI.controller.DBController;
import com.cemu_UI.controller.SmmdbAPIController;
import com.cemu_UI.controller.UpdateController;
import com.cemu_UI.controller.DBController;
import com.cemu_UI.datatypes.CourseTableDataType;
import com.cemu_UI.datatypes.SmmdbApiDataType;
import com.cemu_UI.datatypes.UIROMDataType;
import com.cemu_UI.uiElements.JFXEditGameDialog;
import com.cemu_UI.uiElements.JFXInfoDialog;
import com.cemu_UI.uiElements.JFXInfoAlert;
import com.cemu_UI.uiElements.JFXOkayCancelDialog;
import com.cemu_UI.uiElements.JFXTextAreaInfoDialog;
import com.jfoenix.controls.JFXButton;
@ -112,37 +111,26 @@ public class MainWindowController {
@FXML
private JFXButton aboutBtn;
@FXML
private JFXButton settingsBtn;
@FXML
private JFXButton addBtn;
@FXML
private JFXButton reloadRomsBtn;
@FXML
private JFXButton smmdbBtn;
@FXML
private JFXButton cemuTFBtn;
@FXML
private JFXButton romTFBtn;
@FXML
private JFXButton updateBtn;
@FXML
private JFXButton smmdbDownloadBtn;
@FXML
private JFXButton playBtn;
@FXML
private JFXButton lastTimePlayedBtn;
@FXML
JFXButton totalPlaytimeBtn;
@ -151,12 +139,12 @@ public class MainWindowController {
@FXML
private JFXTextField cemuTextField;
@FXML
private JFXTextField romTextField;
@FXML
private JFXTextField courseSearchTextFiled;
@FXML
private JFXTextField executeCommandTextFiled;
@FXML
private TextFlow smmdbTextFlow;
@ -166,40 +154,31 @@ public class MainWindowController {
@FXML
private JFXToggleButton cloudSyncToggleBtn;
@FXML
private JFXToggleButton autoUpdateToggleBtn;
@FXML
private JFXToggleButton fullscreenToggleBtn;
@FXML
private ChoiceBox<String> languageChoisBox;
@FXML
private ChoiceBox<String> branchChoisBox;
@FXML
private AnchorPane mainAnchorPane;
@FXML
private AnchorPane gamesAnchorPane;
@FXML
private AnchorPane settingsAnchorPane;
@FXML
private AnchorPane smmdbAnchorPane;
@FXML
private ScrollPane mainScrollPane;
@FXML
private ScrollPane settingsScrollPane;
@FXML
private ScrollPane smmdbScrollPane;
@FXML
private ScrollPane smmdbImageViewScrollPane;
@ -208,7 +187,6 @@ public class MainWindowController {
@FXML
private HBox topHBox;
@FXML
private HBox bottomHBox;
@ -217,31 +195,22 @@ public class MainWindowController {
@FXML
private Label helpLbl;
@FXML
private Label cemu_UISettingsLbl;
@FXML
private Label cemuDirectoryLbl;
@FXML
private Label romDirectoryLbl;
@FXML
private Label mainColorLbl;
@FXML
private Label languageLbl;
@FXML
private Label updateLbl;
@FXML
private Label branchLbl;
@FXML
private Label cemuSettingsLbl;
@FXML
private Label licensesLbl;
@ -249,24 +218,26 @@ public class MainWindowController {
private JFXTreeTableView<CourseTableDataType> courseTreeTable = new JFXTreeTableView<CourseTableDataType>();
@FXML
TreeItem<CourseTableDataType> root = new TreeItem<>(new CourseTableDataType("", "", 0, 0));
private TreeItem<CourseTableDataType> root = new TreeItem<>(new CourseTableDataType("", "", 0, 0));
@FXML
private JFXTreeTableColumn<CourseTableDataType, String> titleColumn = new JFXTreeTableColumn<>("title");
@FXML
private JFXTreeTableColumn<CourseTableDataType, String> idColumn = new JFXTreeTableColumn<>("id");
@FXML
private JFXTreeTableColumn<CourseTableDataType, Integer> starsColumn = new JFXTreeTableColumn<>("stars");
@FXML
private JFXTreeTableColumn<CourseTableDataType, Integer> timeColumn = new JFXTreeTableColumn<>("time");
Main main;
DBController dbController;
SmmdbAPIController smmdbAPIController;
playGame playGame;
@SuppressWarnings("unused")
private enum CloudService {
GoogleDrive, Dropbox
}
private Main main;
private DBController dbController;
private SmmdbAPIController smmdbAPIController;
private playGame playGame;
private static MainWindowController MWC;
private UpdateController updateController;
private boolean menuTrue = false;
@ -279,16 +250,16 @@ public class MainWindowController {
private boolean cloudSync;
private String cloudService = ""; // set cloud provider (at the moment only GoogleDrive, Dropbox is planed)
private String cemuPath;
private String romPath;
private String romDirectoryPath;
private String gameExecutePath;
private String color;
private String dialogBtnStyle;
private String selectedGameTitleID;
private String selectedGameTitle;
private String id;
private String version = "0.2.3";
private String buildNumber = "071";
private String versionName = "Puzzle Plank Galaxy";
private String version = "0.3.1";
private String buildNumber = "081";
private String versionName = "Purple Comet";
private int xPos = -200;
private int yPos = 17;
private int xPosHelper;
@ -299,15 +270,9 @@ public class MainWindowController {
private double windowWidth;
private double windowHeight;
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> 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();
ObservableList<SmmdbApiDataType> courses = FXCollections.observableArrayList();
ObservableList<SmmdbApiDataType> filteredCourses = FXCollections.observableArrayList();
@ -371,9 +336,9 @@ public class MainWindowController {
private String smmdbDownloadBtnLoading;
private String smmdbDownloadBtnDownload;
public void setMain(Main m) {
this.main = m;
dbController = new DBController(this);
public MainWindowController(Main main) {
this.main = main;
dbController = new DBController(main, this);
smmdbAPIController = new SmmdbAPIController();
}
@ -381,7 +346,7 @@ public class MainWindowController {
* initialize the MainWindowController
* loadSettings, checkAutoUpdate, initUI and initActions
*/
void init() {
public void init() {
loadSettings();
checkAutoUpdate();
initUI();
@ -399,7 +364,7 @@ public class MainWindowController {
}
cemuTextField.setText(cemuPath);
romTextField.setText(romPath);
romTextField.setText(romDirectoryPath);
colorPicker.setValue(Color.valueOf(getColor()));
fullscreenToggleBtn.setSelected(isFullscreen());
cloudSyncToggleBtn.setSelected(isCloudSync());
@ -720,9 +685,9 @@ public class MainWindowController {
@Override
public void run() {
try {
Desktop.getDesktop().browse(new URI("https://github.com/Seil0/cemu_UI/issues/3"));
Desktop.getDesktop().browse(new URI("https://git.mosad.xyz/Seil0/cemu_UI/issues/3"));
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
LOGGER.error("An error ocoured while trying to open a Website.", e);
}
}
});
@ -801,24 +766,56 @@ 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";
JFXInfoAlert fileErrorDialog = new JFXInfoAlert("Waring!", bodyText, dialogBtnStyle, main.getPrimaryStage());
fileErrorDialog.showAndWait();
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";
JFXInfoAlert fileErrorDialog = new JFXInfoAlert("Waring!", bodyText, dialogBtnStyle, main.getPrimaryStage());
fileErrorDialog.showAndWait();
LOGGER.warn(newValue + ": No such file or directory");
}
}
});
LOGGER.info("initializing Actions done!");
}
@FXML
void detailsSlideoutBtnAction(ActionEvent event) {
private void detailsSlideoutBtnAction() {
playBtnSlideOut();
}
@FXML
void aboutBtnAction() {
private void aboutBtnAction() {
String bodyText = "cemu_UI by @Seil0 \nVersion: " + version + " (" + buildNumber + ") \"" + versionName + "\" \n"
+ aboutBtnBodyText;
JFXInfoDialog aboutDialog = new JFXInfoDialog(aboutBtnHeadingText, bodyText, dialogBtnStyle, 350, 200, main.getPane());
aboutDialog.show();
JFXInfoAlert infoAlert = new JFXInfoAlert(aboutBtnHeadingText, bodyText, dialogBtnStyle, main.getPrimaryStage());
infoAlert.showAndWait();
}
@FXML
void settingsBtnAction(ActionEvent event) {
private void settingsBtnAction() {
if (smmdbTrue) {
smmdbAnchorPane.setVisible(false);
smmdbTrue = false;
@ -834,31 +831,12 @@ public class MainWindowController {
}
@FXML
void reloadRomsBtnAction() throws IOException {
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();
private void reloadRomsBtnAction() throws IOException {
reloadRoms();
}
@FXML
void smmdbBtnAction() {
private void smmdbBtnAction() {
// show smmdbAnchorPane
if (smmdbTrue) {
smmdbAnchorPane.setVisible(false);
@ -897,7 +875,7 @@ public class MainWindowController {
}
@FXML
void playBtnAction(ActionEvent event) throws InterruptedException, IOException {
private void playBtnAction() throws InterruptedException, IOException {
dbController.setLastPlayed(selectedGameTitleID);
playGame = new playGame(this, dbController);
@ -905,53 +883,33 @@ public class MainWindowController {
}
@FXML
void totalPlaytimeBtnAction(ActionEvent event) {
private void totalPlaytimeBtnAction() {
}
@FXML
void lastTimePlayedBtnAction(ActionEvent event) {
private void lastTimePlayedBtnAction() {
}
@FXML
void cemuTFBtnAction(ActionEvent event) {
private void cemuTFBtnAction() {
File cemuDirectory = directoryChooser.showDialog(main.getPrimaryStage());
if (cemuDirectory == null) {
LOGGER.info("No Directory selected");
} 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);
}
if (cemuDirectory != null) {
cemuTextField.setText(cemuDirectory.getAbsolutePath());
}
}
@FXML
void romTFBtnAction(ActionEvent event) {
private void romTFBtnAction() {
File romDirectory = directoryChooser.showDialog(main.getPrimaryStage());
if (romDirectory == null) {
LOGGER.info("No Directory selected");
} 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);
}
if (romDirectory != null) {
romTextField.setText(romDirectory.getAbsolutePath());
}
}
@FXML
void updateBtnAction(ActionEvent event) {
private void updateBtnAction() {
updateController = new UpdateController(this, buildNumber, useBeta);
Thread updateThread = new Thread(updateController);
updateThread.setName("Updater");
@ -959,7 +917,7 @@ public class MainWindowController {
}
@FXML
void autoUpdateToggleBtnAction(ActionEvent event) {
private void autoUpdateToggleBtnAction() {
if (isAutoUpdate()) {
setAutoUpdate(false);
} else {
@ -969,12 +927,12 @@ public class MainWindowController {
}
@FXML
void courseSearchTextFiledAction(ActionEvent event) {
private void courseSearchTextFiledAction() {
// not in use
}
@FXML
void smmdbDownloadBtnAction(ActionEvent event) {
private void smmdbDownloadBtnAction() {
String downloadUrl = "http://smmdb.ddns.net/api/downloadcourse?id=" + id + "&type=zip";
String downloadFileURL = getCemuPath() + "/" + id + ".zip"; // getCemuPath() + "/" + smmID + "/" + id + ".rar"
String outputFile = getCemuPath() + "/";
@ -1042,19 +1000,7 @@ public class MainWindowController {
}
@FXML
void cemuTextFieldAction(ActionEvent event) {
setCemuPath(cemuTextField.getText());
saveSettings();
}
@FXML
void romTextFieldAction(ActionEvent event) {
setRomPath(romTextField.getText());
saveSettings();
}
@FXML
void fullscreenToggleBtnAction(ActionEvent event) {
private void fullscreenToggleBtnAction() {
if (fullscreen) {
fullscreen = false;
} else {
@ -1064,7 +1010,7 @@ public class MainWindowController {
}
@FXML
void cloudSyncToggleBtnAction(ActionEvent event) {
private void cloudSyncToggleBtnAction() {
if(cloudSync) {
cloudSync = false;
} else {
@ -1073,6 +1019,7 @@ public class MainWindowController {
public void handle(ActionEvent event){
cloudSync = true;
//TODO rework for other cloud services
// CloudService service = CloudService.GoogleDrive;
cloudService = "GoogleDrive";
// start cloud sync in new thread
@ -1086,10 +1033,10 @@ public class MainWindowController {
} else {
cloudSyncToggleBtn.setSelected(false);
//cloud sync init error dialog
JFXInfoDialog cloudSyncErrorDialog = new JFXInfoDialog(cloudSyncErrorHeadingText,
cloudSyncErrorBodyText, dialogBtnStyle, 450, 170, main.getPane());
cloudSyncErrorDialog.show();
// cloud sync init error dialog
JFXInfoAlert cloudSyncErrorDialog = new JFXInfoAlert(cloudSyncErrorHeadingText,
cloudSyncErrorBodyText, dialogBtnStyle, main.getPrimaryStage());
cloudSyncErrorDialog.showAndWait();
}
}
@ -1113,13 +1060,13 @@ public class MainWindowController {
}
@FXML
void colorPickerAction(ActionEvent event) {
private void colorPickerAction() {
editColor(colorPicker.getValue().toString());
applyColor();
}
@FXML
void addBtnAction(ActionEvent event) {
private void addBtnAction() {
String headingText = addGameBtnHeadingText;
String bodyText = addGameBtnBodyText;
JFXEditGameDialog addGameDialog = new JFXEditGameDialog(headingText, bodyText, dialogBtnStyle, 450, 300, 0,
@ -1141,20 +1088,14 @@ public class MainWindowController {
LOGGER.info("No parameter set!");
//addGame error dialog
JFXInfoDialog errorDialog = new JFXInfoDialog(addBtnReturnErrorHeadingText, addBtnReturnErrorBodyText,
dialogBtnStyle, 350, 170, main.getPane());
errorDialog.show();
JFXInfoAlert errorDialog = new JFXInfoAlert(addBtnReturnErrorHeadingText, addBtnReturnErrorBodyText,
dialogBtnStyle, main.getPrimaryStage());
errorDialog.showAndWait();
} else {
File pictureCache;
File pictureCache = main.getPictureCache();
String coverName = new File(coverPath).getName();
try {
if (System.getProperty("os.name").equals("Linux")) {
pictureCache = getPictureCacheLinux();
} else {
pictureCache = getPictureCacheWin();
}
BufferedImage originalImage = ImageIO.read(new File(coverPath)); //load cover
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
BufferedImage resizeImagePNG = resizeImage(originalImage, type, 400, 600);
@ -1293,15 +1234,39 @@ public class MainWindowController {
games.add(uiROMElement);
}
// add all games saved in games(ArrayList) to gamesAnchorPane
void addUIData() {
for (int i = 0; i < games.size(); i++) {
gamesAnchorPane.getChildren().add(games.get(i).getVBox());
/**
* reload all ROMs from the ROM directory
*/
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
void refreshUIData() {
public void refreshUIData() {
//remove all games form gamesAnchorPane
gamesAnchorPane.getChildren().removeAll(gamesAnchorPane.getChildren());
@ -1319,6 +1284,7 @@ public class MainWindowController {
}
}
// set the selected local strings to all needed elements
void setUILanguage(){
switch(getLanguage()){
case "en_US":
@ -1401,6 +1367,7 @@ public class MainWindowController {
smmdbDownloadBtnDownload = bundle.getString("smmdbDownloadBtnDownload");
}
// if AutoUpdate, then check for updates
private void checkAutoUpdate() {
if (isAutoUpdate()) {
@ -1542,16 +1509,7 @@ public class MainWindowController {
* calculates how many games can be displayed in one row
*/
private void generatePosition() {
int xPosHelperMax;
/**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);
}
int xPosHelperMax = (int) Math.floor((mainAnchorPane.getWidth() - 36) / 217);
if(xPosHelper == xPosHelperMax){
oldXPosHelper = xPosHelper;
@ -1562,14 +1520,9 @@ public class MainWindowController {
xPos = xPos + 217;
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() {
String boxStyle = "-fx-background-color: #"+getColor()+";";
String btnStyleBlack = "-fx-button-type: RAISED; -fx-background-color: #"+getColor()+"; -fx-text-fill: BLACK;";
@ -1603,6 +1556,7 @@ public class MainWindowController {
reloadRomsBtn.setGraphic(cached_white);
smmdbBtn.setGraphic(smmdb_white);
menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerW");
} else {
dialogBtnStyle = btnStyleBlack;
@ -1625,6 +1579,7 @@ public class MainWindowController {
reloadRomsBtn.setGraphic(cached_black);
smmdbBtn.setGraphic(smmdb_black);
menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerB");
}
@ -1633,12 +1588,15 @@ public class MainWindowController {
}
}
public void saveSettings(){
/**
* save settings to the config.xml file
*/
public void saveSettings() {
LOGGER.info("saving Settings ...");
OutputStream outputStream; //new output-stream
try {
props.setProperty("cemuPath", getCemuPath());
props.setProperty("romPath", getRomPath());
props.setProperty("romPath", getRomDirectoryPath());
props.setProperty("color", getColor());
props.setProperty("language", getLanguage());
props.setProperty("fullscreen", String.valueOf(isFullscreen()));
@ -1654,12 +1612,9 @@ public class MainWindowController {
props.setProperty("lastLocalSync", String.valueOf(getLastLocalSync()));
props.setProperty("windowWidth", String.valueOf(mainAnchorPane.getWidth()));
props.setProperty("windowHeight", String.valueOf(mainAnchorPane.getHeight()));
if(System.getProperty("os.name").equals("Linux")){
outputStream = new FileOutputStream(configFileLinux);
}else{
outputStream = new FileOutputStream(configFileWin);
}
props.storeToXML(outputStream, "cemu_UI settings"); //write new .xml
OutputStream outputStream = new FileOutputStream(main.getConfigFile()); // new output-stream
props.storeToXML(outputStream, "cemu_UI settings"); // write new .xml
outputStream.close();
LOGGER.info("saving Settings done!");
} catch (IOException e) {
@ -1671,16 +1626,11 @@ public class MainWindowController {
* loading saved settings from the config.xml file
* if a value is not present, default is used instead
*/
private void loadSettings(){
private void loadSettings() {
LOGGER.info("loading settings ...");
InputStream inputStream;
try {
if(System.getProperty("os.name").equals("Linux")){
inputStream = new FileInputStream(configFileLinux);
}else{
inputStream = new FileInputStream(configFileWin);
}
props.loadFromXML(inputStream); //new input-stream from .xml
InputStream inputStream = new FileInputStream(main.getConfigFile());
props.loadFromXML(inputStream); // new input-stream from .xml
try {
setCemuPath(props.getProperty("cemuPath"));
@ -1690,10 +1640,10 @@ public class MainWindowController {
}
try {
setRomPath(props.getProperty("romPath"));
setRomDirectoryPath(props.getProperty("romPath"));
} catch (Exception e) {
LOGGER.error("could not load romPath", e);
setRomPath("");
setRomDirectoryPath("");
}
try {
@ -1854,6 +1804,18 @@ public class MainWindowController {
return resizedImage;
}
public Main getMain() {
return main;
}
public DBController getDbController() {
return dbController;
}
public void setMainAnchorPane(AnchorPane mainAnchorPane) {
this.mainAnchorPane = mainAnchorPane;
}
public String getCemuPath() {
return cemuPath;
}
@ -1862,12 +1824,12 @@ public class MainWindowController {
this.cemuPath = cemuPath;
}
public String getRomPath() {
return romPath;
public String getRomDirectoryPath() {
return romDirectoryPath;
}
public void setRomPath(String romPath) {
this.romPath = romPath;
public void setRomDirectoryPath(String romDirectoryPath) {
this.romDirectoryPath = romDirectoryPath;
}
public String getColor() {
@ -1878,22 +1840,6 @@ public class MainWindowController {
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() {
return xPos;
}

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.application;
import java.io.IOException;
@ -33,19 +32,20 @@ import javafx.application.Platform;
public class playGame extends Thread{
MainWindowController mainWindowController;
DBController dbController;
private MainWindowController mainWindowController;
private DBController dbController;
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;
dbController = db;
}
@Override
public void run(){
public void run() {
String selectedGameTitleID = mainWindowController.getSelectedGameTitleID();
String executeComand;
String cemuBin = mainWindowController.getCemuPath() + "/Cemu.exe";
String gameExec = "\"" + mainWindowController.getGameExecutePath() + "\"";
long startTime;
long endTime;
int timePlayedNow;
@ -53,52 +53,50 @@ public class playGame extends Thread{
Process p;
Platform.runLater(() -> {
mainWindowController.main.getPrimaryStage().setIconified(true); // minimize cemu_UI
mainWindowController.getMain().getPrimaryStage().setIconified(true); // minimize cemu_UI
});
startTime = System.currentTimeMillis();
try{
try {
if (System.getProperty("os.name").equals("Linux")) {
if(mainWindowController.isFullscreen()){
if(System.getProperty("os.name").equals("Linux")){
executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\"";
p = new ProcessBuilder("wine", cemuBin, "-f", "-g", gameExec).start();
} else {
executeComand = mainWindowController.getCemuPath()+"\\Cemu.exe -f -g \""+mainWindowController.getGameExecutePath()+"\"";
p = new ProcessBuilder("wine", cemuBin, "-g", gameExec).start();
}
}else{
if(System.getProperty("os.name").equals("Linux")){
executeComand = "wine "+mainWindowController.getCemuPath()+"/Cemu.exe -g \""+mainWindowController.getGameExecutePath()+"\"";
} else {
executeComand = mainWindowController.getCemuPath()+"\\Cemu.exe -g \""+mainWindowController.getGameExecutePath()+"\"";
if(mainWindowController.isFullscreen()){
p = new ProcessBuilder(cemuBin, "-f", "-g", gameExec).start();
} else {
p = new ProcessBuilder(cemuBin, "-g", gameExec).start();
}
}
LOGGER.info(executeComand);
p = Runtime.getRuntime().exec(executeComand);
p.waitFor();
p.waitFor(); // wait until cemu is closed so we can calculate the played time
endTime = System.currentTimeMillis();
timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60));
timePlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))+timePlayedNow;
dbController.setTotalPlaytime(Integer.toString(timePlayed), selectedGameTitleID);
Platform.runLater(() -> {
if(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;
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed+"h "+minutesPlayed+"min");
}else{
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID)+ " min");
if (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;
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed + "h " + minutesPlayed + "min");
} else {
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID) + " min");
}
mainWindowController.main.getPrimaryStage().setIconified(false); // maximize cemu_UI
mainWindowController.getMain().getPrimaryStage().setIconified(false); // maximize cemu_UI
});
//sync savegame with cloud service
if (mainWindowController.isCloudSync()) {
mainWindowController.setLastLocalSync(Instant.now().getEpochSecond());
mainWindowController.main.getCloudController().sync(mainWindowController.getCloudService(),
mainWindowController.getCemuPath(), mainWindowController.main.getDirectory().getPath());
mainWindowController.getMain().getCloudController().sync(mainWindowController.getCloudService(),
mainWindowController.getCemuPath(), mainWindowController.getMain().getDirectory().getPath());
}
}catch (IOException | InterruptedException e){
e.printStackTrace();
} catch (IOException | InterruptedException e) {
LOGGER.error(e);
}
}

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.controller;
import java.io.File;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.controller;
import java.awt.Graphics2D;
@ -45,14 +44,17 @@ import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.cemu_UI.application.Main;
import com.cemu_UI.application.MainWindowController;
public class DBController {
public DBController(MainWindowController mwc) {
mainWindowController = mwc;
public DBController(Main main, MainWindowController mainWindowController) {
this.main = main;
this.mainWindowController = mainWindowController;
}
private Main main;
private MainWindowController mainWindowController;
private ArrayList<String> entries = new ArrayList<>();
private String DB_PATH_localRoms;
@ -66,14 +68,12 @@ public class DBController {
* load ROM and games database
* load all games
*/
public void init(){
LOGGER.info("<==========starting loading sql==========>");
public void init() {
LOGGER.info("<========== starting loading sql ==========>");
loadRomDatabase();
loadGamesDatabase();
createRomDatabase();
loadAllGames();
checkRemoveEntry();
LOGGER.info("<==========finished loading sql==========>");
LOGGER.info("<========== finished loading sql ==========>");
}
/**
@ -81,18 +81,18 @@ public class DBController {
*
* TODO this should be called LocalGames
*/
private void loadRomDatabase(){
private void loadRomDatabase() {
if (System.getProperty("os.name").equals("Linux")) {
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";
}
try {
// create a database connection
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) {
// 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.info("ROM database loaded successfull");
@ -100,16 +100,10 @@ public class DBController {
/**
* set the path to the localRoms.db file and initialize the connection
*
* games.dbcontains a reverence list to for the automatic detection mode
* TODO rework paths
* games.db contains a reverence list to for the automatic detection mode
*/
private void loadGamesDatabase() {
if (System.getProperty("os.name").equals("Linux")) {
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";
}
DB_PATH_games = main.getReference_gamesFile().getAbsolutePath();
try {
// create a database connection
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);
}
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{
Statement stmt = connection.createStatement();
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");
}
// remove a game from the database
public void removeGame(String titleID) throws SQLException{
Statement stmt = connection.createStatement();
stmt.executeUpdate("delete from local_roms where titleID = '"+titleID+"'");
@ -171,8 +169,8 @@ public class DBController {
LOGGER.info("removed \""+titleID+"\" from ROM database");
}
//load all ROMs on startup to the mainWindowController
void loadAllGames(){
//load all ROMs to the mainWindowController
public void loadAllGames(){
LOGGER.info("loading all games on startup into the mainWindowController ...");
try {
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){
LOGGER.info("loading a single game (ID: "+titleID+") into the mainWindowController ...");
try {
@ -211,18 +209,12 @@ public class DBController {
File dir = new File(directory);
File appFile;
String[] extensions = new String[] { "rpx", "jsp" };
File pictureCache;
File pictureCache = main.getPictureCache();
String coverPath;
if(System.getProperty("os.name").equals("Linux")){
pictureCache = mainWindowController.getPictureCacheLinux();
}else{
pictureCache = mainWindowController.getPictureCacheWin();
}
try {
Statement stmt = connectionGames.createStatement();
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");
// for all files in dir get the app.xml
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
while (rs.next()) {
if (checkEntry(rs.getString(2))) {
if (checkAddEntry(rs.getString(2))) {
LOGGER.info(rs.getString(2) + ": game already in database");
} else {
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) {
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();
boolean check = false;
ResultSet rs = stmt.executeQuery("SELECT * FROM local_roms WHERE title = '"+title+"';");
@ -268,6 +267,7 @@ public class DBController {
return check;
}
@SuppressWarnings("unused")
private void checkRemoveEntry() {
/**
* TODO needs to be implemented!

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.controller;
import java.io.BufferedReader;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.controller;
import java.io.BufferedReader;
@ -59,8 +58,7 @@ public class UpdateController implements Runnable {
private static final Logger LOGGER = LogManager.getLogger(UpdateController.class.getName());
/**
* updater for cemu_UI based on Project HomeFlix checks for Updates and download
* it in case there is one
* updater for cemu_UI, checks for Updates and download it
*/
public UpdateController(MainWindowController mwc, String buildNumber, boolean useBeta) {
mainWindowController = mwc;
@ -149,7 +147,7 @@ public class UpdateController implements Runnable {
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.deleteQuietly(new File("cemu_UI_update.jar")); // delete update
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); // start again
new ProcessBuilder("java", "-jar", "cemu_UI.jar").start(); // start the new application
System.exit(0); // finishes itself
} catch (IOException e) {
Platform.runLater(() -> {

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.datatypes;
import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.datatypes;
import javafx.beans.property.IntegerProperty;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.datatypes;
import com.jfoenix.controls.JFXButton;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.uiElements;
import java.io.File;
@ -119,8 +117,8 @@ public class JFXEditGameDialog {
// addGame error dialog
String headingTextError = mwc.getBundle().getString("editGameDialogHeadingTextError");
String bodyTextError = mwc.getBundle().getString("editGameDialogBodyTextError");
JFXInfoDialog errorDialog = new JFXInfoDialog(headingTextError, bodyTextError, dialogBtnStyle, 350,170, pane);
errorDialog.show();
JFXInfoAlert errorDialog = new JFXInfoAlert(headingTextError, bodyTextError, dialogBtnStyle, stage);
errorDialog.showAndWait();
} else {
switch (mode) {
case 0:

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
* Kellerkinder Framework Alerts
*
* Copyright 2017 <@Seil0>
* Copyright 2018 <@Seil0>
*
* 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
@ -18,69 +18,94 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.uiElements;
import com.jfoenix.controls.JFXAlert;
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXDialog;
import com.jfoenix.controls.JFXDialogLayout;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class JFXInfoDialog {
public class JFXInfoAlert {
private String headingText;
private String bodyText;
private String dialogBtnStyle;
private int dialogWidth;
private int dialogHeight;
private Pane pane;
private String btnStyle;
private Stage stage;
/**
* Creates a new JFoenix Dialog to show some information
* @param headingText Heading Text, just the heading
* @param bodyText body Text, all other text belongs here
* @param dialogBtnStyle Style of the okay button
* @param dialogWidth dialog width
* @param dialogHeight dialog height
* @param pane pane to which the dialog belongs
* Creates a new JFoenix Alert to show some information
* @param headerText Heading text of the alert
* @param bodyText Content text of the alert
* @param btnStyle Style of the okay button
* @param stage stage to which the dialog belongs
*/
public JFXInfoDialog(String headingText, String bodyText, String dialogBtnStyle, int dialogWidth, int dialogHeight, Pane pane) {
this.headingText = headingText;
this.bodyText = bodyText;
this.dialogBtnStyle = dialogBtnStyle;
this.dialogWidth = dialogWidth;
this.dialogHeight = dialogHeight;
this.pane = pane;
public JFXInfoAlert(String headingText, String bodyText, String btnStyle, Stage stage) {
setHeadingText(headingText);
setBodyText(bodyText);
setBtnStyle(btnStyle);
setStage(stage);
}
public void show() {
JFXDialogLayout content = new JFXDialogLayout();
content.setHeading(new Text(headingText));
content.setBody(new Text(bodyText));
content.setPrefSize(dialogWidth, dialogHeight);
StackPane stackPane = new StackPane();
stackPane.autosize();
JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
public JFXInfoAlert() {
// Auto-generated constructor stub
}
public void showAndWait( ) {
JFXAlert<Void> alert = new JFXAlert<>(stage);
JFXButton button = new JFXButton("Okay");
button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
dialog.close();
alert.close();
}
});
button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
button.setPrefHeight(32);
button.setStyle(dialogBtnStyle);
button.setStyle(btnStyle);
JFXDialogLayout content = new JFXDialogLayout();
content.setActions(button);
pane.getChildren().add(stackPane);
AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
dialog.show();
content.setHeading(new Text(headingText));
content.setBody(new Text(bodyText));
alert.setContent(content);
alert.showAndWait();
}
public String getHeadingText() {
return headingText;
}
public void setHeadingText(String headingText) {
this.headingText = headingText;
}
public String getBodyText() {
return bodyText;
}
public void setBodyText(String bodyText) {
this.bodyText = bodyText;
}
public String getBtnStyle() {
return btnStyle;
}
public void setBtnStyle(String btnStyle) {
this.btnStyle = btnStyle;
}
public Stage getStage() {
return stage;
}
public void setStage(Stage stage) {
this.stage = stage;
}
}

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.uiElements;
import java.util.ResourceBundle;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.uiElements;
import com.jfoenix.controls.JFXButton;

View File

@ -1,7 +1,7 @@
/**
* cemu_UI
*
* Copyright 2017 <@Seil0>
* Copyright 2017-2018 <@Seil0>
*
* 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
@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package com.cemu_UI.vendorCloudController;
import java.io.FileOutputStream;

View File

@ -81,6 +81,38 @@
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
-fx-background-insets: -1.4, 0, 1;
-fx-background-radius: 1.4, 0, 0;
/*....*/
-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;
}

View File

@ -18,7 +18,7 @@
<?import javafx.scene.text.Font?>
<?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">
<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">
<content>
@ -91,12 +91,12 @@
<Insets left="-14.0" />
</padding>
</VBox>
<VBox spacing="10.0">
<VBox spacing="7.0">
<children>
<Label fx:id="cemuDirectoryLbl" text="Cemu Directory" />
<HBox spacing="10.0">
<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" />
</children>
</HBox>
@ -105,12 +105,12 @@
<Insets right="5.0" />
</padding>
</VBox>
<VBox spacing="10.0">
<VBox spacing="7.0">
<children>
<Label fx:id="romDirectoryLbl" text="Rom Directory" />
<HBox spacing="10.0">
<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" />
</children>
</HBox>
@ -213,14 +213,14 @@
</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">
<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 fx:id="playBtn" buttonType="RAISED" maxHeight="28.0" minWidth="100.0" onAction="#playBtnAction" ripplerFill="#00aacc" text="play" textAlignment="CENTER">
<font>
<Font name="System Bold" size="14.0" />
</font>
</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>
</HBox>
</children>

View File

@ -1,4 +1,4 @@
#HomeFlix-Local_de_DE.properties geramn Local
#HomeFlix-Local_de_DE.properties DE-Deutsch Local
# Buttons
aboutBtn = \u00dcber
@ -46,7 +46,7 @@ licensesLblBodyText = cemu_UI ist lizensiert unter der GNU GPL 3.\n\nJFoenix, Ap
showLicenses = Lizenzen \u00f6ffnen
aboutBtnHeadingText = cemu_UI
aboutBtnBodyText = Diese Programm wurde mit freier Software erstellt\nund ist lizensiert unter der GNU GPL 3.\n\nwww.kellerkinder.xyz
aboutBtnBodyText = Diese Programm wurde mit freier Software erstellt\nund ist lizensiert unter der GNU GPL 3.\n\nwww.mosad.xyz
cloudSyncWaringHeadingText = Spielst\u00e4nde über die Cloud syncronisieren (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!

View File

@ -2,7 +2,7 @@
# Buttons
aboutBtn = About
settingsBtn = Setting
settingsBtn = Settings
addBtn = Add new Game
reloadRomsBtn = reload ROMs
smmdbBtn = smmdb
@ -33,7 +33,7 @@ timeColumn = time
# Strings
editHeadingText = edit
editBodyText = You can edit the tile and rom/cover path.
editBodyText = You can edit the tile and ROM/cover path.
removeHeadingText = remove
removeBodyText = Are you sure you want to delete
addUpdateHeadingText = update
@ -46,18 +46,18 @@ licensesLblBodyText = cemu_UI is licensed under the terms of GNU GPL 3.\n\nJFoen
showLicenses = show licenses
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.mosad.xyz
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!
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
addGameBtnBodyText =
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,
today = today
yesterday = yesterday
@ -82,6 +82,6 @@ titleID = title ID
romPath = ROM path
coverPath = cover path
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
editGameDialogSelectCoverBtn = select cover file

View File

@ -1,8 +1,5 @@
package com.cemu_UI.test;
import java.io.File;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@ -24,8 +21,7 @@ public class AppTest extends TestCase {
@SuppressWarnings("unused")
private void testClientsSecret() {
File client_secret = new File("/client_secret.json");
Assert.assertTrue(client_secret.exists());
}
/**