version 0.4.9.8
[jSite.git] / src / de / todesbaum / jsite / main / Main.java
index bfb5ef3..aca9f73 100644 (file)
@@ -21,6 +21,7 @@ package de.todesbaum.jsite.main;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.io.File;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.HashMap;
@@ -85,7 +86,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
        private Main() {
                this(null);
        }
-       
+
        private Main(String configFilename) {
                if (configFilename != null) {
                        configuration = new Configuration(configFilename);
@@ -134,7 +135,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.about.message"), Version.getVersion()), null, JOptionPane.INFORMATION_MESSAGE, jSiteIcon);
                        }
                };
-               
+
                I18nContainer.getInstance().registerRunnable(new Runnable() {
                        public void run() {
                                manageNodeAction.putValue(Action.NAME, I18n.getMessage("jsite.menu.nodes.manage-nodes"));
@@ -171,7 +172,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                final JMenu helpMenu = new JMenu(I18n.getMessage("jsite.menu.help"));
                menuBar.add(helpMenu);
                helpMenu.add(aboutAction);
-               
+
                I18nContainer.getInstance().registerRunnable(new Runnable() {
                        public void run() {
                                languageMenu.setText(I18n.getMessage("jsite.menu.languages"));
@@ -182,7 +183,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                }
                        }
                });
-               
+
                return menuBar;
        }
 
@@ -320,6 +321,12 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.empty-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
                                        return;
                                }
+                       } else {
+                               File indexFile = new File(project.getLocalPath(), project.getIndexFile());
+                               if (!indexFile.exists()) {
+                                       JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.index-missing"), null, JOptionPane.ERROR_MESSAGE);
+                                       return;
+                               }
                        }
                        if (!project.getFileOption(project.getIndexFile()).getContainer().equals("")) {
                                if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.container-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
@@ -460,5 +467,5 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                System.out.println("--debug\tenables some debug output");
                System.out.println("--config-file <file>\tuse specified configuration file");
        }
-       
+
 }