46b16c964e0a220103fa84d8a38e728a4428b7f7
[jSite.git] / src / de / todesbaum / jsite / gui / UpdateChecker.java
1 /*
2  * jSite-remote - UpdateChecker.java -
3  * Copyright © 2008 David Roden
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 package de.todesbaum.jsite.gui;
21
22 import java.awt.event.ActionEvent;
23
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;
29
30 import de.todesbaum.jsite.application.Freenet7Interface;
31 import de.todesbaum.jsite.i18n.I18n;
32
33 /**
34  * Checks for newer versions of jSite.
35  *
36  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
37  */
38 public class UpdateChecker extends JDialog {
39
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";
43
44         /** The freenet interface. */
45         @SuppressWarnings("unused")
46         private final Freenet7Interface freenetInterface;
47
48         /** The cancel action. */
49         @SuppressWarnings("unused")
50         private Action cancelAction;
51
52         /**
53          * Creates a new update checker that uses the given frame as its parent and
54          * communications via the given freenet interface.
55          *
56          * @param parent
57          *            The parent of the dialog
58          * @param freenetInterface
59          *            The freenet interface
60          */
61         public UpdateChecker(JFrame parent, Freenet7Interface freenetInterface) {
62                 super(parent);
63                 this.freenetInterface = freenetInterface;
64                 initActions();
65         }
66
67         //
68         // ACTIONS
69         //
70
71         /**
72          * Checks for updates, showing a dialog with an indeterminate progress bar.
73          */
74         public void checkForUpdates() {
75                 /* TODO */
76         }
77
78         //
79         // PRIVATE METHODS
80         //
81
82         /**
83          * Initializes all actions.
84          */
85         private void initActions() {
86                 cancelAction = new AbstractAction(I18n.getMessage("")) {
87
88                         /**
89                          * {@inheritDoc}
90                          */
91                         public void actionPerformed(ActionEvent actionEvent) {
92                                 /* TODO */
93                         }
94                 };
95         }
96
97         /**
98          * A panel that shows a busy progress bar and a “please wait” message.
99          *
100          * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
101          */
102         @SuppressWarnings("unused")
103         private class BusyPanel extends JPanel {
104
105                 /* TODO */
106
107         }
108
109 }