Update year in copyright headers.
[jSite.git] / src / main / java / de / todesbaum / jsite / gui / ProjectPage.java
index 2fc5716..1da83d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * jSite - ProjectPage.java - Copyright © 2006–2012 David Roden
+ * jSite - ProjectPage.java - Copyright © 2006–2014 David Roden
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,6 +33,8 @@ import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
 import java.io.IOException;
 import java.text.MessageFormat;
+import java.util.List;
+import java.util.Map.Entry;
 
 import javax.swing.AbstractAction;
 import javax.swing.Action;
@@ -58,6 +60,7 @@ import javax.swing.text.Document;
 import javax.swing.text.DocumentFilter;
 
 import net.pterodactylus.util.swing.SortedListModel;
+import de.todesbaum.jsite.application.FileOption;
 import de.todesbaum.jsite.application.Freenet7Interface;
 import de.todesbaum.jsite.application.Project;
 import de.todesbaum.jsite.application.WebOfTrustInterface;
@@ -440,7 +443,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
         * @param projects
         *            The list of projects
         */
-       public void setProjects(Project[] projects) {
+       public void setProjects(List<Project> projects) {
                projectListModel.clear();
                for (Project project : projects) {
                        projectListModel.add(project);
@@ -452,8 +455,8 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
         *
         * @return The list of projects
         */
-       public Project[] getProjects() {
-               return projectListModel.toArray(new Project[projectListModel.size()]);
+       public List<Project> getProjects() {
+               return projectListModel;
        }
 
        /**
@@ -629,6 +632,7 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
                        KeyDialog keyDialog = new KeyDialog(freenetInterface, wizard);
                        keyDialog.setPrivateKey(selectedProject.getInsertURI());
                        keyDialog.setPublicKey(selectedProject.getRequestURI());
+                       keyDialog.setProjects(getProjects());
                        keyDialog.setOwnIdentities(webOfTrustInterface.getOwnIdentities());
                        keyDialog.setVisible(true);
                        if (!keyDialog.wasCancelled()) {
@@ -638,6 +642,9 @@ public class ProjectPage extends TWizardPage implements ListSelectionListener, D
                                selectedProject.setRequestURI(keyDialog.getPublicKey());
                                if (!originalPublicKey.equals(selectedProject.getRequestURI()) || !originalPrivateKey.equals(selectedProject.getInsertURI())) {
                                        selectedProject.setEdition(-1);
+                                       for (Entry<String, FileOption> fileOption : selectedProject.getFileOptions().entrySet()) {
+                                               fileOption.getValue().setLastInsertHash(null);
+                                       }
                                }
                                updateCompleteURI();
                        }