add projects to tab when loading done
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 17 May 2008 17:49:28 +0000 (17:49 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 17 May 2008 17:49:28 +0000 (17:49 +0000)
initialize new project with proper values

git-svn-id: http://trooper/svn/projects/jSite/trunk@908 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/jsite/gui/SwingInterface.java

index 45e98ac..49913ce 100644 (file)
@@ -26,6 +26,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -819,10 +820,9 @@ public class SwingInterface implements CoreListener, LoggingListener {
        private void addProject() {
                try {
                        Project project = core.createProject();
-                       project.setName(I18n.get("")); /* TODO - i18n */
-                       project.setDescription(I18n.get("")); /* TODO - i18n */
-                       System.out.println("private: " + project.getPrivateKey() + ", public: " + project.getPublicKey());
                        mainWindow.addProject(project);
+                       project.setName(I18n.get("general.newProject.name"));
+                       project.setDescription(I18n.get("general.newProject.description", new Date()));
                } catch (NoNodeException nne1) {
                        /* TODO - add i18n */
                        JOptionPane.showMessageDialog(mainWindow, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE);
@@ -855,6 +855,9 @@ public class SwingInterface implements CoreListener, LoggingListener {
         */
        public void loadingProjectsDone(String directory) {
                mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.projectLoadingDone"));
+               for (Project project: core.getProjects()) {
+                       mainWindow.addProject(project);
+               }
        }
 
        /**