Set temp directory on project inserter when starting the insert.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 22 Dec 2009 20:07:05 +0000 (21:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 22 Dec 2009 20:07:05 +0000 (21:07 +0100)
src/de/todesbaum/jsite/main/Main.java

index ddeb414..310f5a6 100644 (file)
@@ -556,7 +556,10 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                        }
                        configuration.save();
                        showPage(PageType.PAGE_INSERT_PROJECT);
-                       ((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).startInsert();
+                       ProjectInsertPage projectInsertPage = (ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT);
+                       String tempDirectory = ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).getTempDirectory();
+                       projectInsertPage.setTempDirectory(tempDirectory);
+                       projectInsertPage.startInsert();
                        nodeMenu.setEnabled(false);
                } else if ("page.project.insert".equals(pageName)) {
                        showPage(PageType.PAGE_PROJECTS);
@@ -564,8 +567,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                } else if ("page.preferences".equals(pageName)) {
                        showPage(PageType.PAGE_PROJECTS);
                        optionsPreferencesAction.setEnabled(true);
-                       String tempDirectory = ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).getTempDirectory();
-                       ((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).setTempDirectory(tempDirectory);
                }
        }