blob: b2a4edd1896a8b2b977a298c459383020456e316 (
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
59
|
package org.openslx.dozmod.gui.window;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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;
public class CheckUpdateWindow extends CheckUpdateWindowLayout implements UiFeedback, ActionListener {
/**
* Version for serialization.
*/
private static final long serialVersionUID = 3992160915138023046L;
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();
}
}
|