log contains some infos about the currect system now

such as os version java re version
This commit is contained in:
Jannik 2017-12-11 15:51:04 +01:00
parent 02d7cb6a3e
commit a1bab241b6
3 changed files with 69 additions and 26 deletions

View File

@ -56,9 +56,16 @@ public class Main extends Application {
CloudController cloudController;
AnchorPane pane;
Scene scene; // TODO make private
private String dirWin = System.getProperty("user.home") + "/Documents/cemu_UI"; // Windows: C:/Users/"User"/Documents/cemu_UI
private String dirLinux = System.getProperty("user.home") + "/cemu_UI"; // Linux: /home/"User"/cemu_UI
private static String userHome = System.getProperty("user.home");
private static String userName = System.getProperty("user.name");
private static String osName = System.getProperty("os.name");
private static String osArch = System.getProperty("os.arch");
private static String osVers = System.getProperty("os.version");
private static String javaVers = System.getProperty("java.version");
private static String javaVend= System.getProperty("java.vendor");
private String gamesDBdownloadURL = "https://github.com/Seil0/cemu_UI/raw/master/downloadContent/games.db";
public String dirWin = userHome + "/Documents/cemu_UI"; // Windows: C:/Users/"User"/Documents/cemu_UI
public String dirLinux = userHome + "/cemu_UI"; // Linux: /home/"User"/cemu_UI
private File directory;
private File configFile;
private File gamesDBFile;
@ -70,6 +77,9 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
LOGGER.info("OS: " + osName + " " + osVers + " " + osArch);
LOGGER.info("Java: " + javaVend + " " + javaVers);
LOGGER.info("User: " + userName + " " + userHome);
this.primaryStage = primaryStage;
mainWindow();
initActions();
@ -92,7 +102,7 @@ public class Main extends Application {
cloudController = new CloudController(mainWindowController); // call cloudController constructor
// get OS and the specific paths
if (System.getProperty("os.name").equals("Linux")) {
if (osName.equals("Linux")) {
directory = new File(dirLinux);
configFile = new File(dirLinux + "/config.xml");
gamesDBFile = new File(dirLinux + "/games.db");
@ -118,8 +128,6 @@ public class Main extends Application {
alert.showAndWait();
}
LOGGER.info("Directory: " + directory.exists());
LOGGER.info("Configfile: " + configFile.exists());
if (!directory.exists()) {
LOGGER.info("creating cemu_UI directory");
directory.mkdir();
@ -283,13 +291,13 @@ public class Main extends Application {
public static void main(String[] args) {
// delete old log file and create new
if(System.getProperty("os.name").equals("Linux")){
System.setProperty("logFilename", System.getProperty("user.home") + "/cemu_UI/app.log");
File logFile = new File(System.getProperty("user.home") + "/cemu_UI/app.log");
if(osName.equals("Linux")){
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
File logFile = new File(userHome + "/cemu_UI/app.log");
logFile.delete();
}else{
System.setProperty("logFilename", System.getProperty("user.home") + "/Documents/cemu_UI/app.log");
File logFile = new File(System.getProperty("user.home") + "/Documents/cemu_UI/app.log");
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
logFile.delete();
}
LOGGER = LogManager.getLogger(Main.class.getName());

View File

@ -971,6 +971,7 @@ public class MainWindowController {
File smmDirectory = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(i));
if (smmDirectory.exists()) {
LOGGER.info("found smm directory: " + smmDirectory.getAbsolutePath());
File[] courses = smmDirectory.listFiles(File::isDirectory);
// get all existing courses in smm directory, new name is highest number +1

View File

@ -10,6 +10,7 @@
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
@ -64,17 +65,32 @@
<ScrollPane fx:id="settingsScrollPane" prefHeight="562.0" prefWidth="729.0" style="-fx-background: white;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="175.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<content>
<!-- space between settings sections 35px, between sections elements (label + element) 20px, between label and element 3px(or more) -->
<AnchorPane fx:id="settingsAnchorPane" prefHeight="607.0" prefWidth="511.0" style="-fx-background-color: white;">
<AnchorPane fx:id="settingsAnchorPane" prefHeight="686.0" prefWidth="711.0" style="-fx-background-color: white;">
<children>
<VBox spacing="30.0">
<VBox spacing="30.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<VBox prefHeight="485.0" prefWidth="563.0" spacing="25.0">
<VBox prefHeight="485.0" prefWidth="710.0" spacing="25.0">
<children>
<Label fx:id="cemu_UISettingsLbl" text="cemu_UI Settings">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
<VBox prefHeight="21.0" prefWidth="676.0">
<children>
<Label fx:id="cemu_UISettingsLbl" text="cemu_UI Settings">
<font>
<Font name="System Bold" size="14.0" />
</font>
<VBox.margin>
<Insets />
</VBox.margin>
</Label>
<Separator prefWidth="200.0">
<padding>
<Insets right="5.0" />
</padding>
</Separator>
</children>
<padding>
<Insets left="-14.0" />
</padding>
</VBox>
<VBox spacing="10.0">
<children>
<Label fx:id="cemuDirectoryLbl" text="Cemu Directory" />
@ -85,6 +101,9 @@
</children>
</HBox>
</children>
<padding>
<Insets right="5.0" />
</padding>
</VBox>
<VBox spacing="10.0">
<children>
@ -119,21 +138,36 @@
</VBox>
</children>
<padding>
<Insets left="14.0" />
<Insets left="24.0" />
</padding>
</VBox>
<VBox spacing="25.0">
<children>
<Label fx:id="cemuSettingsLbl" text="Cemu Settings">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
<JFXToggleButton fx:id="fullscreenToggleBtn" onAction="#fullscreenToggleBtnAction" text="start game in fullscreen" />
<VBox>
<children>
<Label fx:id="cemuSettingsLbl" text="Cemu Settings">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
<Separator prefWidth="200.0">
<padding>
<Insets right="5.0" />
</padding>
</Separator>
</children>
<padding>
<Insets left="-14.0" />
</padding>
</VBox>
<JFXToggleButton fx:id="fullscreenToggleBtn" onAction="#fullscreenToggleBtnAction" text="start game in fullscreen">
<VBox.margin>
<Insets top="-10.0" />
</VBox.margin></JFXToggleButton>
<Label fx:id="licensesLbl" text="Licenses" />
</children>
<padding>
<Insets left="14.0" />
<Insets left="24.0" />
</padding>
</VBox>
</children>