X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FMain.java;h=a6ac5594dc098af76426de122ad28536f8bab281;hb=0f1855d94540e29163a648d6004e2331ecf9f5b2;hp=1c6e8de19dfbf2c49c88314c0bf3c3cc36a9ef82;hpb=09151c7de967b7ce409fc10e08e5bd3448eb80dc;p=jSite.git diff --git a/src/main/java/de/todesbaum/jsite/main/Main.java b/src/main/java/de/todesbaum/jsite/main/Main.java index 1c6e8de..a6ac559 100644 --- a/src/main/java/de/todesbaum/jsite/main/Main.java +++ b/src/main/java/de/todesbaum/jsite/main/Main.java @@ -1,5 +1,5 @@ /* - * 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 @@ -80,7 +80,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen private static final Logger logger = Logger.getLogger(Main.class.getName()); /** The version. */ - private static final Version VERSION = new Version(0, 10); + private static final Version VERSION = new Version(0, 12); /** The configuration. */ private Configuration configuration; @@ -122,7 +122,14 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen } /** The supported locales. */ - 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"), + new Locale("fi") + }; /** The actions that switch the language. */ private Map languageActions = new HashMap(); @@ -190,12 +197,11 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen 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); @@ -341,6 +347,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen projectPage.setName("page.project"); projectPage.setProjects(configuration.getProjects()); projectPage.setFreenetInterface(freenetInterface); + projectPage.setWebOfTrustInterface(webOfTrustInterface); projectPage.addListSelectionListener(this); pages.put(PageType.PAGE_PROJECTS, projectPage); @@ -477,7 +484,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen ((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); @@ -500,6 +506,14 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen } } + /** + * Quits jSite, stopping all background services. + */ + private void quit() { + updateChecker.stop(); + System.exit(0); + } + // // INTERFACE ListSelectionListener // @@ -574,7 +588,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen projectInsertPage.setTempDirectory(tempDirectory); projectInsertPage.setUseEarlyEncode(configuration.useEarlyEncode()); projectInsertPage.setPriority(configuration.getPriority()); - projectInsertPage.setManifestPutter(configuration.getManifestPutter()); projectInsertPage.startInsert(); nodeMenu.setEnabled(false); optionsPreferencesAction.setEnabled(false); @@ -593,7 +606,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen optionsPreferencesAction.setEnabled(true); configuration.setUseEarlyEncode(preferencesPage.useEarlyEncode()); configuration.setPriority(preferencesPage.getPriority()); - configuration.setManifestPutter(preferencesPage.getManifestPutter()); configuration.setConfigurationLocation(preferencesPage.getConfigurationLocation()); } } @@ -627,21 +639,21 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen int overwriteConfigurationAnswer = JOptionPane.showConfirmDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.quit.overwrite-configuration"), configuration.getConfigurationLocator().getFile(configuration.getConfigurationDirectory())), I18n.getMessage("jsite.quit.overwrite-configuration.title"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (overwriteConfigurationAnswer == JOptionPane.YES_OPTION) { if (saveConfiguration()) { - System.exit(0); + quit(); } } else if (overwriteConfigurationAnswer == JOptionPane.CANCEL_OPTION) { return; } if (overwriteConfigurationAnswer == JOptionPane.NO_OPTION) { - System.exit(0); + quit(); } } else { if (saveConfiguration()) { - System.exit(0); + quit(); } } if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.quit.config-not-saved"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION) { - System.exit(0); + quit(); } } }