# HG changeset patch # User innparusu # Date 1439200058 -32400 # Node ID 6558eb66ac8e19daf0b025e3041c3f58f5bd49a1 # Parent 101a32eb084f5847cb48c56dedbcc11cd571979e# Parent bc5624e3e9c5ef87766613727413d47297393c4d Merge diff -r 101a32eb084f -r 6558eb66ac8e TreeVNC.iml diff -r 101a32eb084f -r 6558eb66ac8e src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java --- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Aug 10 18:46:18 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Aug 10 18:47:38 2015 +0900 @@ -136,21 +136,8 @@ final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || !isApplet; - connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + ConnectionPresenter connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); connectionPresenter.addModel("ConnectionParamsModel", connectionParams); - - - /* - * SwingViewerWindowFactory viewerWindowFactory = new - * SwingViewerWindowFactory( isSeparateFrame, isApplet, this); - * - * connectionPresenter.setConnectionWorkerFactory(new - * SwingConnectionWorkerFactory( connectionView.getFrame(), - * passwordFromParams, connectionPresenter, viewerWindowFactory, - * myRfb)); - */ - - connectionPresenter.setConnectionWorkerFactory( new SwingConnectionWorkerFactory(null, passwordFromParams, connectionPresenter, null, myRfb)); connectionPresenter.setCuiVersion(true); @@ -158,6 +145,11 @@ } @Override + public synchronized void newVNCConnection(ConnectionPresenter presenter) { + connectionPresenter = presenter; + } + + @Override public void windowOpened(WindowEvent e) { /* nop */ } diff -r 101a32eb084f -r 6558eb66ac8e src/viewer_swing/java/com/glavsoft/viewer/Viewer.java --- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Aug 10 18:46:18 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Aug 10 18:47:38 2015 +0900 @@ -224,7 +224,7 @@ public void run() { final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || ! isApplet; - connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + ConnectionPresenter connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); connectionPresenter.setNoConnection(noConnection); connectionPresenter.addModel("ConnectionParamsModel", connectionParams); ConnectionView connectionView = new ConnectionView( @@ -249,6 +249,11 @@ } @Override + public synchronized void newVNCConnection(ConnectionPresenter presenter) { + connectionPresenter = presenter; + } + + @Override public void windowOpened(WindowEvent e) { /* nop */ } @Override public void windowClosed(WindowEvent e) { /* nop */ } @@ -458,6 +463,7 @@ return rectangles; } + @Override public void setFitScreen() { SwingViewerWindow v = connectionPresenter.getViewer(); diff -r 101a32eb084f -r 6558eb66ac8e src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java --- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Aug 10 18:46:18 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Aug 10 18:47:38 2015 +0900 @@ -50,4 +50,6 @@ public void setFitScreen(); public ArrayList getScreenRectangles(); + + void newVNCConnection(ConnectionPresenter presenter); } diff -r 101a32eb084f -r 6558eb66ac8e src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java --- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Mon Aug 10 18:46:18 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Mon Aug 10 18:47:38 2015 +0900 @@ -108,6 +108,9 @@ try { get(); presenter.showMessage("Handshake established"); + if(myRfb.hasViewer()) { + myRfb.getViewer().newVNCConnection(presenter); + } ClipboardControllerImpl clipboardController; if(!myRfb.getCuiVersion()) clipboardController = new ClipboardControllerImpl(workingProtocol, rfbSettings.getRemoteCharsetName());