save base path in project
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 24 May 2008 21:12:20 +0000 (23:12 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 24 May 2008 21:12:20 +0000 (23:12 +0200)
src/net/pterodactylus/jsite/gui/SwingInterface.java
src/net/pterodactylus/jsite/project/ProjectManager.java

index c79c37d..eb67d27 100644 (file)
@@ -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 */
index ab5406d..5009b0d 100644 (file)
@@ -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");