/*
- * jSite - Main.java - Copyright © 2006–2012 David Roden
+ * jSite - Main.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
import javax.swing.event.ListSelectionListener;
import net.pterodactylus.util.image.IconLoader;
+
import de.todesbaum.jsite.application.Freenet7Interface;
import de.todesbaum.jsite.application.Node;
import de.todesbaum.jsite.application.Project;
-import de.todesbaum.jsite.application.ProjectInserter;
-import de.todesbaum.jsite.application.ProjectInserter.CheckReport;
-import de.todesbaum.jsite.application.ProjectInserter.Issue;
import de.todesbaum.jsite.application.UpdateChecker;
import de.todesbaum.jsite.application.UpdateListener;
import de.todesbaum.jsite.application.WebOfTrustInterface;
+import de.todesbaum.jsite.application.validation.CheckReport;
+import de.todesbaum.jsite.application.validation.Issue;
+import de.todesbaum.jsite.application.validation.ProjectValidator;
import de.todesbaum.jsite.gui.NodeManagerListener;
import de.todesbaum.jsite.gui.NodeManagerPage;
import de.todesbaum.jsite.gui.PreferencesPage;
import de.todesbaum.jsite.i18n.I18n;
import de.todesbaum.jsite.i18n.I18nContainer;
import de.todesbaum.jsite.main.ConfigurationLocator.ConfigurationLocation;
+import de.todesbaum.jsite.main.JarFileLocator.DefaultJarFileLocator;
import de.todesbaum.util.swing.TWizard;
import de.todesbaum.util.swing.TWizardPage;
import de.todesbaum.util.swing.WizardListener;
private static final Logger logger = Logger.getLogger(Main.class.getName());
/** The version. */
- private static final Version VERSION = new Version(0, 11);
+ private static final Version VERSION = new Version(0, 13);
/** The configuration. */
private Configuration configuration;
}
/** The supported locales. */
- private static final Locale[] SUPPORTED_LOCALES = new Locale[] { Locale.ENGLISH, Locale.GERMAN, Locale.FRENCH, new Locale("pl") };
+ private static final Locale[] SUPPORTED_LOCALES = new Locale[] {
+ Locale.ENGLISH,
+ Locale.GERMAN,
+ Locale.FRENCH,
+ Locale.ITALIAN,
+ new Locale("es"),
+ new Locale("pl"),
+ new Locale("fi")
+ };
/** The actions that switch the language. */
private Map<Locale, Action> languageActions = new HashMap<Locale, Action>();
*/
private Main(String configFilename) {
/* collect all possible configuration file locations. */
- ConfigurationLocator configurationLocator = new ConfigurationLocator();
+ ConfigurationLocator configurationLocator = new ConfigurationLocator(new DefaultJarFileLocator(getClass().getClassLoader()));
if (configFilename != null) {
configurationLocator.setCustomLocation(configFilename);
}
jSiteIcon = IconLoader.loadIcon("/jsite-icon.png");
wizard.setIcon(jSiteIcon);
- updateChecker = new UpdateChecker(freenetInterface);
+ updateChecker = new UpdateChecker(freenetInterface, getVersion());
updateChecker.addUpdateListener(this);
updateChecker.start();
webOfTrustInterface = new WebOfTrustInterface(freenetInterface);
- webOfTrustInterface.start();
initPages();
showPage(PageType.PAGE_PROJECTS);
((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setHasCustomConfiguration(configuration.getConfigurationLocator().isValidLocation(ConfigurationLocation.CUSTOM));
((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setUseEarlyEncode(configuration.useEarlyEncode());
((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setPriority(configuration.getPriority());
- ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setManifestPutter(configuration.getManifestPutter());
showPage(PageType.PAGE_PREFERENCES);
optionsPreferencesAction.setEnabled(false);
wizard.setNextEnabled(true);
*/
private void quit() {
updateChecker.stop();
- webOfTrustInterface.stop();
System.exit(0);
}
JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.error.no-node-selected"), null, JOptionPane.ERROR_MESSAGE);
return;
}
- CheckReport checkReport = ProjectInserter.validateProject(project);
+ CheckReport checkReport = ProjectValidator.validateProject(project);
for (Issue issue : checkReport) {
if (issue.isFatal()) {
JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite." + issue.getErrorKey()), (Object[]) issue.getParameters()), null, JOptionPane.ERROR_MESSAGE);
projectInsertPage.setTempDirectory(tempDirectory);
projectInsertPage.setUseEarlyEncode(configuration.useEarlyEncode());
projectInsertPage.setPriority(configuration.getPriority());
- projectInsertPage.setManifestPutter(configuration.getManifestPutter());
projectInsertPage.startInsert();
nodeMenu.setEnabled(false);
optionsPreferencesAction.setEnabled(false);
optionsPreferencesAction.setEnabled(true);
configuration.setUseEarlyEncode(preferencesPage.useEarlyEncode());
configuration.setPriority(preferencesPage.getPriority());
- configuration.setManifestPutter(preferencesPage.getManifestPutter());
configuration.setConfigurationLocation(preferencesPage.getConfigurationLocation());
}
}