X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FMain.java;h=cc65c3d3cc22e3106b30c2154109b3994e7c62d9;hb=442a672236ca1138ac5f473ed2a5e6f14dad9511;hp=b760a79e1001bcca4590356fc26d9a105d98a86f;hpb=e69e1839a502d4140d253ffca42aa2e65ed71af5;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index b760a79..cc65c3d 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -208,8 +208,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen /** * {@inheritDoc} */ + @SuppressWarnings("synthetic-access") public void actionPerformed(ActionEvent actionEvent) { - /* TODO */ + showLatestUpdate(); } }; aboutAction = new AbstractAction(I18n.getMessage("jsite.menu.help.about")) { @@ -404,6 +405,22 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen 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 //