X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FMain.java;h=f1948f3a1f4e4e8b21a43f62fb59039fa11a60c3;hb=250630a5fb1ff745f05788210a6efd976533fb55;hp=aca9f73da1525a06d3e29b2233688ca8c63b6116;hpb=705ab7eee0d2b8194f6e8420ce3f588899f6da9a;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index aca9f73..f1948f3 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -60,8 +60,7 @@ import de.todesbaum.util.swing.TWizardPage; import de.todesbaum.util.swing.WizardListener; /** - * @author David Roden - * @version $Id$ + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ 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 languageActions = new HashMap(); protected Action manageNodeAction; protected Action aboutAction; @@ -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); @@ -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; }