private static boolean debug = false;
/** The version. */
- private static final Version VERSION = new Version(0, 6, 2);
+ private static final Version VERSION = new Version(0, 7);
/** The configuration. */
private Configuration configuration;
jSiteIcon = IconLoader.loadIcon("/jsite-icon.png");
wizard.setIcon(jSiteIcon);
- updateChecker = new UpdateChecker(wizard, freenetInterface);
+ updateChecker = new UpdateChecker(freenetInterface);
updateChecker.addUpdateListener(this);
updateChecker.start();
/**
* {@inheritDoc}
*/
+ @SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
- /* TODO */
+ showLatestUpdate();
}
};
aboutAction = new AbstractAction(I18n.getMessage("jsite.menu.help.about")) {
configuration.setLocale(supportedLocale);
}
+ /**
+ * Shows a dialog box that shows the last version that was found by the
+ * {@link UpdateChecker}.
+ */
+ private void showLatestUpdate() {
+ Version latestVersion = updateChecker.getLatestVersion();
+ int versionDifference = latestVersion.compareTo(VERSION);
+ if (versionDifference > 0) {
+ JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.newer.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
+ } else if (versionDifference < 0) {
+ JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.older.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.okay.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+
//
// INTERFACE ListSelectionListener
//
JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE);
return;
}
- if (project.getIndexFile() == null) {
+ if ((project.getIndexFile() == null) || (project.getIndexFile().length() == 0)) {
if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.empty-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
return;
}