blob: b3c8ae054470be230b4a2c760a3aca21dc81702a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package org.openslx.dozmod.gui.window;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.apache.log4j.Logger;
import org.openslx.dozmod.gui.helper.UiFeedback;
import org.openslx.dozmod.gui.window.layout.CheckUpdateWindowLayout;
import org.openslx.dozmod.util.ClientVersion;
import org.openslx.dozmod.util.FormatHelper;
import org.openslx.dozmod.util.DesktopEnvironment;
import org.openslx.dozmod.util.DesktopEnvironment.Link;
@SuppressWarnings("serial")
public class CheckUpdateWindow extends CheckUpdateWindowLayout implements UiFeedback, ActionListener {
private final static Logger LOGGER = Logger.getLogger(CheckUpdateWindow.class);
public CheckUpdateWindow(Window modalParent) {
super(modalParent);
btnClose.addActionListener(this);
btnLink.addActionListener(this);
lblLocalVersion.setText(ClientVersion.getLocalRevision() + " ("
+ FormatHelper.longDate(ClientVersion.getLocalRevTimestamp()) + ")");
lblRemoteVersion.setText(ClientVersion.getRemoteRevision() + " ("
+ FormatHelper.longDate(ClientVersion.getRemoteRevTimestamp()) + ")");
txtChangelog.setText(ClientVersion.getChangelog());
txtChangelog.setCaretPosition(0);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnLink) {
DesktopEnvironment.openWebpage(Link.DOZMOD);
}
if (e.getSource() == btnClose) {
dispose();
}
}
public static void open(Window modalParent) {
new CheckUpdateWindow(modalParent).setVisible(true);
}
@Override
public boolean wantConfirmQuit() {
return false;
}
@Override
public void escapePressed() {
dispose();
}
}
|