minor fixes

master
subhra74 2020-03-18 19:52:31 +01:00
parent d10caae33c
commit f964caaa17
5 changed files with 23 additions and 15 deletions

View File

@ -64,6 +64,12 @@ public class XDMApp implements DownloadListener, DownloadWindowListener,
public static final String APP_VERSION = "7.2.10";
public static final String XDM_WINDOW_TITLE = "XDM 2020";
public static final String APP_UPDAT_URL = "https://api.github.com/repos/subhra74/xdm/releases/latest";
public static final String APP_UPDATE_CHK_URL = "https://subhra74.github.io/xdm/update-checker.html?v=";
public static final String APP_WIKI_URL = "https://github.com/subhra74/xdm/wiki";
public static final String APP_HOME_URL = "https://github.com/subhra74/xdm";
public static final String APP_TWITTER_URL = "https://twitter.com/XDM_subhra74";
public static final String APP_FACEBOOK_URL = "https://www.facebook.com/XDM.subhra74/";
private ArrayList<ListChangeListener> listChangeListeners;
private Map<String, DownloadEntry> downloads;

View File

@ -325,13 +325,12 @@ public class MainWindow extends XDMFrame implements ActionListener {
XDMApp.getInstance().saveDownloadList(file);
}
} else if ("MENU_CONTENTS".equals(name)) {
XDMUtils.browseURL("https://github.com/subhra74/xdm/wiki");
XDMUtils.browseURL(XDMApp.APP_WIKI_URL);
} else if ("MENU_HOME_PAGE".equals(name)) {
XDMUtils.browseURL("https://github.com/subhra74/xdm");
XDMUtils.browseURL(XDMApp.APP_HOME_URL);
} else if ("MENU_UPDATE".equals(name)) {
XDMUtils.browseURL(
"https://subhra74.github.io/xdm/update-checker.html?v="
+ XDMApp.APP_VERSION);
XDMApp.APP_UPDATE_CHK_URL + XDMApp.APP_VERSION);
} else if ("MENU_LANG".equals(name)) {
showLanguageDlg();
} else if ("MENU_BATCH_DOWNLOAD".equals(name)) {
@ -918,9 +917,9 @@ public class MainWindow extends XDMFrame implements ActionListener {
showTwitterIcon = true;
showFBIcon = true;
showGitHubIcon = true;
fbUrl = "https://www.facebook.com/XDM.subhra74/";
twitterUrl = "https://twitter.com/XDM_subhra74";
gitHubUrl = "https://github.com/subhra74/xdm";
fbUrl = XDMApp.APP_FACEBOOK_URL;
twitterUrl = XDMApp.APP_TWITTER_URL;
gitHubUrl = XDMApp.APP_HOME_URL;
JLabel lblTitle = new JLabel(XDMApp.XDM_WINDOW_TITLE);
lblTitle.setBorder(new EmptyBorder(scale(20), scale(20), scale(20), 0));

View File

@ -144,7 +144,7 @@ public class TrayHandler {
popup.add(restoreItem);
popup.add(throttleItem);
popup.add(exitItem);
trayIcon.setToolTip("XDM 2018");
trayIcon.setToolTip(XDMApp.XDM_WINDOW_TITLE);
trayIcon.setPopupMenu(popup);
trayIcon.addMouseListener(new MouseAdapter() {

View File

@ -18,6 +18,7 @@ import xdman.util.FFmpegDownloader;
import xdman.util.UpdateChecker;
import xdman.util.XDMUtils;
import static xdman.util.XDMUtils.getScaledInt;
public class UpdateNotifyPanel extends JPanel {
/**
*
@ -28,7 +29,8 @@ public class UpdateNotifyPanel extends JPanel {
public UpdateNotifyPanel() {
super(new BorderLayout());
setBorder(new EmptyBorder(getScaledInt(10), getScaledInt(15), getScaledInt(10), getScaledInt(15)));
setBorder(new EmptyBorder(getScaledInt(10), getScaledInt(15),
getScaledInt(10), getScaledInt(15)));
JPanel p2 = new JPanel(new BorderLayout());
p2.setOpaque(false);
lbl = new JLabel();
@ -47,7 +49,8 @@ public class UpdateNotifyPanel extends JPanel {
@Override
public void actionPerformed(ActionEvent e) {
if (mode == UpdateChecker.APP_UPDATE_AVAILABLE) {
XDMUtils.browseURL("http://xdman.sourceforge.net/update/update.php?ver=" + XDMApp.APP_VERSION);
XDMUtils.browseURL(
XDMApp.APP_UPDATE_CHK_URL + XDMApp.APP_VERSION);
} else {
FFmpegDownloader fd = new FFmpegDownloader();
fd.start();
@ -60,7 +63,7 @@ public class UpdateNotifyPanel extends JPanel {
public void setDetails(int mode) {
if (mode == UpdateChecker.COMP_NOT_INSTALLED) {
setBackground(new Color(216,1,0));
setBackground(new Color(216, 1, 0));
} else {
setBackground(ColorResource.getDarkestBgColor());
}

View File

@ -12,8 +12,7 @@ import xdman.network.http.JavaHttpClient;
import xdman.network.http.XDMHttpClient;
public class UpdateChecker {
private static final String APP_UPDAT_URL = "https://api.github.com/repos/subhra74/xdm/releases/latest",
COMPONENTS_UPDATE_URL = "http://xdman.sourceforge.net/components/update_check.php";
public static final int APP_UPDATE_AVAILABLE = 10,
COMP_UPDATE_AVAILABLE = 20, COMP_NOT_INSTALLED = 30,
NO_UPDATE_AVAILABLE = 40;
@ -89,7 +88,8 @@ public class UpdateChecker {
private static boolean isUpdateAvailable(String version) {
JavaHttpClient client = null;
try {
client = new JavaHttpClient(APP_UPDAT_URL + "?ver=" + version);
client = new JavaHttpClient(
XDMApp.APP_UPDAT_URL + "?ver=" + version);
client.setFollowRedirect(true);
client.connect();
int resp = client.getStatusCode();
@ -118,7 +118,7 @@ public class UpdateChecker {
private static boolean isNewerVersion(StringBuilder text, String v2) {
try {
//System.out.println(text);
// System.out.println(text);
Matcher matcher = PATTERN_TAG.matcher(text);
if (matcher.find()) {
String v1 = matcher.group(1);