Logo fix +
lang.ini fix+ alert fix
This commit is contained in:
parent
c31728a92b
commit
5d860eed3c
@ -1,5 +1,7 @@
|
|||||||
[start]
|
[start]
|
||||||
message = Tour Planer App gestartet
|
message = Tour Planer App gestartet
|
||||||
|
apptitle = Tour Planer
|
||||||
|
logo = logo.png
|
||||||
|
|
||||||
[lang]
|
[lang]
|
||||||
lang = langde
|
lang = langde
|
||||||
|
@ -30,4 +30,7 @@ dauermsg = Dauer des Logeintrages
|
|||||||
doppelpunkt = :
|
doppelpunkt = :
|
||||||
fktnichtimplementiert = Diese Funktion ist noch nicht Implementiert
|
fktnichtimplementiert = Diese Funktion ist noch nicht Implementiert
|
||||||
vergessenodernochnichtsoweit = Entweder hat DerGeorg darauf vergessen oder ist noch nicht so weit gekommen um das zu machen!
|
vergessenodernochnichtsoweit = Entweder hat DerGeorg darauf vergessen oder ist noch nicht so weit gekommen um das zu machen!
|
||||||
logtournotselectedmsg = Bitte wählen Sie zuerst eine Tour aus, bevor sie einen log Eintrag erstellen!
|
logtournotselectedmsg = Bitte wählen Sie zuerst eine Tour aus, bevor sie einen log Eintrag erstellen!
|
||||||
|
keintextimfeld = Bitte tragen Sie einen Text in das Feld ein!
|
||||||
|
nurzahlen = Bitte geben Sie nur Zahlen an!
|
||||||
|
nurpositivezahlen = Bitte geben Sie nur positive Zahlen an!
|
||||||
|
@ -6,3 +6,5 @@
|
|||||||
2021-03-18 22:58:33 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
2021-03-18 22:58:33 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||||
2021-03-18 22:58:34 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
2021-03-18 22:58:34 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||||
2021-03-18 23:05:00 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
2021-03-18 23:05:00 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||||
|
2021-03-18 23:11:45 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||||
|
2021-03-18 23:14:55 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||||
|
@ -4,6 +4,7 @@ import javafx.application.Application;
|
|||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import tourplaner.business.ConfigHelper;
|
import tourplaner.business.ConfigHelper;
|
||||||
@ -21,6 +22,7 @@ public class Main extends Application {
|
|||||||
public void start(Stage primaryStage) throws IOException {
|
public void start(Stage primaryStage) throws IOException {
|
||||||
Parent root = FXMLLoader.load(Main.class.getResource("tourplaner.fxml"));
|
Parent root = FXMLLoader.load(Main.class.getResource("tourplaner.fxml"));
|
||||||
primaryStage.setTitle(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "apptitle"));
|
primaryStage.setTitle(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "apptitle"));
|
||||||
|
primaryStage.getIcons().add(new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo")));
|
||||||
primaryStage.setScene(new Scene(root, 600, 600));
|
primaryStage.setScene(new Scene(root, 600, 600));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import javafx.scene.Scene;
|
|||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TextArea;
|
import javafx.scene.control.TextArea;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.layout.*;
|
||||||
import javafx.scene.text.Text;
|
import javafx.scene.text.Text;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
@ -100,7 +101,9 @@ public class AlertHelper {
|
|||||||
alert.setTitle(title);
|
alert.setTitle(title);
|
||||||
alert.setHeaderText(header);
|
alert.setHeaderText(header);
|
||||||
alert.setContentText(msg);
|
alert.setContentText(msg);
|
||||||
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
|
stage.getIcons().add(
|
||||||
|
new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo")));
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,18 +115,39 @@ public class AlertHelper {
|
|||||||
* @return Null bei keiner eingabe
|
* @return Null bei keiner eingabe
|
||||||
*/
|
*/
|
||||||
public static String inputText(String title, String header, String msg) {
|
public static String inputText(String title, String header, String msg) {
|
||||||
|
String returnStr = "";
|
||||||
|
while (returnStr.isEmpty()) {
|
||||||
|
Optional<String> result = inputHelper(title, header, msg);
|
||||||
|
AtomicReference<String> returnText = new AtomicReference<>("");
|
||||||
|
result.ifPresent(returnText::set);
|
||||||
|
returnStr = returnText.get();
|
||||||
|
if (returnStr.isEmpty()) {
|
||||||
|
AlertHelper.warn(ConfigHelper.getLangIniString("tournametitle"),
|
||||||
|
ConfigHelper.getLangIniString("achtung"),
|
||||||
|
ConfigHelper.getLangIniString("keintextimfeld"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt einen Text Input Dialog
|
||||||
|
* @param title Title des Dialogs
|
||||||
|
* @param header Header des Dialogs
|
||||||
|
* @param msg Nachricht des Dialogs
|
||||||
|
* @return Result des Inputs
|
||||||
|
*/
|
||||||
|
private static Optional<String> inputHelper(String title, String header, String msg){
|
||||||
TextInputDialog dialog = new TextInputDialog();
|
TextInputDialog dialog = new TextInputDialog();
|
||||||
dialog.setTitle(title);
|
dialog.setTitle(title);
|
||||||
dialog.setHeaderText(header);
|
dialog.setHeaderText(header);
|
||||||
dialog.setContentText(msg);
|
dialog.setContentText(msg);
|
||||||
Optional<String> result = dialog.showAndWait();
|
Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow();
|
||||||
AtomicReference<String> returnText = new AtomicReference<>("");
|
stage.getIcons().add(
|
||||||
result.ifPresent(returnText::set);
|
new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo")));
|
||||||
if(!returnText.get().isEmpty()){
|
|
||||||
return returnText.get();
|
return dialog.showAndWait();
|
||||||
}else{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -134,23 +158,27 @@ public class AlertHelper {
|
|||||||
* @return -1 bei error sonst ein Int
|
* @return -1 bei error sonst ein Int
|
||||||
*/
|
*/
|
||||||
public static int inputNumber(String title, String header, String msg) {
|
public static int inputNumber(String title, String header, String msg) {
|
||||||
TextInputDialog dialog = new TextInputDialog();
|
int returnInt = -2;
|
||||||
dialog.setTitle(title);
|
while (returnInt <= 0 ) {
|
||||||
dialog.setHeaderText(header);
|
Optional<String> result = inputHelper(title, header, msg);
|
||||||
dialog.setContentText(msg);
|
AtomicReference<Integer> returnText = new AtomicReference<Integer>(-1);
|
||||||
Optional<String> result = dialog.showAndWait();
|
result.ifPresent(s -> {
|
||||||
AtomicReference<Integer> returnText = new AtomicReference<Integer>(-1);
|
try {
|
||||||
result.ifPresent(s -> {
|
int resultInt = Integer.parseInt(result.get());
|
||||||
try {
|
returnText.set(resultInt);
|
||||||
int resultInt = Integer.parseInt(result.get());
|
if (resultInt < 0){
|
||||||
returnText.set(resultInt);
|
AlertHelper.warn(title, ConfigHelper.getLangIniString("achtung"), ConfigHelper.getLangIniString("nurpositivezahlen"));
|
||||||
}catch (NumberFormatException e){
|
}
|
||||||
AlertHelper.warn(ConfigHelper.getLangIniString("achtung"), "Bitte nur Zahlen eingeben!", "Bitte geben sie nur Zahlen von 0 - 10 an!");
|
} catch (NumberFormatException e) {
|
||||||
returnText.set(-1);
|
AlertHelper.warn(title, ConfigHelper.getLangIniString("achtung"), ConfigHelper.getLangIniString("nurzahlen"));
|
||||||
}
|
returnText.set(-1);
|
||||||
});
|
}
|
||||||
|
|
||||||
return returnText.get();
|
});
|
||||||
|
returnInt = returnText.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -161,6 +189,8 @@ public class AlertHelper {
|
|||||||
public static LocalDate datePicker(String title){
|
public static LocalDate datePicker(String title){
|
||||||
final DatePicker datePicker = new DatePicker(LocalDate.now());
|
final DatePicker datePicker = new DatePicker(LocalDate.now());
|
||||||
final Stage stage = new Stage();
|
final Stage stage = new Stage();
|
||||||
|
stage.getIcons().add(
|
||||||
|
new Image("file:"+ ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "logo")));
|
||||||
AtomicReference<LocalDate> selectedDate = new AtomicReference<>();
|
AtomicReference<LocalDate> selectedDate = new AtomicReference<>();
|
||||||
datePicker.setOnAction(event -> {
|
datePicker.setOnAction(event -> {
|
||||||
LocalDate date = datePicker.getValue();
|
LocalDate date = datePicker.getValue();
|
||||||
|
@ -182,24 +182,18 @@ public class TourplanerController implements Initializable {
|
|||||||
newId.set(UUID.randomUUID().toString());
|
newId.set(UUID.randomUUID().toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
double neueDauer = -1;
|
|
||||||
double neueStrecke = -1;
|
|
||||||
LocalDate neuesDatum = null;
|
LocalDate neuesDatum = null;
|
||||||
while (neuesDatum == null) {
|
while (neuesDatum == null) {
|
||||||
neuesDatum = AlertHelper.datePicker(ConfigHelper.getLangIniString("datum"));
|
neuesDatum = AlertHelper.datePicker(ConfigHelper.getLangIniString("datum"));
|
||||||
}
|
}
|
||||||
while (neueDauer == -1) {
|
double neueDauer = AlertHelper.inputNumber(ConfigHelper.getLangIniString("dauer"),
|
||||||
neueDauer = AlertHelper.inputNumber(ConfigHelper.getLangIniString("dauer"),
|
|
||||||
ConfigHelper.getLangIniString("dauermsg"),
|
ConfigHelper.getLangIniString("dauermsg"),
|
||||||
ConfigHelper.getLangIniString("dauer") +
|
ConfigHelper.getLangIniString("dauer") +
|
||||||
ConfigHelper.getLangIniString("doppelpunkt"));
|
ConfigHelper.getLangIniString("doppelpunkt"));
|
||||||
}
|
double neueStrecke = AlertHelper.inputNumber(ConfigHelper.getLangIniString("strecke"),
|
||||||
while (neueStrecke == -1) {
|
|
||||||
neueStrecke = AlertHelper.inputNumber(ConfigHelper.getLangIniString("strecke"),
|
|
||||||
ConfigHelper.getLangIniString("streckemsg"),
|
ConfigHelper.getLangIniString("streckemsg"),
|
||||||
ConfigHelper.getLangIniString("strecke") +
|
ConfigHelper.getLangIniString("strecke") +
|
||||||
ConfigHelper.getLangIniString("doppelpunkt"));
|
ConfigHelper.getLangIniString("doppelpunkt"));
|
||||||
}
|
|
||||||
|
|
||||||
Log newLog = new Log(newId.get(), neueDauer + "", neuesDatum, neueStrecke);
|
Log newLog = new Log(newId.get(), neueDauer + "", neuesDatum, neueStrecke);
|
||||||
logData.add(newLog);
|
logData.add(newLog);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user