Commit 784d7e03 authored by Matthias Betz's avatar Matthias Betz
Browse files

added localization for alert message

parent 18529b7c
Pipeline #1165 passed with stage
in 1 minute and 46 seconds
......@@ -108,4 +108,5 @@ CityGmlParser.errorReadingGmlFile=Error while reading city gml file\n{}
CityGmlParser.noConversionNeeded=Coordinate system is in meters, no conversion done
CityGmlParser.noEPSG=Could not read EPSG code, assuming metric system
OpenFileDialog.loadFailed=Failed to load CityGML File
MainWindow.memoryLabel=Memory:
\ No newline at end of file
MainWindow.memoryLabel=Memory:
CheckDialog.checksReenabledAlert=Some checks have been reenabled so that other wanted checks can be executed\nSee the log for more information.
\ No newline at end of file
......@@ -106,4 +106,5 @@ CityGmlParser.errorReadingGmlFile=Fehler beim lesen der CityGML Datei\n{}
CityGmlParser.noConversionNeeded=Koordinatensystem in Metern, keine Konvertierung notwendig
CityGmlParser.noEPSG=Konnte EPSG Code nicht lesen, nehme metrisches System an
OpenFileDialog.loadFailed=Konnte CityGML Datei nicht laden
MainWindow.memoryLabel=Speicher:
\ No newline at end of file
MainWindow.memoryLabel=Speicher:
CheckDialog.checksReenabledAlert=Manche Pr\u00fcfungen wurden reaktiviert damit andere gewollte Pr\u00fcfungen durchgef\u00fchrt werden k\u00f6nnen\nMehr Details sind im Log geschrieben
\ No newline at end of file
......@@ -153,7 +153,13 @@ public class ValidationConfiguration implements Serializable {
this.checks = checks;
}
public void validateConfiguration() {
/**
* Validates the configuration, adds all missing checks as enabled, reenables
* checks that are necessary to perform other checks
*
* @return true if it reenabled disabled checks, false otherwise
*/
public boolean validateConfiguration() {
for (CheckPrototype c : Checks.getCheckPrototypes()) {
// enable all checks that are missing in the validation config
checks.computeIfAbsent(c.getCheckId(), id -> {
......@@ -162,7 +168,7 @@ public class ValidationConfiguration implements Serializable {
return cConfig;
});
}
reenableNecessaryChecks();
boolean reenabledChecks = reenableNecessaryChecks();
if (schematronFilePath != null && !schematronFilePath.isEmpty()) {
File f = new File(schematronFilePath);
if (!f.exists() || !f.isFile()) {
......@@ -172,9 +178,11 @@ public class ValidationConfiguration implements Serializable {
}
}
}
return reenabledChecks;
}
private void reenableNecessaryChecks() {
private boolean reenableNecessaryChecks() {
boolean reenabledChecks = false;
for (java.util.Map.Entry<CheckId, CheckConfiguration> e : checks.entrySet()) {
if (!e.getValue().isEnabled()) {
continue;
......@@ -184,6 +192,7 @@ public class ValidationConfiguration implements Serializable {
CheckConfiguration checkConfig = checks.get(dep);
if (!checkConfig.isEnabled()) {
checkConfig.setEnabled(true);
reenabledChecks = true;
if (logger.isWarnEnabled()) {
logger.warn(Localization.getText("ValidationConfiguration.reenable"), dep, c.getCheckId());
}
......@@ -191,6 +200,7 @@ public class ValidationConfiguration implements Serializable {
}
insertMissingParametersWithDefaultParameters(e, c);
}
return reenabledChecks;
}
private void insertMissingParametersWithDefaultParameters(java.util.Map.Entry<CheckId, CheckConfiguration> e,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment