Skip to content

Commit

Permalink
Adjustments for changes not caught during rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Berenz committed Jun 15, 2019
1 parent 5ee637b commit b826770
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/qz/printer/action/PrintPDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public void parseData(JSONArray printData, PrintOptions options) throws JSONExce
}

@Override
public PrintRequestAttributeSet applyDefaultSettings(PrintOptions.Pixel pxlOpts, PageFormat page) {
public PrintRequestAttributeSet applyDefaultSettings(PrintOptions.Pixel pxlOpts, PageFormat page, Media[] supported) {
if (pxlOpts.getOrientation() != null) {
//page orient does not set properly on pdfs with orientation requested attribute
page.setOrientation(pxlOpts.getOrientation().getAsOrientFormat());
}

return super.applyDefaultSettings(pxlOpts, page);
return super.applyDefaultSettings(pxlOpts, page, supported);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/qz/utils/ConnectionUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static String getUserAgent() {
getOS(),
getArch(),
Constants.ABOUT_TITLE.replaceAll("[^a-zA-Z]", ""),
Constants.VERSION.MAJOR_MINOR,
Constants.VERSION.getNormalVersion(),
System.getProperty("java.vm.specification.version")
);
log.debug("User agent string for URL requests: {}", userAgent);
Expand Down
14 changes: 9 additions & 5 deletions src/qz/utils/NetworkUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public class NetworkUtilities {
private static NetworkUtilities instance;

private ArrayList<Device> devices;
private Device primary;
private Device primaryDevice;


private NetworkUtilities(String hostname, int port) {
try { primary = new Device(getPrimaryInetAddress(hostname, port), true); }
try { primaryDevice = new Device(getPrimaryInetAddress(hostname, port), true); }
catch(SocketException ignore) {}
}

Expand Down Expand Up @@ -62,7 +62,7 @@ public static JSONArray getDevicesJSON(String hostname, int port) throws JSONExc
}

public static JSONObject getDeviceJSON(String hostname, int port) throws JSONException {
Device primary = getInstance(hostname, port).primary;
Device primary = getInstance(hostname, port).primaryDevice;

if (primary != null) {
return primary.toJSON();
Expand All @@ -78,7 +78,11 @@ private ArrayList<Device> gatherDevices() throws SocketException {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while(interfaces.hasMoreElements()) {
NetworkInterface iface = interfaces.nextElement();
devices.add(new Device(iface));

Device next = new Device(iface);
next.primary = next.equals(primaryDevice);

devices.add(next);
}
}

Expand All @@ -88,7 +92,7 @@ private ArrayList<Device> gatherDevices() throws SocketException {
private static InetAddress getPrimaryInetAddress(String hostname, int port) {
log.info("Initiating a temporary connection to \"{}:{}\" to determine main Network Interface", hostname, port);

try (Socket socket = new Socket()) {
try(Socket socket = new Socket()) {
socket.connect(new InetSocketAddress(hostname, port));

return socket.getLocalAddress();
Expand Down
30 changes: 0 additions & 30 deletions src/qz/utils/SemVer.java

This file was deleted.

0 comments on commit b826770

Please sign in to comment.