remove subversion $Id$ tags
[jSite.git] / src / de / todesbaum / jsite / main / Main.java
index 230f2ec..f1948f3 100644 (file)
@@ -60,8 +60,7 @@ import de.todesbaum.util.swing.TWizardPage;
 import de.todesbaum.util.swing.WizardListener;
 
 /**
- * @author <a href="mailto:droden@gmail.com">David Roden </a>
- * @version $Id$
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
  */
 public class Main implements ActionListener, ListSelectionListener, WizardListener, NodeManagerListener {
 
@@ -74,7 +73,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                PAGE_NODE_MANAGER, PAGE_PROJECTS, PAGE_PROJECT_FILES, PAGE_INSERT_PROJECT
        }
 
-       private static final Locale[] SUPPORTED_LOCALES = new Locale[] { Locale.ENGLISH, Locale.GERMAN, Locale.FRENCH };
+       private static final Locale[] SUPPORTED_LOCALES = new Locale[] { Locale.ENGLISH, Locale.GERMAN, Locale.FRENCH, Locale.ITALIAN, new Locale("pl") };
        protected Map<Locale, Action> languageActions = new HashMap<Locale, Action>();
        protected Action manageNodeAction;
        protected Action aboutAction;
@@ -86,7 +85,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
        private Main() {
                this(null);
        }
-       
+
        private Main(String configFilename) {
                if (configFilename != null) {
                        configuration = new Configuration(configFilename);
@@ -115,7 +114,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
 
        private void createActions() {
                for (final Locale locale: SUPPORTED_LOCALES) {
-                       languageActions.put(locale, new AbstractAction(I18n.getMessage("jsite.menu.language." + locale.getLanguage())) {
+                       languageActions.put(locale, new AbstractAction(I18n.getMessage("jsite.menu.language." + locale.getLanguage()), IconLoader.loadIcon("/flag-" + locale.getLanguage() + ".png")) {
 
                                public void actionPerformed(ActionEvent actionEvent) {
                                        switchLanguage(locale);
@@ -135,7 +134,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"));
@@ -172,7 +171,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"));
@@ -183,7 +182,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                }
                        }
                });
-               
+
                return menuBar;
        }
 
@@ -328,12 +327,14 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen
                                        return;
                                }
                        }
-                       if (!project.getFileOption(project.getIndexFile()).getContainer().equals("")) {
+                       String indexFile = project.getIndexFile();
+                       boolean hasIndexFile = (indexFile != null);
+                       if (hasIndexFile && !project.getFileOption(indexFile).getContainer().equals("")) {
                                if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.container-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
                                        return;
                                }
                        }
-                       if (!project.getFileOption(project.getIndexFile()).getMimeType().equals("text/html")) {
+                       if (hasIndexFile && !project.getFileOption(indexFile).getMimeType().equals("text/html")) {
                                if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.index-not-html"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
                                        return;
                                }
@@ -467,5 +468,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");
        }
-       
+
 }