diff --git a/.classpath b/.classpath
index e322647..4959c4e 100644
--- a/.classpath
+++ b/.classpath
@@ -23,5 +23,7 @@
+
+
diff --git a/bin/.gitignore b/bin/.gitignore
index 0a416df..18b70ca 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,3 +1,3 @@
/application/
-/datatypes/
-/libraries/
+/resources/
+/log4j2.xml
diff --git a/bin/application/Main.class b/bin/application/Main.class
index 6c1cc1a..c61144c 100644
Binary files a/bin/application/Main.class and b/bin/application/Main.class differ
diff --git a/bin/application/MainWindowController$1.class b/bin/application/MainWindowController$1.class
index 5a1b4a7..0d34ffc 100644
Binary files a/bin/application/MainWindowController$1.class and b/bin/application/MainWindowController$1.class differ
diff --git a/bin/application/MainWindowController$10.class b/bin/application/MainWindowController$10.class
index 439d001..2f90ac0 100644
Binary files a/bin/application/MainWindowController$10.class and b/bin/application/MainWindowController$10.class differ
diff --git a/bin/application/MainWindowController$11.class b/bin/application/MainWindowController$11.class
index f0306e1..ffb01c2 100644
Binary files a/bin/application/MainWindowController$11.class and b/bin/application/MainWindowController$11.class differ
diff --git a/bin/application/MainWindowController$12.class b/bin/application/MainWindowController$12.class
index c8ef48f..702260a 100644
Binary files a/bin/application/MainWindowController$12.class and b/bin/application/MainWindowController$12.class differ
diff --git a/bin/application/MainWindowController$2.class b/bin/application/MainWindowController$2.class
index ba9ecd6..5d9fdc8 100644
Binary files a/bin/application/MainWindowController$2.class and b/bin/application/MainWindowController$2.class differ
diff --git a/bin/application/MainWindowController$3.class b/bin/application/MainWindowController$3.class
index 87abca3..5a1b882 100644
Binary files a/bin/application/MainWindowController$3.class and b/bin/application/MainWindowController$3.class differ
diff --git a/bin/application/MainWindowController$4.class b/bin/application/MainWindowController$4.class
index 43cc472..cc7c3c3 100644
Binary files a/bin/application/MainWindowController$4.class and b/bin/application/MainWindowController$4.class differ
diff --git a/bin/application/MainWindowController$5.class b/bin/application/MainWindowController$5.class
index 516c942..e4d7831 100644
Binary files a/bin/application/MainWindowController$5.class and b/bin/application/MainWindowController$5.class differ
diff --git a/bin/application/MainWindowController$6.class b/bin/application/MainWindowController$6.class
index 6196736..44f5e34 100644
Binary files a/bin/application/MainWindowController$6.class and b/bin/application/MainWindowController$6.class differ
diff --git a/bin/application/MainWindowController$7.class b/bin/application/MainWindowController$7.class
index b8ae180..5c179a1 100644
Binary files a/bin/application/MainWindowController$7.class and b/bin/application/MainWindowController$7.class differ
diff --git a/bin/application/MainWindowController$8.class b/bin/application/MainWindowController$8.class
index 9ebc86b..0b2559a 100644
Binary files a/bin/application/MainWindowController$8.class and b/bin/application/MainWindowController$8.class differ
diff --git a/bin/application/MainWindowController$9.class b/bin/application/MainWindowController$9.class
index 656851c..6a6cb29 100644
Binary files a/bin/application/MainWindowController$9.class and b/bin/application/MainWindowController$9.class differ
diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class
index 39e1810..83521de 100644
Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ
diff --git a/bin/libraries/log4j-api-2.8.2.jar b/bin/libraries/log4j-api-2.8.2.jar
new file mode 100644
index 0000000..9694c29
Binary files /dev/null and b/bin/libraries/log4j-api-2.8.2.jar differ
diff --git a/bin/libraries/log4j-core-2.8.2.jar b/bin/libraries/log4j-core-2.8.2.jar
new file mode 100644
index 0000000..eb658af
Binary files /dev/null and b/bin/libraries/log4j-core-2.8.2.jar differ
diff --git a/src/application/Main.java b/src/application/Main.java
index 7fa8ddc..bf653a5 100644
--- a/src/application/Main.java
+++ b/src/application/Main.java
@@ -21,6 +21,8 @@ import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Optional;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.DirectoryChooser;
@@ -48,7 +50,7 @@ public class Main extends Application {
@SuppressWarnings("unused")
private File localDB;
private File pictureCache;
-
+ private static final Logger LOGGER = LogManager.getLogger(Main.class.getName());
@Override
public void start(Stage primaryStage) {
@@ -88,7 +90,8 @@ public class Main extends Application {
//startup checks
//check if client_secret.jason is present
if (Main.class.getResourceAsStream("/resources/client_secret.json") == null) {
- System.err.println("client_secret is missing!!!!!");
+ LOGGER.error("client_secret is missing!!!!!");
+// System.err.println("client_secret is missing!!!!!");
Alert alert = new Alert(AlertType.ERROR);
alert.setTitle("cemu_UI");
@@ -97,22 +100,26 @@ public class Main extends Application {
alert.showAndWait();
}
- System.out.println("Directory: " + directory.exists());
- System.out.println("configfile: " + configFile.exists());
- if(directory.exists() != true){
- System.out.println("mkdir all");
+ LOGGER.info("Directory: " + directory.exists());
+ LOGGER.info("Configfile: " + configFile.exists());
+// System.out.println("Directory: " + directory.exists());
+// System.out.println("configfile: " + configFile.exists());
+ if(!directory.exists()){
+ LOGGER.info("creating cemu_UI directory");
+// System.out.println("mkdir all");
directory.mkdir();
pictureCache.mkdir();
}
- if(configFile.exists() != true){
- System.out.println("firststart");
+ if(!configFile.exists()){
+ LOGGER.info("firststart, setting default values");
+// System.out.println("firststart");
firstStart();
mainWindowController.setColor("00a8cc");
mainWindowController.setxPosHelper(0);
mainWindowController.saveSettings();
Runtime.getRuntime().exec("java -jar cemu_UI.jar"); //start again (preventing Bugs)
- System.exit(0); //finishes itself
+ System.exit(0); //finishes itselfdownloading games.db...
}
if(pictureCache.exists() != true){
@@ -121,13 +128,15 @@ public class Main extends Application {
if(gamesDBFile.exists() != true){
try {
- System.out.print("downloading games.db... ");
+ LOGGER.info("downloading games.db... ");
+// System.out.print("downloading games.db... ");
URL website = new URL(gamesDBdownloadURL);
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(gamesDBFile);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
- System.out.println("done!");
+ LOGGER.info("finished downloading games.db");
+// System.out.println("done!");
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java
index 8ddc456..fc82318 100644
--- a/src/application/MainWindowController.java
+++ b/src/application/MainWindowController.java
@@ -40,6 +40,8 @@ import javax.swing.ProgressMonitor;
import javax.swing.ProgressMonitorInputStream;
import org.apache.commons.io.FileUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXColorPicker;
@@ -211,19 +213,19 @@ public class MainWindowController {
private String cemuPath;
private String romPath;
private String gameExecutePath;
- private String selectedGameTitleID;
- private String selectedGameTitle;
private String color;
private String dialogBtnStyle;
+ private String selectedGameTitleID;
+ private String selectedGameTitle;
+ private String id;
private String version = "0.1.6";
- private String buildNumber = "035";
+ private String buildNumber = "037";
private String versionName = "Throwback Galaxy";
private int xPos = -200;
private int yPos = 17;
private int xPosHelper;
private int selectedUIDataIndex;
private int selected;
- private String id;
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");
@@ -238,6 +240,7 @@ public class MainWindowController {
ArrayList nameText = new ArrayList();
Properties props = new Properties();
Properties gameProps = new Properties();
+ private static final Logger LOGGER = LogManager.getLogger(MainWindowController.class.getName());
private MenuItem edit = new MenuItem("edit");
private MenuItem remove = new MenuItem("remove");
private MenuItem update = new MenuItem("update");
@@ -297,7 +300,8 @@ public class MainWindowController {
* initialize all actions not initialized by a own method
*/
void initActions() {
- System.out.println("initializing Actions... ");
+ LOGGER.info("initializing Actions... ");
+// System.out.println("initializing Actions... ");
HamburgerBackArrowBasicTransition burgerTask = new HamburgerBackArrowBasicTransition(menuHam);
menuHam.addEventHandler(MouseEvent.MOUSE_PRESSED, (e)->{
@@ -568,8 +572,8 @@ public class MainWindowController {
}
}
});
-
- System.out.println("initializing Actions done!");
+ LOGGER.info("initializing Actions done!");
+// System.out.println("initializing Actions done!");
}
@FXML
@@ -1264,7 +1268,8 @@ public class MainWindowController {
}
void saveSettings(){
- System.out.print("saving Settings... ");
+ LOGGER.info("saving Settings...");
+// System.out.print("saving Settings... ");
OutputStream outputStream; //new output-stream
try {
props.setProperty("cemuPath", getCemuPath());
@@ -1285,14 +1290,17 @@ public class MainWindowController {
}
props.storeToXML(outputStream, "cemu_UI settings"); //write new .xml
outputStream.close();
- System.out.println("done!");
+ LOGGER.info("saving Settings done!");
+// System.out.println("done!");
} catch (IOException e) {
- e.printStackTrace();
+ LOGGER.error("an error occured", e);
+// e.printStackTrace();
}
}
void loadSettings(){
- System.out.print("loading settings... ");
+ LOGGER.info("loading settings...");
+// System.out.print("loading settings... ");
InputStream inputStream;
try {
if(System.getProperty("os.name").equals("Linux")){
@@ -1309,9 +1317,11 @@ public class MainWindowController {
setCloudService(props.getProperty("cloudService"));
main.cloudController.setFolderID(props.getProperty("folderID"), getCloudService());
inputStream.close();
- System.out.println("done!");
+ LOGGER.info("loading settings done!");
+// System.out.println("done!");
} catch (IOException e) {
- e.printStackTrace();
+ LOGGER.error("an error occured", e);
+// e.printStackTrace();
}
}
diff --git a/src/libraries/log4j-api-2.8.2.jar b/src/libraries/log4j-api-2.8.2.jar
new file mode 100644
index 0000000..9694c29
Binary files /dev/null and b/src/libraries/log4j-api-2.8.2.jar differ
diff --git a/src/libraries/log4j-core-2.8.2.jar b/src/libraries/log4j-core-2.8.2.jar
new file mode 100644
index 0000000..eb658af
Binary files /dev/null and b/src/libraries/log4j-core-2.8.2.jar differ
diff --git a/src/log4j2.xml b/src/log4j2.xml
new file mode 100644
index 0000000..b13671c
--- /dev/null
+++ b/src/log4j2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+