minor fixes
* fixed a few typos * fixed window is resiable to 0x0 * * formating work work
This commit is contained in:
parent
54078eb99f
commit
2e3395caea
|
@ -180,6 +180,8 @@ public class Main extends Application {
|
||||||
|
|
||||||
scene = new Scene(pane); // create new scene, append pane to scene
|
scene = new Scene(pane); // create new scene, append pane to scene
|
||||||
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
|
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
|
||||||
|
primaryStage.setMinWidth(265.00);
|
||||||
|
primaryStage.setMinHeight(425.00);
|
||||||
primaryStage.setScene(scene); // append scene to stage
|
primaryStage.setScene(scene); // append scene to stage
|
||||||
primaryStage.show(); // show stage
|
primaryStage.show(); // show stage
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -187,7 +189,7 @@ public class Main extends Application {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void firstStart(){
|
private void firstStart() {
|
||||||
Alert alert = new Alert(AlertType.CONFIRMATION); // new alert with file-chooser
|
Alert alert = new Alert(AlertType.CONFIRMATION); // new alert with file-chooser
|
||||||
alert.setTitle("cemu_UI");
|
alert.setTitle("cemu_UI");
|
||||||
alert.setHeaderText("cemu installation");
|
alert.setHeaderText("cemu installation");
|
||||||
|
@ -293,11 +295,11 @@ public class Main extends Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// delete old log file and create new
|
// delete old log file and create new
|
||||||
if(osName.equals("Linux")){
|
if (osName.equals("Linux")) {
|
||||||
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
|
System.setProperty("logFilename", userHome + "/cemu_UI/app.log");
|
||||||
File logFile = new File(userHome + "/cemu_UI/app.log");
|
File logFile = new File(userHome + "/cemu_UI/app.log");
|
||||||
logFile.delete();
|
logFile.delete();
|
||||||
}else{
|
} else {
|
||||||
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
|
System.setProperty("logFilename", userHome + "/Documents/cemu_UI/app.log");
|
||||||
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
|
File logFile = new File(userHome + "/Documents/cemu_UI/app.log");
|
||||||
logFile.delete();
|
logFile.delete();
|
||||||
|
|
|
@ -1064,24 +1064,24 @@ public class MainWindowController {
|
||||||
cloudService = "GoogleDrive";
|
cloudService = "GoogleDrive";
|
||||||
|
|
||||||
// start cloud sync in new thread
|
// start cloud sync in new thread
|
||||||
Thread thread = new Thread(new Runnable() {
|
Thread thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
if (main.getCloudController().initializeConnection(getCloudService(), getCemuPath())) {
|
|
||||||
main.getCloudController().sync(getCloudService(), getCemuPath(), main.getDirectory().getPath());
|
|
||||||
saveSettings();
|
|
||||||
} else {
|
|
||||||
cloudSyncToggleBtn.setSelected(false);
|
|
||||||
|
|
||||||
//cloud sync init error dialog
|
if (main.getCloudController().initializeConnection(getCloudService(), getCemuPath())) {
|
||||||
|
main.getCloudController().sync(getCloudService(), getCemuPath(), main.getDirectory().getPath());
|
||||||
|
saveSettings();
|
||||||
|
} else {
|
||||||
|
cloudSyncToggleBtn.setSelected(false);
|
||||||
|
|
||||||
|
// cloud sync init error dialog
|
||||||
JFXInfoDialog cloudSyncErrorDialog = new JFXInfoDialog(cloudSyncErrorHeadingText,
|
JFXInfoDialog cloudSyncErrorDialog = new JFXInfoDialog(cloudSyncErrorHeadingText,
|
||||||
cloudSyncErrorBodyText, dialogBtnStyle, 450, 170, main.getPane());
|
cloudSyncErrorBodyText, dialogBtnStyle, 450, 170, main.getPane());
|
||||||
cloudSyncErrorDialog.show();
|
cloudSyncErrorDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,18 +33,17 @@ import javafx.application.Platform;
|
||||||
|
|
||||||
public class playGame extends Thread{
|
public class playGame extends Thread{
|
||||||
|
|
||||||
MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
DBController dbController;
|
private DBController dbController;
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(playGame.class.getName());
|
private static final Logger LOGGER = LogManager.getLogger(playGame.class.getName());
|
||||||
|
|
||||||
public playGame(MainWindowController m, com.cemu_UI.controller.DBController db){
|
public playGame(MainWindowController m, com.cemu_UI.controller.DBController db) {
|
||||||
mainWindowController = m;
|
mainWindowController = m;
|
||||||
dbController = db;
|
dbController = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(){
|
public void run() {
|
||||||
String selectedGameTitleID = mainWindowController.getSelectedGameTitleID();
|
String selectedGameTitleID = mainWindowController.getSelectedGameTitleID();
|
||||||
String cemuBin = mainWindowController.getCemuPath() + "/Cemu.exe";
|
String cemuBin = mainWindowController.getCemuPath() + "/Cemu.exe";
|
||||||
String gameExec = "\"" + mainWindowController.getGameExecutePath() + "\"";
|
String gameExec = "\"" + mainWindowController.getGameExecutePath() + "\"";
|
||||||
|
@ -58,8 +57,7 @@ public class playGame extends Thread{
|
||||||
mainWindowController.main.getPrimaryStage().setIconified(true); // minimize cemu_UI
|
mainWindowController.main.getPrimaryStage().setIconified(true); // minimize cemu_UI
|
||||||
});
|
});
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
try{
|
try {
|
||||||
|
|
||||||
if (System.getProperty("os.name").equals("Linux")) {
|
if (System.getProperty("os.name").equals("Linux")) {
|
||||||
if(mainWindowController.isFullscreen()){
|
if(mainWindowController.isFullscreen()){
|
||||||
p = new ProcessBuilder("wine", cemuBin, "-f", "-g", gameExec).start();
|
p = new ProcessBuilder("wine", cemuBin, "-f", "-g", gameExec).start();
|
||||||
|
@ -74,22 +72,22 @@ public class playGame extends Thread{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.waitFor();
|
p.waitFor(); // wait until cemu is closed so we can calculate the played time
|
||||||
endTime = System.currentTimeMillis();
|
endTime = System.currentTimeMillis();
|
||||||
timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60));
|
timePlayedNow = (int) Math.floor(((endTime - startTime)/1000/60));
|
||||||
timePlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))+timePlayedNow;
|
timePlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))+timePlayedNow;
|
||||||
|
|
||||||
dbController.setTotalPlaytime(Integer.toString(timePlayed), selectedGameTitleID);
|
dbController.setTotalPlaytime(Integer.toString(timePlayed), selectedGameTitleID);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
if(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) > 60){
|
if (Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) > 60) {
|
||||||
int hoursPlayed = (int) Math.floor(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))/60);
|
int hoursPlayed = (int) Math.floor(Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) / 60);
|
||||||
int minutesPlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID))-60*hoursPlayed;
|
int minutesPlayed = Integer.parseInt(dbController.getTotalPlaytime(selectedGameTitleID)) - 60 * hoursPlayed;
|
||||||
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed+"h "+minutesPlayed+"min");
|
mainWindowController.totalPlaytimeBtn.setText(hoursPlayed + "h " + minutesPlayed + "min");
|
||||||
}else{
|
} else {
|
||||||
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID)+ " min");
|
mainWindowController.totalPlaytimeBtn.setText(dbController.getTotalPlaytime(selectedGameTitleID) + " min");
|
||||||
}
|
}
|
||||||
mainWindowController.main.getPrimaryStage().setIconified(false); // maximize cemu_UI
|
mainWindowController.main.getPrimaryStage().setIconified(false); // maximize cemu_UI
|
||||||
});
|
});
|
||||||
|
|
||||||
//sync savegame with cloud service
|
//sync savegame with cloud service
|
||||||
if (mainWindowController.isCloudSync()) {
|
if (mainWindowController.isCloudSync()) {
|
||||||
|
@ -98,8 +96,8 @@ public class playGame extends Thread{
|
||||||
mainWindowController.getCemuPath(), mainWindowController.main.getDirectory().getPath());
|
mainWindowController.getCemuPath(), mainWindowController.main.getDirectory().getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch (IOException | InterruptedException e){
|
} catch (IOException | InterruptedException e) {
|
||||||
e.printStackTrace();
|
LOGGER.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class DBController {
|
||||||
* load ROM and games database
|
* load ROM and games database
|
||||||
* load all games
|
* load all games
|
||||||
*/
|
*/
|
||||||
public void init(){
|
public void init() {
|
||||||
LOGGER.info("<========== starting loading sql ==========>");
|
LOGGER.info("<========== starting loading sql ==========>");
|
||||||
loadRomDatabase();
|
loadRomDatabase();
|
||||||
loadGamesDatabase();
|
loadGamesDatabase();
|
||||||
|
@ -79,18 +79,18 @@ public class DBController {
|
||||||
*
|
*
|
||||||
* TODO this should be called LocalGames
|
* TODO this should be called LocalGames
|
||||||
*/
|
*/
|
||||||
private void loadRomDatabase(){
|
private void loadRomDatabase() {
|
||||||
if (System.getProperty("os.name").equals("Linux")) {
|
if (System.getProperty("os.name").equals("Linux")) {
|
||||||
DB_PATH_localRoms = System.getProperty("user.home") + "/cemu_UI/localRoms.db";
|
DB_PATH_localRoms = System.getProperty("user.home") + "/cemu_UI/localRoms.db";
|
||||||
}else{
|
} else {
|
||||||
DB_PATH_localRoms = System.getProperty("user.home") + "\\Documents\\cemu_UI" + "\\" + "localRoms.db";
|
DB_PATH_localRoms = System.getProperty("user.home") + "\\Documents\\cemu_UI" + "\\" + "localRoms.db";
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// create a database connection
|
// create a database connection
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_localRoms);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH_localRoms);
|
||||||
connection.setAutoCommit(false); //AutoCommit to false -> manual commit is active
|
connection.setAutoCommit(false); // AutoCommit to false -> manual commit is active
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
// if the error message is "out of memory", it probably means no database file is found
|
// if the error message is "out of memory", probably no database file is found
|
||||||
LOGGER.error("error while loading the ROM database", e);
|
LOGGER.error("error while loading the ROM database", e);
|
||||||
}
|
}
|
||||||
LOGGER.info("ROM database loaded successfull");
|
LOGGER.info("ROM database loaded successfull");
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import javafx.scene.text.TextFlow?>
|
<?import javafx.scene.text.TextFlow?>
|
||||||
|
|
||||||
<AnchorPane fx:id="mainAnchorPane" prefHeight="600.0" prefWidth="904.0" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.cemu_UI.application.MainWindowController">
|
<AnchorPane fx:id="mainAnchorPane" minHeight="405.0" minWidth="260.0" prefHeight="600.0" prefWidth="904.0" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.cemu_UI.application.MainWindowController">
|
||||||
<children>
|
<children>
|
||||||
<ScrollPane fx:id="mainScrollPane" fitToWidth="true" layoutY="38.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
<ScrollPane fx:id="mainScrollPane" fitToWidth="true" layoutY="38.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||||
<content>
|
<content>
|
||||||
|
|
|
@ -33,7 +33,7 @@ timeColumn = time
|
||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
editHeadingText = edit
|
editHeadingText = edit
|
||||||
editBodyText = You can edit the tile and rom/cover path.
|
editBodyText = You can edit the tile and ROM/cover path.
|
||||||
removeHeadingText = remove
|
removeHeadingText = remove
|
||||||
removeBodyText = Are you sure you want to delete
|
removeBodyText = Are you sure you want to delete
|
||||||
addUpdateHeadingText = update
|
addUpdateHeadingText = update
|
||||||
|
@ -49,15 +49,15 @@ aboutBtnHeadingText = cemu_UI
|
||||||
aboutBtnBodyText = This Application is made with free Software\nand licensed under the terms of GNU GPL 3.\n\nwww.kellerkinder.xyz
|
aboutBtnBodyText = This Application is made with free Software\nand licensed under the terms of GNU GPL 3.\n\nwww.kellerkinder.xyz
|
||||||
|
|
||||||
cloudSyncWaringHeadingText = activate cloud savegame sync (beta)
|
cloudSyncWaringHeadingText = activate cloud savegame sync (beta)
|
||||||
cloudSyncWaringBodyText = WARNING this is a completly WIP cloud save integration,\nit's NOT recomended to use this!!\n\nUse it on your own risk and backup everthing before!
|
cloudSyncWaringBodyText = WARNING this is a completely WIP cloud save integration,\nit's NOT recommended to use this!!\n\nUse it on your own risk and backup everything before!
|
||||||
|
|
||||||
cloudSyncErrorHeadingText = Error while initializing cloud sync!
|
cloudSyncErrorHeadingText = Error while initializing cloud sync!
|
||||||
cloudSyncErrorBodyText = There was some truble while initializing cloud sync.\nPlease upload the app.log (which can be found in the cemu_UI directory)\nto \"https://github.com/Seil0/cemu_UI/issues\" so we can fix this.
|
cloudSyncErrorBodyText = There was some trouble while initializing cloud sync.\nPlease upload the app.log (which can be found in the cemu_UI directory)\nto \"https://github.com/Seil0/cemu_UI/issues\" so we can fix this.
|
||||||
|
|
||||||
addGameBtnHeadingText = add a new game to cemu_UI
|
addGameBtnHeadingText = add a new game to cemu_UI
|
||||||
addGameBtnBodyText =
|
addGameBtnBodyText =
|
||||||
addBtnReturnErrorHeadingText = Error while adding a new Game!
|
addBtnReturnErrorHeadingText = Error while adding a new Game!
|
||||||
addBtnReturnErrorBodyText = There was some truble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
addBtnReturnErrorBodyText = There was some trouble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
||||||
lastPlayed = Last played,
|
lastPlayed = Last played,
|
||||||
today = today
|
today = today
|
||||||
yesterday = yesterday
|
yesterday = yesterday
|
||||||
|
@ -82,6 +82,6 @@ titleID = title ID
|
||||||
romPath = ROM path
|
romPath = ROM path
|
||||||
coverPath = cover path
|
coverPath = cover path
|
||||||
editGameDialogHeadingTextError = Error while adding a new Game!
|
editGameDialogHeadingTextError = Error while adding a new Game!
|
||||||
editGameDialogBodyTextError = There was some truble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
editGameDialogBodyTextError = There was some trouble adding your game.\nOne of the needed values was empty, please try again to add your game.
|
||||||
editGameDialogSelectPathBtn = select .rpx file
|
editGameDialogSelectPathBtn = select .rpx file
|
||||||
editGameDialogSelectCoverBtn = select cover file
|
editGameDialogSelectCoverBtn = select cover file
|
||||||
|
|
Loading…
Reference in New Issue