Skip to content

Commit

Permalink
fixed 204 response
Browse files Browse the repository at this point in the history
  • Loading branch information
subhra74 committed May 17, 2020
1 parent 9ba8261 commit fe50900
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/xdman/XDMApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

public class XDMApp implements DownloadListener, DownloadWindowListener, Comparator<String> {
public static final String GLOBAL_LOCK_FILE = ".xdm-global-lock";
public static final String APP_VERSION = "7.2.10";
public static final String APP_VERSION = "7.2.11";
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=";
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/xdman/monitoring/MonitoringSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private void on204(Request request, Response res) {
HeaderCollection headers = new HeaderCollection();
headers.setValue("Cache-Control", "max-age=0, no-cache, must-revalidate");
res.setHeaders(headers);
Logger.log("Response set for 204");
}

private void onVideo(Request request, Response res) throws UnsupportedEncodingException {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/xdman/monitoring/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public void write(OutputStream out) throws IOException {
if (body != null && body.length > 0) {
out.write(body);
}
} else {
out.write(buf.toString().getBytes());
}

out.flush();
Expand Down
13 changes: 5 additions & 8 deletions app/src/main/java/xdman/ui/components/AboutPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ public AboutPage(XDMFrame xframe) {
JLabel lblTitle = new JLabel(StringResource.get("FULL_NAME"));
lblTitle.setFont(FontResource.getBiggerFont());
lblTitle.setForeground(Color.WHITE);
lblTitle.setBounds(getScaledInt(15), y,
getScaledInt(350) - getScaledInt(30), h);
lblTitle.setBounds(getScaledInt(15), y, getScaledInt(350) - getScaledInt(30), h);
panel.add(lblTitle);

y += h;
y += getScaledInt(20);

String details = String.format(
"App version %s with runtime %s on %s\n\nCreated by: Subhra Das Gupta\n\n%s\nCopyright (C) 2020, All rights reserved.",
XDMApp.APP_VERSION, System.getProperty("java.version"),
System.getProperty("os.name"),
"https://github.com/subhra74/xdm");
"Version %s with Java %s on %s\n\nCreated by: Subhra Das Gupta\n\n%s\nCopyright (C) 2020, All rights reserved.",
XDMApp.APP_VERSION, (System.getProperty("java.vendor") + " " + System.getProperty("java.version")),
System.getProperty("os.name"), "https://github.com/subhra74/xdm");

h = getScaledInt(250);
JTextArea lblDetails = new JTextArea();
Expand All @@ -54,8 +52,7 @@ public AboutPage(XDMFrame xframe) {
lblDetails.setForeground(Color.WHITE);
lblDetails.setText(details);
lblDetails.setFont(FontResource.getBigFont());
lblDetails.setBounds(getScaledInt(15), y,
getScaledInt(350) - getScaledInt(30), h);
lblDetails.setBounds(getScaledInt(15), y, getScaledInt(350) - getScaledInt(30), h);
panel.add(lblDetails);
y += h;

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/xdman/ui/components/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ private void optimizeRWin() {
}

private void openTranslationPage() {
XDMUtils.browseURL("https://github.com/subhra74/xdm/translations");
XDMUtils.browseURL("https://github.com/subhra74/xdm/wiki/Submitting-translations-for-XDM");
}

private void openSupportPage() {
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/xdman/util/BrowserLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public class BrowserLauncher {
public static boolean launchFirefox(String args) {
int os = XDMUtils.detectOS();
if (os == XDMUtils.WINDOWS) {
File[] ffPaths = { new File(System.getenv("PROGRAMFILES"), "Mozilla Firefox\\firefox.exe"),
File[] ffPaths = { new File(System.getenv("ProgramW6432"), "Mozilla Firefox\\firefox.exe"),
new File(System.getenv("PROGRAMFILES"), "Mozilla Firefox\\firefox.exe"),
new File(System.getenv("PROGRAMFILES(X86)"), "Mozilla Firefox\\firefox.exe") };
for (int i = 0; i < ffPaths.length; i++) {
System.out.println(ffPaths[i]);
Expand All @@ -23,7 +24,7 @@ public static boolean launchFirefox(String args) {
}
}
}
if(os==XDMUtils.LINUX) {
if (os == XDMUtils.LINUX) {
File[] ffPaths = { new File("/usr/bin/firefox") };
for (int i = 0; i < ffPaths.length; i++) {
if (ffPaths[i].exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ private static final void installNativeMessagingHostForChrome(int os, boolean ch
return;
}
} else {
File manifestFolder = new File(os == XDMUtils.MAC ? (chromium ? CHROMIUM_MAC_LOCATION : CHROME_MAC_LOCATION)
: (chromium ? CHROMIUM_LINUX_LOCATION : CHROME_LINUX_LOCATION));
if (!manifestFolder.exists()) {
manifestFolder.mkdirs();
}
File manifestFile = new File(
os == XDMUtils.MAC ? (chromium ? CHROMIUM_MAC_LOCATION : CHROME_MAC_LOCATION)
: (chromium ? CHROMIUM_LINUX_LOCATION : CHROME_LINUX_LOCATION),
Expand Down Expand Up @@ -104,6 +109,10 @@ public static final void installNativeMessagingHostForFireFox(int os) {
return;
}
} else {
File manifestFolder = new File(os == XDMUtils.MAC ? FIREFOX_MAC_LOCATION : FIREFOX_LINUX_LOCATION);
if (!manifestFolder.exists()) {
manifestFolder.mkdirs();
}
File manifestFile = new File(os == XDMUtils.MAC ? FIREFOX_MAC_LOCATION : FIREFOX_LINUX_LOCATION,
"xdmff.native_host.json");
File nativeHostFile = new File(XDMUtils.getJarFile().getParentFile(),
Expand Down

0 comments on commit fe50900

Please sign in to comment.