Mercurial > hg > Applications > TreeVNC
changeset 219:1edc11b2e8e6
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 04 Jul 2014 23:35:42 +0900 |
parents | 3d7107b14595 |
children | 619abe65e4ff |
files | src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java |
diffstat | 1 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Fri Jul 04 19:55:42 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Fri Jul 04 23:35:42 2014 +0900 @@ -19,25 +19,18 @@ private void vncStart(String[] args) { modeSelect(args); - VncProxyService vps = null; if (treeProxy && !viewer) { - vps = new VncProxyService(); - vps.setNoConnection(noConnection); - vps.proxyStart(args,width,height, showTree); - vps.getRfb().setHasViewer(false); - if (!permitChangeScreen ) vps.getRfb().setPermitChangeScreen(false); - vps.getRfb().getAcceptThread().waitForShutdown(); + // start treeManager only ( -p flag ) + VncProxyService vps = new VncProxyService(); + rootStart(args,vps); return; } - ViewerInterface v; if (viewer) { - v = cui ? new CuiViewer() : new Viewer(); + ViewerInterface v = cui ? new CuiViewer() : new Viewer(); if (treeProxy) { - v.setNoConnection(noConnection); - v.proxyStart(args,width,height, showTree); - v.getRfb().setHasViewer(true); - if (!permitChangeScreen ) v.getRfb().setPermitChangeScreen(false); - v.getRfb().getAcceptThread().waitForShutdown(); + // this viewer also works as tree root ( display mode -d flag ) + // start with no connection waiting server change request + rootStart(args, v); } else { v.startTreeViewer(hostName,cui); } @@ -45,6 +38,14 @@ } + public void rootStart(String[] args, ViewerInterface v) { + v.setNoConnection(noConnection); // should we accept host name here? + v.proxyStart(args,width,height, showTree); + v.getRfb().setHasViewer(viewer); + if (!permitChangeScreen ) v.getRfb().setPermitChangeScreen(false); + v.getRfb().getAcceptThread().waitForShutdown(); + } + private void modeSelect(String[] args) { viewer = true; // default for (int i = 0; i < args.length; i++) {