From 5b9ae5a755e76b81e20fdc9e1d5a592540b02f12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 24 May 2008 23:12:20 +0200 Subject: [PATCH] save base path in project --- src/net/pterodactylus/jsite/gui/SwingInterface.java | 1 + src/net/pterodactylus/jsite/project/ProjectManager.java | 4 ++++ 2 files changed, 5 insertions(+) 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"); -- 2.7.4