Map/Report automatisch öffnen einstellung
This commit is contained in:
parent
ad5d7d98c4
commit
63e736152b
@ -43,7 +43,7 @@ public class ConfigHelper {
|
|||||||
try {
|
try {
|
||||||
ini = new Wini(new File(filename));
|
ini = new Wini(new File(filename));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
assert ini != null;
|
assert ini != null;
|
||||||
return ini.get(sectionName, optionName, String.class);
|
return ini.get(sectionName, optionName, String.class);
|
||||||
@ -92,7 +92,7 @@ public class ConfigHelper {
|
|||||||
ini.put(sectionName, optionName, value);
|
ini.put(sectionName, optionName, value);
|
||||||
ini.store();
|
ini.store();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ public class DirectionMap {
|
|||||||
FileHelper.saveImage(this.map, "jpg", new File(this.file));
|
FileHelper.saveImage(this.map, "jpg", new File(this.file));
|
||||||
FileHelper.saveImage(this.mappdf, "jpg", new File(this.filepdf));
|
FileHelper.saveImage(this.mappdf, "jpg", new File(this.filepdf));
|
||||||
getDirections(start, ende);
|
getDirections(start, ende);
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +53,9 @@ public class Reporter {
|
|||||||
} catch (DocumentException | FileNotFoundException e) {
|
} catch (DocumentException | FileNotFoundException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
}
|
}
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +111,9 @@ public class Reporter {
|
|||||||
} catch (DocumentException | FileNotFoundException e) {
|
} catch (DocumentException | FileNotFoundException e) {
|
||||||
LogHelper.error(e.getMessage(), e.getClass().getName());
|
LogHelper.error(e.getMessage(), e.getClass().getName());
|
||||||
}
|
}
|
||||||
FileHelper.openDefault(file);
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1) {
|
||||||
|
FileHelper.openDefault(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// iText allows to add metadata to the PDF which can be viewed in your Adobe
|
// iText allows to add metadata to the PDF which can be viewed in your Adobe
|
||||||
|
@ -119,7 +119,9 @@ public class TourPlaner{
|
|||||||
* @param tourname Tourname
|
* @param tourname Tourname
|
||||||
*/
|
*/
|
||||||
public static void openImage(String tourname){
|
public static void openImage(String tourname){
|
||||||
FileHelper.openDefault(getImagePath(tourname));
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1) {
|
||||||
|
FileHelper.openDefault(getImagePath(tourname));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -181,17 +183,6 @@ public class TourPlaner{
|
|||||||
return new DbConnect().editLog(tourname, log);
|
return new DbConnect().editLog(tourname, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Exportiert die Daten
|
|
||||||
* @param path Path zu den Daten
|
|
||||||
* @throws IOException Fehler beim schreiben der Daten
|
|
||||||
*/
|
|
||||||
public static void exportData(String path) throws IOException {
|
|
||||||
Exporter exporter = new Exporter(path);
|
|
||||||
exporter.doExport();
|
|
||||||
FileHelper.openDefault(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sucht alle touren die den gegebenen tournamen enthalten
|
* Sucht alle touren die den gegebenen tournamen enthalten
|
||||||
* @param tourname Name der zu suchen ist
|
* @param tourname Name der zu suchen ist
|
||||||
|
@ -58,8 +58,8 @@
|
|||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="Optionen">
|
<Menu mnemonicParsing="false" text="Optionen">
|
||||||
<items>
|
<items>
|
||||||
<CheckMenuItem mnemonicParsing="false" text="Map automatisch öffnen" />
|
<CheckMenuItem fx:id="openmap" mnemonicParsing="false" onAction="#openmapaction" text="Map automatisch öffnen" />
|
||||||
<CheckMenuItem mnemonicParsing="false" text="Report automatisch öffnen" />
|
<CheckMenuItem fx:id="openpdf" mnemonicParsing="false" onAction="#openpdfaction" text="Report automatisch öffnen" />
|
||||||
<Menu mnemonicParsing="false" text="Sprache">
|
<Menu mnemonicParsing="false" text="Sprache">
|
||||||
<items>
|
<items>
|
||||||
<RadioMenuItem mnemonicParsing="false" text="Deutsch" />
|
<RadioMenuItem mnemonicParsing="false" text="Deutsch" />
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package tourplaner.ui;
|
package tourplaner.ui;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.geometry.Orientation;
|
import javafx.geometry.Orientation;
|
||||||
@ -43,6 +45,8 @@ public class TourplanerController implements Initializable {
|
|||||||
//Log -> rechts unten
|
//Log -> rechts unten
|
||||||
public TableView<Log> logTableView;
|
public TableView<Log> logTableView;
|
||||||
public TableColumn<Log, String> logDauerCol, logStreckeCol, logDatumCol, logAvgCol, logHightCol, logPauseCol, logGegangenCol, logBemerkungCol;
|
public TableColumn<Log, String> logDauerCol, logStreckeCol, logDatumCol, logAvgCol, logHightCol, logPauseCol, logGegangenCol, logBemerkungCol;
|
||||||
|
//Menue
|
||||||
|
public CheckMenuItem openmap, openpdf;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private void tourReport(){
|
private void tourReport(){
|
||||||
@ -234,7 +238,30 @@ public class TourplanerController implements Initializable {
|
|||||||
TourListView.setOrientation(Orientation.VERTICAL);
|
TourListView.setOrientation(Orientation.VERTICAL);
|
||||||
syncTourNamen();
|
syncTourNamen();
|
||||||
deselectAll();
|
deselectAll();
|
||||||
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf") == 1){
|
||||||
|
this.openpdf.setSelected(true);
|
||||||
|
}else {
|
||||||
|
this.openpdf.setSelected(false);
|
||||||
|
}
|
||||||
|
if(ConfigHelper.getIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap") == 1){
|
||||||
|
this.openmap.setSelected(true);
|
||||||
|
}else {
|
||||||
|
this.openmap.setSelected(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void openpdfaction(){
|
||||||
|
int selected = 0;
|
||||||
|
if(this.openpdf.isSelected()) selected = 1;
|
||||||
|
ConfigHelper.setIniInt(ConfigHelper.getStandartConfig(), "settings", "openpdf", selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void openmapaction(){
|
||||||
|
int selected = 0;
|
||||||
|
if(this.openmap.isSelected()) selected = 1;
|
||||||
|
ConfigHelper.setIniInt(ConfigHelper.getStandartConfig(), "settings", "openmap", selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deselectAll(){
|
private void deselectAll(){
|
||||||
|
@ -612,7 +612,6 @@ public class ViewModel {
|
|||||||
*/
|
*/
|
||||||
public void exportData(){
|
public void exportData(){
|
||||||
String file = AlertHelper.fileChooser("Exportiere");
|
String file = AlertHelper.fileChooser("Exportiere");
|
||||||
System.out.println("EXPORT: " + file);
|
|
||||||
if(file != null){
|
if(file != null){
|
||||||
try {
|
try {
|
||||||
new Exporter(file).doExport();
|
new Exporter(file).doExport();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user