Text wird aus der config.ini geladen + Readme.md angepasst + config.ini.sample
This commit is contained in:
parent
a8f2ce36e5
commit
03fb15b62b
@ -0,0 +1,8 @@
|
|||||||
|
# Tourplaner
|
||||||
|
|
||||||
|
# Config
|
||||||
|
* DB informationen müssen in das config.ini.sample unter [db] eingetragen werden
|
||||||
|
* Datei muss in config.ini umbenannt werden
|
||||||
|
* [langde] beinhaltet alle Deutschen Texte der Gui
|
||||||
|
* [start] beinhaltet den Title und infos die beim start verabeitet werden
|
||||||
|
* [hilfe] beinhaltet die Links zu den Hilfeseiten
|
39
conf.ini.sample
Normal file
39
conf.ini.sample
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
[start]
|
||||||
|
message = Tour Planer App gestartet
|
||||||
|
|
||||||
|
[db]
|
||||||
|
dbname = tourplaner
|
||||||
|
url =
|
||||||
|
port = 5432
|
||||||
|
user =
|
||||||
|
pw =
|
||||||
|
|
||||||
|
[hilfe]
|
||||||
|
gitrepo = https://git.dergeorg.at/dergeorg/tourplaner
|
||||||
|
doxygendoc = https://git.dergeorg.at/dergeorg/tourplaner
|
||||||
|
javadoc = https://git.dergeorg.at/dergeorg/tourplaner
|
||||||
|
|
||||||
|
|
||||||
|
[langde]
|
||||||
|
achtung = ACHTUNG
|
||||||
|
openbrowsererror = TourplanerController -> Browser:
|
||||||
|
browserexception = Browser Exception
|
||||||
|
browserexceptionmsg = Error beim öffnen des Browsers
|
||||||
|
suchfeldleer = Suchfeld ist leer!
|
||||||
|
suchtextzuerst = Bitte zuerst den Suchtext in das Suchfeld eingeben!
|
||||||
|
keinetourselected = Keine Tour ausgewählt!
|
||||||
|
tournametitle = Tourname
|
||||||
|
tournameheader = Bitte geben Sie den Namen der Tour an!
|
||||||
|
tournamemsg = Name:
|
||||||
|
namevergebenheader = Name bereits vergeben!
|
||||||
|
namevergebenmsg1 = Der Name '
|
||||||
|
namevergebenmsg2 = ' ist bereits vergeben, bitte verwenden Sie einen andern!
|
||||||
|
startpunkttitle = Tour Startpunkt
|
||||||
|
startpunktheader = Bitte geben Sie den Startpunkt der Tour an!
|
||||||
|
startpunktmsg = Startpunkt:
|
||||||
|
zielpunkttitle = Tour zielpunkt
|
||||||
|
zielpunktheader = Bitte geben Sie den Zielpunkt der Tour an!
|
||||||
|
zielpunktmsg = Zielpunkt:
|
||||||
|
deltournoselect = ViewModel -> DelTour
|
||||||
|
deltournoselectmsg = Bitte wählen Sie zuerst eine Tour aus, bevor Sie auf löschen klicken!
|
||||||
|
exceptionstackheader = Exception stacktrace:
|
@ -6,7 +6,7 @@ import javafx.scene.Parent;
|
|||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import tourplaner.business.LogHelper;
|
import tourplaner.business.ConfigHelper;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public class Main extends Application {
|
|||||||
@Override
|
@Override
|
||||||
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("DerGeorg Touren Planer");
|
primaryStage.setTitle(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "apptitle"));
|
||||||
primaryStage.setScene(new Scene(root, 600, 600));
|
primaryStage.setScene(new Scene(root, 600, 600));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public class AlertHelper {
|
|||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
ex.printStackTrace(pw);
|
ex.printStackTrace(pw);
|
||||||
String exceptionText = sw.toString();
|
String exceptionText = sw.toString();
|
||||||
Label label = new Label("Exception stacktrace:");
|
Label label = new Label(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "exceptionstackheader"));
|
||||||
TextArea textArea = new TextArea(exceptionText);
|
TextArea textArea = new TextArea(exceptionText);
|
||||||
textArea.setEditable(false);
|
textArea.setEditable(false);
|
||||||
textArea.setWrapText(true);
|
textArea.setWrapText(true);
|
||||||
|
@ -10,8 +10,8 @@ public class TourPlaner{
|
|||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
public TourPlaner(){
|
public TourPlaner(){
|
||||||
String startText = ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message");
|
LogHelper.info(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "message"),
|
||||||
LogHelper.info(startText, "TourPlaner");
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "start", "app"));
|
||||||
new DbConnect().init();
|
new DbConnect().init();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import javafx.scene.input.MouseEvent;
|
|||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.scene.web.WebView;
|
import javafx.scene.web.WebView;
|
||||||
import tourplaner.business.AlertHelper;
|
import tourplaner.business.AlertHelper;
|
||||||
|
import tourplaner.business.ConfigHelper;
|
||||||
import tourplaner.business.LogHelper;
|
import tourplaner.business.LogHelper;
|
||||||
import tourplaner.object.Tour;
|
import tourplaner.object.Tour;
|
||||||
import tourplaner.viewmodels.ViewModel;
|
import tourplaner.viewmodels.ViewModel;
|
||||||
@ -40,7 +41,7 @@ public class TourplanerController implements Initializable {
|
|||||||
*/
|
*/
|
||||||
@FXML
|
@FXML
|
||||||
private void gitWebBrowser(){
|
private void gitWebBrowser(){
|
||||||
openBrowser("https://git.dergeorg.at/dergeorg/tourplaner", "Git");
|
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "gitrepo"), "Git");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +50,7 @@ public class TourplanerController implements Initializable {
|
|||||||
*/
|
*/
|
||||||
@FXML
|
@FXML
|
||||||
private void javaDocBrowser(){
|
private void javaDocBrowser(){
|
||||||
openBrowser("https://git.dergeorg.at/dergeorg/tourplaner", "JavaDoc");
|
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "javadoc"), "JavaDoc");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,7 +59,7 @@ public class TourplanerController implements Initializable {
|
|||||||
*/
|
*/
|
||||||
@FXML
|
@FXML
|
||||||
private void doxygenDocBrowser(){
|
private void doxygenDocBrowser(){
|
||||||
openBrowser("https://git.dergeorg.at/dergeorg/tourplaner", "Doxygen");
|
openBrowser(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "hilfe", "doxygendoc"), "Doxygen");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,8 +74,10 @@ public class TourplanerController implements Initializable {
|
|||||||
uriString);
|
uriString);
|
||||||
desktop.browse(oURL);
|
desktop.browse(oURL);
|
||||||
} catch (URISyntaxException | IOException e) {
|
} catch (URISyntaxException | IOException e) {
|
||||||
LogHelper.error(e.getMessage(), "TourplanerController -> Browser:" + appname);
|
LogHelper.error(e.getMessage(), ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "openbrowsererror") + appname);
|
||||||
AlertHelper.exerror("Browser Exception", "TourplanerController -> Browser:" + appname, "Error beim öffnen des Browsers", e);
|
AlertHelper.exerror(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "browserexception"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "openbrowsererror") + appname,
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "browserexceptionmsg"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +136,9 @@ public class TourplanerController implements Initializable {
|
|||||||
private void suche(){
|
private void suche(){
|
||||||
String sucheInput = this.sucheInput.getText();
|
String sucheInput = this.sucheInput.getText();
|
||||||
if(sucheInput.isEmpty()){
|
if(sucheInput.isEmpty()){
|
||||||
AlertHelper.warn("ACHTUNG", "Suchfeld ist leer!", "Bitte zuerst den Suchtext in das Suchfeld eingeben!");
|
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "suchfeldleer"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "suchtextzuerst"));
|
||||||
}else {
|
}else {
|
||||||
this.viewModel.suche(sucheInput);
|
this.viewModel.suche(sucheInput);
|
||||||
}
|
}
|
||||||
@ -149,7 +154,7 @@ public class TourplanerController implements Initializable {
|
|||||||
TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
||||||
TourListView.setOrientation(Orientation.VERTICAL);
|
TourListView.setOrientation(Orientation.VERTICAL);
|
||||||
TourListView.setItems(this.viewModel.getTourNamen());
|
TourListView.setItems(this.viewModel.getTourNamen());
|
||||||
this.beschreibungTableView.setPlaceholder(new Label("Keine Tour ausgewählt!"));
|
this.beschreibungTableView.setPlaceholder(new Label( ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected")));
|
||||||
this.titleTextView.setText("Keine Tour ausgewählt!");
|
this.titleTextView.setText( ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import javafx.collections.ObservableList;
|
|||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.TextInputDialog;
|
import javafx.scene.control.TextInputDialog;
|
||||||
import tourplaner.business.AlertHelper;
|
import tourplaner.business.AlertHelper;
|
||||||
|
import tourplaner.business.ConfigHelper;
|
||||||
import tourplaner.business.LogHelper;
|
import tourplaner.business.LogHelper;
|
||||||
import tourplaner.business.TourPlaner;
|
import tourplaner.business.TourPlaner;
|
||||||
import tourplaner.object.Tour;
|
import tourplaner.object.Tour;
|
||||||
@ -23,17 +24,27 @@ public class ViewModel {
|
|||||||
*/
|
*/
|
||||||
public void addTour(){
|
public void addTour(){
|
||||||
while(this.neueTourName == null) {
|
while(this.neueTourName == null) {
|
||||||
this.neueTourName = AlertHelper.inputText("Tourname", "Bitte geben Sie den Namen der Tour an!", "Name:");
|
this.neueTourName = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournametitle"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournameheader"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "tournamemsg"));
|
||||||
if (getTour(this.neueTourName) != null) {
|
if (getTour(this.neueTourName) != null) {
|
||||||
AlertHelper.warn("ACHTUNG", "Name bereits vergeben!", "Der Name '"+ this.neueTourName +"' ist bereits vergeben, bitte verwenden Sie einen andern!");
|
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenheader"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenmsg1")
|
||||||
|
+ this.neueTourName +
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "namevergebenmsg2"));
|
||||||
this.neueTourName = null;
|
this.neueTourName = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(this.neueTourStart == null){
|
while(this.neueTourStart == null){
|
||||||
this.neueTourStart = AlertHelper.inputText("Tour Startpunkt", "Bitte geben Sie den Startpunkt der Tour an!", "Startpunkt: ");
|
this.neueTourStart = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunkttitle"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunktheader"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "startpunktmsg"));
|
||||||
}
|
}
|
||||||
while(this.neueTourZiel == null){
|
while(this.neueTourZiel == null){
|
||||||
this.neueTourZiel = AlertHelper.inputText("Tour zielpunkt", "Bitte geben Sie den Zielpunkt der Tour an!", "Zielpunkt: ");
|
this.neueTourZiel = AlertHelper.inputText(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunkttitle"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunktheader"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "zielpunktmsg"));
|
||||||
}
|
}
|
||||||
if (getTour(this.neueTourName) == null) {
|
if (getTour(this.neueTourName) == null) {
|
||||||
tourData.add(new Tour(this.neueTourName, "TBD", "TBD", 0, this.neueTourStart, this.neueTourZiel));
|
tourData.add(new Tour(this.neueTourName, "TBD", "TBD", 0, this.neueTourStart, this.neueTourZiel));
|
||||||
@ -110,8 +121,11 @@ public class ViewModel {
|
|||||||
tourData.removeIf(s -> s.getName().equals(tourname));
|
tourData.removeIf(s -> s.getName().equals(tourname));
|
||||||
tourNamen.removeIf(s -> s.equals(tourname));
|
tourNamen.removeIf(s -> s.equals(tourname));
|
||||||
}catch (NullPointerException e){
|
}catch (NullPointerException e){
|
||||||
LogHelper.error("Keine Tour ausgewählt!", "ViewModel -> DelTour");
|
LogHelper.error(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"),
|
||||||
AlertHelper.warn("ACHTUNG", "Keine Tour ausgewählt!", "Bitte wählen Sie zuerst eine Tour aus, bevor Sie auf löschen klicken!");
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "deltournoselect"));
|
||||||
|
AlertHelper.warn(ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "achtung"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "keinetourselected"),
|
||||||
|
ConfigHelper.getIniString(ConfigHelper.getStandartConfig(), "langde", "deltournoselectmsg"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user