Skip to content

Commit f964caa

Browse files
author
subhra74
committed
minor fixes
1 parent d10caae commit f964caa

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

app/src/main/java/xdman/XDMApp.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ public class XDMApp implements DownloadListener, DownloadWindowListener,
6464

6565
public static final String APP_VERSION = "7.2.10";
6666
public static final String XDM_WINDOW_TITLE = "XDM 2020";
67+
public static final String APP_UPDAT_URL = "https://api.github.com/repos/subhra74/xdm/releases/latest";
68+
public static final String APP_UPDATE_CHK_URL = "https://subhra74.github.io/xdm/update-checker.html?v=";
69+
public static final String APP_WIKI_URL = "https://github.com/subhra74/xdm/wiki";
70+
public static final String APP_HOME_URL = "https://github.com/subhra74/xdm";
71+
public static final String APP_TWITTER_URL = "https://twitter.com/XDM_subhra74";
72+
public static final String APP_FACEBOOK_URL = "https://www.facebook.com/XDM.subhra74/";
6773

6874
private ArrayList<ListChangeListener> listChangeListeners;
6975
private Map<String, DownloadEntry> downloads;

app/src/main/java/xdman/ui/components/MainWindow.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,12 @@ public void actionPerformed(ActionEvent e) {
325325
XDMApp.getInstance().saveDownloadList(file);
326326
}
327327
} else if ("MENU_CONTENTS".equals(name)) {
328-
XDMUtils.browseURL("https://github.com/subhra74/xdm/wiki");
328+
XDMUtils.browseURL(XDMApp.APP_WIKI_URL);
329329
} else if ("MENU_HOME_PAGE".equals(name)) {
330-
XDMUtils.browseURL("https://github.com/subhra74/xdm");
330+
XDMUtils.browseURL(XDMApp.APP_HOME_URL);
331331
} else if ("MENU_UPDATE".equals(name)) {
332332
XDMUtils.browseURL(
333-
"https://subhra74.github.io/xdm/update-checker.html?v="
334-
+ XDMApp.APP_VERSION);
333+
XDMApp.APP_UPDATE_CHK_URL + XDMApp.APP_VERSION);
335334
} else if ("MENU_LANG".equals(name)) {
336335
showLanguageDlg();
337336
} else if ("MENU_BATCH_DOWNLOAD".equals(name)) {
@@ -918,9 +917,9 @@ private void initWindow() {
918917
showTwitterIcon = true;
919918
showFBIcon = true;
920919
showGitHubIcon = true;
921-
fbUrl = "https://www.facebook.com/XDM.subhra74/";
922-
twitterUrl = "https://twitter.com/XDM_subhra74";
923-
gitHubUrl = "https://github.com/subhra74/xdm";
920+
fbUrl = XDMApp.APP_FACEBOOK_URL;
921+
twitterUrl = XDMApp.APP_TWITTER_URL;
922+
gitHubUrl = XDMApp.APP_HOME_URL;
924923

925924
JLabel lblTitle = new JLabel(XDMApp.XDM_WINDOW_TITLE);
926925
lblTitle.setBorder(new EmptyBorder(scale(20), scale(20), scale(20), 0));

app/src/main/java/xdman/ui/components/TrayHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void itemStateChanged(ItemEvent e) {
144144
popup.add(restoreItem);
145145
popup.add(throttleItem);
146146
popup.add(exitItem);
147-
trayIcon.setToolTip("XDM 2018");
147+
trayIcon.setToolTip(XDMApp.XDM_WINDOW_TITLE);
148148
trayIcon.setPopupMenu(popup);
149149

150150
trayIcon.addMouseListener(new MouseAdapter() {

app/src/main/java/xdman/ui/components/UpdateNotifyPanel.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import xdman.util.UpdateChecker;
1919
import xdman.util.XDMUtils;
2020
import static xdman.util.XDMUtils.getScaledInt;
21+
2122
public class UpdateNotifyPanel extends JPanel {
2223
/**
2324
*
@@ -28,7 +29,8 @@ public class UpdateNotifyPanel extends JPanel {
2829

2930
public UpdateNotifyPanel() {
3031
super(new BorderLayout());
31-
setBorder(new EmptyBorder(getScaledInt(10), getScaledInt(15), getScaledInt(10), getScaledInt(15)));
32+
setBorder(new EmptyBorder(getScaledInt(10), getScaledInt(15),
33+
getScaledInt(10), getScaledInt(15)));
3234
JPanel p2 = new JPanel(new BorderLayout());
3335
p2.setOpaque(false);
3436
lbl = new JLabel();
@@ -47,7 +49,8 @@ public UpdateNotifyPanel() {
4749
@Override
4850
public void actionPerformed(ActionEvent e) {
4951
if (mode == UpdateChecker.APP_UPDATE_AVAILABLE) {
50-
XDMUtils.browseURL("http://xdman.sourceforge.net/update/update.php?ver=" + XDMApp.APP_VERSION);
52+
XDMUtils.browseURL(
53+
XDMApp.APP_UPDATE_CHK_URL + XDMApp.APP_VERSION);
5154
} else {
5255
FFmpegDownloader fd = new FFmpegDownloader();
5356
fd.start();
@@ -60,7 +63,7 @@ public void actionPerformed(ActionEvent e) {
6063

6164
public void setDetails(int mode) {
6265
if (mode == UpdateChecker.COMP_NOT_INSTALLED) {
63-
setBackground(new Color(216,1,0));
66+
setBackground(new Color(216, 1, 0));
6467
} else {
6568
setBackground(ColorResource.getDarkestBgColor());
6669
}

app/src/main/java/xdman/util/UpdateChecker.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
import xdman.network.http.XDMHttpClient;
1313

1414
public class UpdateChecker {
15-
private static final String APP_UPDAT_URL = "https://api.github.com/repos/subhra74/xdm/releases/latest",
16-
COMPONENTS_UPDATE_URL = "http://xdman.sourceforge.net/components/update_check.php";
15+
1716
public static final int APP_UPDATE_AVAILABLE = 10,
1817
COMP_UPDATE_AVAILABLE = 20, COMP_NOT_INSTALLED = 30,
1918
NO_UPDATE_AVAILABLE = 40;
@@ -89,7 +88,8 @@ public boolean accept(File dir, String name) {
8988
private static boolean isUpdateAvailable(String version) {
9089
JavaHttpClient client = null;
9190
try {
92-
client = new JavaHttpClient(APP_UPDAT_URL + "?ver=" + version);
91+
client = new JavaHttpClient(
92+
XDMApp.APP_UPDAT_URL + "?ver=" + version);
9393
client.setFollowRedirect(true);
9494
client.connect();
9595
int resp = client.getStatusCode();
@@ -118,7 +118,7 @@ private static boolean isUpdateAvailable(String version) {
118118

119119
private static boolean isNewerVersion(StringBuilder text, String v2) {
120120
try {
121-
//System.out.println(text);
121+
// System.out.println(text);
122122
Matcher matcher = PATTERN_TAG.matcher(text);
123123
if (matcher.find()) {
124124
String v1 = matcher.group(1);

0 commit comments

Comments
 (0)