import de.todesbaum.jsite.gui.ProjectFilesPage;
import de.todesbaum.jsite.gui.ProjectInsertPage;
import de.todesbaum.jsite.gui.ProjectPage;
+import de.todesbaum.jsite.gui.UpdateChecker;
import de.todesbaum.jsite.i18n.I18n;
import de.todesbaum.jsite.i18n.I18nContainer;
import de.todesbaum.util.image.IconLoader;
/** Whether the debug mode is activated. */
private static boolean debug = false;
- /** The URL for update checks. */
- private static final String UPDATE_KEY = "USK@e3myoFyp5avg6WYN16ImHri6J7Nj8980Fm~aQe4EX1U,QvbWT0ImE0TwLODTl7EoJx2NBnwDxTbLTE6zkB-eGPs,AQACAAE/jSite/0/currentVersion.txt";
+ /** The version. */
+ private static final Version VERSION = new Version(0, 6, 2);
/** The configuration. */
private Configuration configuration;
/** The freenet interface. */
private Freenet7Interface freenetInterface = new Freenet7Interface();
+ /** The update checker. */
+ private final UpdateChecker updateChecker;
+
/** The jSite icon. */
private Icon jSiteIcon;
if (!configuration.createLockFile()) {
int option = JOptionPane.showOptionDialog(null, I18n.getMessage("jsite.main.already-running"), "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[] { I18n.getMessage("jsite.main.already-running.override"), I18n.getMessage("jsite.wizard.quit") }, I18n.getMessage("jsite.wizard.quit"));
if (option != 0) {
- return;
+ throw new IllegalStateException("Lockfile override not active, refusing start.");
}
configuration.removeLockfileOnExit();
}
jSiteIcon = IconLoader.loadIcon("/jsite-icon.png");
wizard.setIcon(jSiteIcon);
+ updateChecker = new UpdateChecker(wizard, freenetInterface);
+
initPages();
showPage(PageType.PAGE_PROJECTS);
}
*/
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
- checkForUpdates();
+ updateChecker.checkForUpdates();
}
};
aboutAction = new AbstractAction(I18n.getMessage("jsite.menu.help.about")) {
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent e) {
- JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.about.message"), Version.getVersion()), null, JOptionPane.INFORMATION_MESSAGE, jSiteIcon);
+ JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.about.message"), getVersion().toString()), null, JOptionPane.INFORMATION_MESSAGE, jSiteIcon);
}
};
final JMenu helpMenu = new JMenu(I18n.getMessage("jsite.menu.help"));
menuBar.add(helpMenu);
+ helpMenu.add(checkForUpdatesAction);
helpMenu.add(aboutAction);
I18nContainer.getInstance().registerRunnable(new Runnable() {
return SUPPORTED_LOCALES[0];
}
+ /**
+ * Returns the version.
+ *
+ * @return The version
+ */
+ public static final Version getVersion() {
+ return VERSION;
+ }
+
//
// ACTIONS
//
configuration.setLocale(supportedLocale);
}
- /**
- * Checks for updates of jSite.
- */
- private void checkForUpdates() {
-
- }
-
//
// INTERFACE ListSelectionListener
//