From: David ‘Bombe’ Roden Date: Sat, 24 May 2008 21:12:20 +0000 (+0200) Subject: save base path in project X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5b9ae5a755e76b81e20fdc9e1d5a592540b02f12;p=jSite2.git save base path in project --- diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index c79c37d..eb67d27 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -720,6 +720,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh Project project = core.createProject(); project.setName(I18n.get("general.newProject.name")); project.setDescription(I18n.get("general.newProject.description", new Date())); + project.setBasePath(""); mainWindow.addProject(project, true); } catch (JSiteException nne1) { /* TODO - add i18n */ diff --git a/src/net/pterodactylus/jsite/project/ProjectManager.java b/src/net/pterodactylus/jsite/project/ProjectManager.java index ab5406d..5009b0d 100644 --- a/src/net/pterodactylus/jsite/project/ProjectManager.java +++ b/src/net/pterodactylus/jsite/project/ProjectManager.java @@ -139,12 +139,15 @@ public class ProjectManager implements PropertyChangeListener { String projectDescription = projectProperties.getProperty(projectPrefix + ".description"); String projectPrivateKey = projectProperties.getProperty(projectPrefix + ".privateKey"); String projectPublicKey = projectProperties.getProperty(projectPrefix + ".publicKey"); + String projectBasePath = projectProperties.getProperty(projectPrefix + ".basePath"); Project project = new Project(); project.setId(projectId); project.setName(projectName); project.setDescription(projectDescription); project.setPrivateKey(projectPrivateKey); project.setPublicKey(projectPublicKey); + project.setBasePath(projectBasePath); + project.rescanBasePath(); projects.add(project); logger.fine("loaded project “" + project.getName() + "”."); projectIndex++; @@ -173,6 +176,7 @@ public class ProjectManager implements PropertyChangeListener { projectProperties.setProperty(projectPrefix + ".description", project.getDescription()); projectProperties.setProperty(projectPrefix + ".privateKey", project.getPrivateKey()); projectProperties.setProperty(projectPrefix + ".publicKey", project.getPublicKey()); + projectProperties.setProperty(projectPrefix + ".basePath", project.getBasePath()); projectIndex++; } File projectFile = new File(directoryFile, "projects.properties");