This fixes #116.
JCheckBox checkBox = (JCheckBox) source;
if ("default-file".equals(checkBox.getName())) {
if (checkBox.isSelected()) {
- project.setIndexFile(filename);
+ if (filename.indexOf('/') > -1) {
+ JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.invalid-default-file"), null, JOptionPane.ERROR_MESSAGE);
+ checkBox.setSelected(false);
+ } else {
+ project.setIndexFile(filename);
+ }
} else {
- project.setIndexFile(null);
+ if (filename.equals(project.getIndexFile())) {
+ project.setIndexFile(null);
+ }
}
} else if ("insert".equals(checkBox.getName())) {
boolean isInsert = checkBox.isSelected();
jsite.project-files.replacement.edition-range.tooltip=Also replace $[EDITION+1], $[EDITION+2]\u2026
jsite.project-files.scan-error=<html><b>Error scanning files</b><br><br>Either the directory of the project does not exist<br>or some files/directories in it are not accessible.<br>Please go back and select the correct directory.</html>
jsite.project-files.insert-now=Insert now
+jsite.project-files.invalid-default-file=Only files in the root directory may be selected as default files.
jsite.update-checker.found-version.title=Found New Version
jsite.update-checker.found-version.message=<html>A new version was found.<br><br>Version {0} (released {1,date})</html>
jsite.project-files.replacement.edition-range.tooltip=Ersetzt auch $[EDITION+1], $[EDITION+2], usw.
jsite.project-files.scan-error=<html><b>Fehler beim Einlesen der Dateien</b><br><br>Entweder existiert das Projektverzeichnis nicht,<br>oder einige Dateien und/oder Verzeichnisse sind nicht lesbar!<br>Bitte gehen Sie zur\u00fcck und beheben Sie den Fehler!</html>
jsite.project-files.insert-now=Jetzt einf\u00fcgen
+jsite.project-files.invalid-default-file=Nur Dateien im obersten Verzeichnis d\u00fcrfen als Index-Dateien ausgew\u00e4hlt werden.
jsite.update-checker.found-version.title=Neue Version gefunden
jsite.update-checker.found-version.message=<html>Eine neue Version wurde gefunden.<br><br>Version {0} (ver\u00f6ffentlicht {1,date})</html>
Project project = new Project();
projects.add(project);
project.setDescription(projectNode.getNode("description").getValue(""));
- project.setIndexFile(projectNode.getNode("index-file").getValue(""));
+ String indexFile = projectNode.getNode("index-file").getValue("");
+ if (indexFile.indexOf('/') > -1) {
+ indexFile = "";
+ }
+ project.setIndexFile(indexFile);
project.setLastInsertionTime(Long.parseLong(projectNode.getNode("last-insertion-time").getValue("0")));
project.setLocalPath(projectNode.getNode("local-path").getValue(""));
project.setName(projectNode.getNode("name").getValue(""));