diff --git a/nxtransport/jar/nxtransport.jar b/nxtransport/jar/nxtransport.jar index 8d3496ac..f8261e35 100644 Binary files a/nxtransport/jar/nxtransport.jar and b/nxtransport/jar/nxtransport.jar differ diff --git a/nxtransport/src/es/virtualcable/nx/MacApplet.java b/nxtransport/src/es/virtualcable/nx/MacApplet.java index 36ce7092..882b453a 100644 --- a/nxtransport/src/es/virtualcable/nx/MacApplet.java +++ b/nxtransport/src/es/virtualcable/nx/MacApplet.java @@ -6,10 +6,12 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.UUID; +// Adapted to Mac OS X Lion by Virginio + public class MacApplet implements OsApplet { - private final String[] paths = { "/Applications/NX Client for OSX.app/Contents/MacOS/" }; - private final String nxclient = "nxclient"; + private final String[] paths = { "/Applications/OpenNX/OpenNX.app/Contents/MacOS/" }; + private final String app = "OpenNXapp"; private Hashtable params; private String tmpDir = ""; @@ -17,6 +19,7 @@ public class MacApplet implements OsApplet { private String nxFileName = ""; private String scrWidth; private String scrHeight; + private String msg; public void start() { tmpDir = System.getProperty("java.io.tmpdir") + File.separator; @@ -51,6 +54,7 @@ public class MacApplet implements OsApplet { } catch (IOException e) { javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); e.printStackTrace(); + msg = "DISK_WRITE_ERROR"; return; } @@ -58,25 +62,27 @@ public class MacApplet implements OsApplet { for(int i = 0; i < paths.length; i++ ) { - File f = new File(paths[i] + nxclient); + File f = new File(paths[i] + app); if( f.exists() ) { - execPath = paths[i] + nxclient; + execPath = paths[i] + app; break; } } if( execPath.length() == 0 ) { - javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /Applications/NX Client for OSX.app/Contents/MacOS/\nPlease, install it"); - System.err.println("Can't find nxclient."); + javax.swing.JOptionPane.showMessageDialog(null, "Can't find OpenNX. Install it from http://opennx.net/"); + System.err.println("Can't find OpenNX executable"); + msg = "PROGRAM_NOT_FOUND"; return; } ArrayList exec = new ArrayList(); exec.add(execPath); - exec.add("--session"); - exec.add(nxFileName); + exec.add("--session=" + nxFileName); + exec.add("--autologin"); + exec.add("--killerrors"); try { ProcessBuilder pb = new ProcessBuilder(exec); @@ -84,6 +90,7 @@ public class MacApplet implements OsApplet { } catch(Exception e) { javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); e.printStackTrace(); + msg = "APPLET_ERROR"; return; } } @@ -104,4 +111,8 @@ public class MacApplet implements OsApplet { scrHeight = Integer.toString(screenHeight); } + public String getMessage() { + return msg; + } + }