diff src/viewer_swing/java/com/glavsoft/viewer/Viewer.java @ 377:877008c86e85

Add direct option
author innparusu
date Mon, 31 Aug 2015 17:04:36 +0900
parents bd74b2406775
children ea324e42bc78
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java	Thu Aug 27 20:10:43 2015 +0900
+++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java	Mon Aug 31 17:04:36 2015 +0900
@@ -305,6 +305,10 @@
         myRfb.setCuiVersion(flag);
     }
 
+    public void setVncport(int vncport) {
+        this.vncport = vncport;
+    }
+
     /**
      * start new VNC server receiver with
      * inherited clients
@@ -357,7 +361,7 @@
         rfb.getAcceptThread().waitForShutdown();
     }
 
-    public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay) {
+    public void proxyStart(String[] argv, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay) {
         fbWidth = width;
         this.showTree = showTree;
         // input into arguments Decision
@@ -369,7 +373,6 @@
             printUsage(parser.optionsUsage());
             System.exit(0);
         }
-        String hostname = "localhost";
         TreeRFBProto rfb = new TreeRFBProto(true, this);
         myRfb = rfb;
         rfb.setShowTree(showTree);
@@ -385,7 +388,10 @@
         rfb.setHasViewer(true); // this flag will be overwrited after this method. Do we have to set here?
         rfb.createConnectionAndStart(this);
         setIsTreeVNC(true);
-        connectionParams.setConnectionParam(hostname, vncport);
+        if (hostName == null) {
+            hostName = "localhost";
+        }
+        connectionParams.setConnectionParam(hostName, vncport);
         isApplet = true;
         settings.setViewOnly(true); // too avoid unnecessary upward traffic