2 * jSite-remote - UpdateChecker.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package de.todesbaum.jsite.gui;
22 import java.awt.event.ActionEvent;
24 import javax.swing.AbstractAction;
25 import javax.swing.Action;
26 import javax.swing.JDialog;
27 import javax.swing.JFrame;
28 import javax.swing.JPanel;
30 import de.todesbaum.jsite.application.Freenet7Interface;
31 import de.todesbaum.jsite.i18n.I18n;
34 * Checks for newer versions of jSite.
36 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
38 public class UpdateChecker extends JDialog {
40 /** The URL for update checks. */
41 @SuppressWarnings("unused")
42 private static final String UPDATE_KEY = "USK@e3myoFyp5avg6WYN16ImHri6J7Nj8980Fm~aQe4EX1U,QvbWT0ImE0TwLODTl7EoJx2NBnwDxTbLTE6zkB-eGPs,AQACAAE/jSite/0/currentVersion.txt";
44 /** The freenet interface. */
45 @SuppressWarnings("unused")
46 private final Freenet7Interface freenetInterface;
48 /** The cancel action. */
49 @SuppressWarnings("unused")
50 private Action cancelAction;
53 * Creates a new update checker that uses the given frame as its parent and
54 * communications via the given freenet interface.
57 * The parent of the dialog
58 * @param freenetInterface
59 * The freenet interface
61 public UpdateChecker(JFrame parent, Freenet7Interface freenetInterface) {
63 this.freenetInterface = freenetInterface;
72 * Checks for updates, showing a dialog with an indeterminate progress bar.
74 public void checkForUpdates() {
83 * Initializes all actions.
85 private void initActions() {
86 cancelAction = new AbstractAction(I18n.getMessage("")) {
91 public void actionPerformed(ActionEvent actionEvent) {
98 * A panel that shows a busy progress bar and a “please wait” message.
100 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
102 @SuppressWarnings("unused")
103 private class BusyPanel extends JPanel {