diff options
author | runge <runge> | 2007-06-15 03:19:05 +0000 |
---|---|---|
committer | runge <runge> | 2007-06-15 03:19:05 +0000 |
commit | d3326942e2e7d1391da0975590dbd2c8668d9328 (patch) | |
tree | 34da35ee116fc657d51736ff65fc0b02b3826801 /classes | |
parent | 171db9c542cd35b6de8ad88cefd99ea145482df1 (diff) | |
download | libtdevnc-d3326942e2e7d1391da0975590dbd2c8668d9328.tar.gz libtdevnc-d3326942e2e7d1391da0975590dbd2c8668d9328.zip |
x11vnc: fix build error if libssl is missing or --without-ssl supplied.
Diffstat (limited to 'classes')
-rw-r--r-- | classes/ssl/SignedUltraViewerSSL.jar | bin | 92166 -> 97097 bytes | |||
-rw-r--r-- | classes/ssl/SignedVncViewer.jar | bin | 79005 -> 79004 bytes | |||
-rw-r--r-- | classes/ssl/UltraViewerSSL.jar | bin | 89589 -> 94370 bytes | |||
-rw-r--r-- | classes/ssl/VncViewer.jar | bin | 76220 -> 76220 bytes | |||
-rw-r--r-- | classes/ssl/ultra.vnc | 1 | ||||
-rw-r--r-- | classes/ssl/ultrasigned.vnc | 1 | ||||
-rw-r--r-- | classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch | 1247 |
7 files changed, 1128 insertions, 121 deletions
diff --git a/classes/ssl/SignedUltraViewerSSL.jar b/classes/ssl/SignedUltraViewerSSL.jar Binary files differindex 591fb04..14f5a5a 100644 --- a/classes/ssl/SignedUltraViewerSSL.jar +++ b/classes/ssl/SignedUltraViewerSSL.jar diff --git a/classes/ssl/SignedVncViewer.jar b/classes/ssl/SignedVncViewer.jar Binary files differindex 8ee5958..093b676 100644 --- a/classes/ssl/SignedVncViewer.jar +++ b/classes/ssl/SignedVncViewer.jar diff --git a/classes/ssl/UltraViewerSSL.jar b/classes/ssl/UltraViewerSSL.jar Binary files differindex f234c4b..91e54fb 100644 --- a/classes/ssl/UltraViewerSSL.jar +++ b/classes/ssl/UltraViewerSSL.jar diff --git a/classes/ssl/VncViewer.jar b/classes/ssl/VncViewer.jar Binary files differindex 7e23356..81b36fe 100644 --- a/classes/ssl/VncViewer.jar +++ b/classes/ssl/VncViewer.jar diff --git a/classes/ssl/ultra.vnc b/classes/ssl/ultra.vnc index 23b6a31..cbe8f3a 100644 --- a/classes/ssl/ultra.vnc +++ b/classes/ssl/ultra.vnc @@ -20,6 +20,7 @@ $USER's $DESKTOP desktop ($DISPLAY) <param name=PORT value=$PORT> <param name="Open New Window" value=yes> <param name="ignoreMSLogonCheck" value=yes> +<param name="delayAuthPanel" value=yes> $PARAMS </APPLET> <BR> diff --git a/classes/ssl/ultrasigned.vnc b/classes/ssl/ultrasigned.vnc index f7c08f8..2b8fd38 100644 --- a/classes/ssl/ultrasigned.vnc +++ b/classes/ssl/ultrasigned.vnc @@ -20,6 +20,7 @@ $USER's $DESKTOP desktop ($DISPLAY) <param name=PORT value=$PORT> <param name="Open New Window" value=yes> <param name="ignoreMSLogonCheck" value=yes> +<param name="delayAuthPanel" value=yes> $PARAMS </APPLET> <BR> diff --git a/classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch b/classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch index 8d9dd79..d2129f7 100644 --- a/classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch +++ b/classes/ssl/ultravnc-102-JavaViewer-ssl-etc.patch @@ -1,12 +1,111 @@ diff -Naur JavaViewer.orig/ButtonPanel.java JavaViewer/ButtonPanel.java --- JavaViewer.orig/ButtonPanel.java 2004-12-12 20:51:02.000000000 -0500 -+++ JavaViewer/ButtonPanel.java 2007-05-18 15:19:53.000000000 -0400 -@@ -163,9 +163,16 @@ ++++ JavaViewer/ButtonPanel.java 2007-05-31 15:40:45.000000000 -0400 +@@ -43,30 +43,36 @@ + viewer = v; + + setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); +- disconnectButton = new Button("Disconnect"); ++ if (v.ftpOnly) { ++ disconnectButton = new Button("Quit"); ++ } else { ++ disconnectButton = new Button("Close"); ++ } + disconnectButton.setEnabled(false); + add(disconnectButton); + disconnectButton.addActionListener(this); +- optionsButton = new Button("Options"); +- add(optionsButton); +- optionsButton.addActionListener(this); +- clipboardButton = new Button("Clipboard"); +- clipboardButton.setEnabled(false); +- add(clipboardButton); +- clipboardButton.addActionListener(this); +- if (viewer.rec != null) { +- recordButton = new Button("Record"); +- add(recordButton); +- recordButton.addActionListener(this); +- } +- ctrlAltDelButton = new Button("Send Ctrl-Alt-Del"); +- ctrlAltDelButton.setEnabled(false); +- add(ctrlAltDelButton); +- ctrlAltDelButton.addActionListener(this); +- refreshButton = new Button("Refresh"); +- refreshButton.setEnabled(false); +- add(refreshButton); +- refreshButton.addActionListener(this); ++ if (!v.ftpOnly) { ++ optionsButton = new Button("Options"); ++ add(optionsButton); ++ optionsButton.addActionListener(this); ++ clipboardButton = new Button("Clipboard"); ++ clipboardButton.setEnabled(false); ++ add(clipboardButton); ++ clipboardButton.addActionListener(this); ++ if (viewer.rec != null) { ++ recordButton = new Button("Record"); ++ add(recordButton); ++ recordButton.addActionListener(this); ++ } ++ ctrlAltDelButton = new Button("Send Ctrl-Alt-Del"); ++ ctrlAltDelButton.setEnabled(false); ++ add(ctrlAltDelButton); ++ ctrlAltDelButton.addActionListener(this); ++ refreshButton = new Button("Refresh"); ++ refreshButton.setEnabled(false); ++ add(refreshButton); ++ refreshButton.addActionListener(this); ++ } + ftpButton = new Button("File Transfer"); + ftpButton.setEnabled(false); + add(ftpButton); +@@ -79,9 +85,10 @@ + + public void enableButtons() { + disconnectButton.setEnabled(true); ++ ftpButton.setEnabled(true); ++ if (viewer.ftpOnly) {return;} + clipboardButton.setEnabled(true); + refreshButton.setEnabled(true); +- ftpButton.setEnabled(true); + } + + // +@@ -89,6 +96,9 @@ + // + + public void disableButtonsOnDisconnect() { ++ ftpButton.setEnabled(false); ++ if (viewer.ftpOnly) {return;} ++ + remove(disconnectButton); + disconnectButton = new Button("Hide desktop"); + disconnectButton.setEnabled(true); +@@ -99,7 +109,6 @@ + clipboardButton.setEnabled(false); + ctrlAltDelButton.setEnabled(false); + refreshButton.setEnabled(false); +- ftpButton.setEnabled(false); + + validate(); + } +@@ -110,6 +119,7 @@ + // + + public void enableRemoteAccessControls(boolean enable) { ++ if (viewer.ftpOnly) {return;} + ctrlAltDelButton.setEnabled(enable); + } + +@@ -163,9 +173,19 @@ } else if (evt.getSource() == ftpButton) { - viewer.ftp.setVisible(!viewer.ftp.isVisible()); +// begin runge/x11vnc ++ if (viewer.ftpOnly) { ++ viewer.vncFrame.setVisible(false); ++ } + viewer.ftp.setSavedLocations(); + if (viewer.ftp.isVisible()) { + viewer.ftp.doClose(); @@ -22,9 +121,12 @@ diff -Naur JavaViewer.orig/ButtonPanel.java JavaViewer/ButtonPanel.java } diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java --- JavaViewer.orig/FTPFrame.java 2005-03-15 23:53:14.000000000 -0500 -+++ JavaViewer/FTPFrame.java 2007-05-18 21:50:06.000000000 -0400 -@@ -26,6 +26,10 @@ ++++ JavaViewer/FTPFrame.java 2007-06-02 23:24:32.000000000 -0400 +@@ -24,8 +24,13 @@ + import java.io.*; + import java.util.ArrayList; import java.util.Vector; ++import java.util.Date; import javax.swing.*; +// begin runge/x11vnc @@ -34,7 +136,15 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java /* * Created on Feb 25, 2004 -@@ -80,6 +84,17 @@ +@@ -74,12 +79,27 @@ + public javax.swing.JTextField connectionStatus = null; + public boolean updateDriveList; + private Vector remoteList = null; ++ private Vector remoteListInfo = null; + private Vector localList = null; ++ private Vector localListInfo = null; + private File currentLocalDirectory = null; // Holds the current local Directory + private File currentRemoteDirectory = null; // Holds the current remote Directory private File localSelection = null; // Holds the currently selected local file private String remoteSelection = null; // Holds the currently selected remote file public String selectedTable = null; @@ -48,16 +158,19 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + public long saveRemoteDirectoryTime = 0; + public int saveRemoteDirectoryCount = 0; + private boolean localCurrentIsDir = true; ++ private int lastRemoteIndex = -1; ++ private int lastLocalIndex = -1; +// end runge/x11vnc // sf@2004 - Separate directories and files for better lisibility private ArrayList DirsList; -@@ -125,11 +140,59 @@ +@@ -125,11 +145,60 @@ void refreshRemoteLocation() { + remoteList.clear(); ++ remoteListInfo.clear(); remoteFileTable.setListData(remoteList); +System.out.println("refreshRemoteLocation '" + remoteLocation.getText() + "'"); // runge/x11vnc viewer.rfb.readServerDirectory(remoteLocation.getText()); @@ -79,7 +192,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + + private File saveLocalHack(File dir) { + saveLocalDirectoryCount++; -+System.out.println("L " + saveLocalDirectoryCount + " dt: " + (System.currentTimeMillis() - saveLocalDirectoryTime) + " - " + saveLocalDirectory); ++//System.out.println("L " + saveLocalDirectoryCount + " dt: " + (System.currentTimeMillis() - saveLocalDirectoryTime) + " - " + saveLocalDirectory); + if (System.currentTimeMillis() > saveLocalDirectoryTime + 2000 || saveLocalDirectoryCount > 2) { + saveLocalDirectory = null; + } @@ -94,7 +207,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + + private String saveRemoteHack(String indrive) { + saveRemoteDirectoryCount++; -+System.out.println("R " + saveRemoteDirectoryCount + " - " + saveRemoteDirectory); ++//System.out.println("R " + saveRemoteDirectoryCount + " - " + saveRemoteDirectory); + if (saveRemoteDirectory != null && saveRemoteDirectoryCount > 1) { + saveRemoteDirectory = null; + } @@ -112,7 +225,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java /* * Prints the list of drives on the remote directory and returns a String[]. * str takes as string like A:fC:lD:lE:lF:lG:cH:c -@@ -185,6 +248,7 @@ +@@ -185,6 +254,7 @@ stopButton.setVisible(true); stopButton.setEnabled(true); receiveButton.setEnabled(false); @@ -120,7 +233,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java remoteTopButton.setEnabled(false); sendButton.setEnabled(false); remoteFileTable.setEnabled(false); -@@ -207,6 +271,7 @@ +@@ -207,6 +277,7 @@ stopButton.setVisible(false); stopButton.setEnabled(false); receiveButton.setEnabled(true); @@ -128,71 +241,84 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java remoteTopButton.setEnabled(true); sendButton.setEnabled(true); remoteFileTable.setEnabled(true); -@@ -253,6 +318,7 @@ +@@ -221,10 +292,11 @@ + /* + * Print Directory prints out all the contents of a directory + */ +- void printDirectory(ArrayList a) { ++ void printDirectory(ArrayList a, ArrayList b) { + + for (int i = 0; i < a.size(); i++) { + remoteList.addElement(a.get(i)); ++ remoteListInfo.addElement(b.get(i)); + } + remoteFileTable.setListData(remoteList); + } +@@ -253,6 +325,7 @@ jContentPane.add(getRemotePanel(), java.awt.BorderLayout.EAST); jContentPane.add(getLocalPanel(), java.awt.BorderLayout.WEST); jContentPane.add(getButtonPanel(), java.awt.BorderLayout.CENTER); -+System.out.println("getJContentPane"); ++//System.out.println("getJContentPane"); } return jContentPane; } -@@ -270,6 +336,7 @@ +@@ -270,6 +343,7 @@ topPanelLocal.add(getLocalMachineLabel(), java.awt.BorderLayout.CENTER); topPanelLocal.add(getLocalTopButton(), java.awt.BorderLayout.EAST); topPanelLocal.setBackground(java.awt.Color.lightGray); -+System.out.println("getTopPanelLocal"); ++//System.out.println("getTopPanelLocal"); } return topPanelLocal; } -@@ -288,6 +355,7 @@ +@@ -288,6 +362,7 @@ topPanelRemote.add(getRemoteMachineLabel(), java.awt.BorderLayout.CENTER); topPanelRemote.add(getRemoteTopButton(), java.awt.BorderLayout.EAST); topPanelRemote.setBackground(java.awt.Color.lightGray); -+System.out.println("getTopPanelRemote"); ++//System.out.println("getTopPanelRemote"); } return topPanelRemote; } -@@ -301,6 +369,7 @@ +@@ -301,6 +376,7 @@ if (topPanelCenter == null) { topPanelCenter = new javax.swing.JPanel(); topPanelCenter.add(getDummyButton(), null); -+System.out.println("getTopPanelCenter"); ++//System.out.println("getTopPanelCenter"); } return topPanelCenter; } -@@ -328,6 +397,7 @@ +@@ -328,6 +404,7 @@ topPanel.add(getRemoteTopButton(), null); topPanel.setBackground(java.awt.Color.lightGray); */ -+System.out.println("getTopPanel"); ++//System.out.println("getTopPanel"); } return topPanel; } -@@ -348,6 +418,7 @@ +@@ -348,6 +425,7 @@ statusPanel.add(getJProgressBar(), null); statusPanel.add(getConnectionStatus(), null); statusPanel.setBackground(java.awt.Color.lightGray); -+System.out.println("getStatusPanel"); ++//System.out.println("getStatusPanel"); } return statusPanel; -@@ -368,6 +439,7 @@ +@@ -368,6 +446,7 @@ remotePanel.add(getRemoteScrollPane(), null); remotePanel.add(getRemoteStatus(), null); remotePanel.setBackground(java.awt.Color.lightGray); -+System.out.println("getRemotePanel"); ++//System.out.println("getRemotePanel"); } return remotePanel; } -@@ -390,6 +462,7 @@ +@@ -390,6 +469,7 @@ localPanel.setComponentOrientation( java.awt.ComponentOrientation.UNKNOWN); localPanel.setName("localPanel"); -+System.out.println("getLocalPanel"); ++//System.out.println("getLocalPanel"); } return localPanel; } -@@ -405,12 +478,14 @@ +@@ -405,12 +485,14 @@ buttonPanel = new javax.swing.JPanel(); buttonPanel.setLayout(null); buttonPanel.add(getReceiveButton(), null); @@ -203,11 +329,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java buttonPanel.add(getSendButton(), null); buttonPanel.add(getStopButton(), null); buttonPanel.setBackground(java.awt.Color.lightGray); -+System.out.println("getButtonPanel"); ++//System.out.println("getButtonPanel"); } return buttonPanel; } -@@ -422,10 +497,11 @@ +@@ -422,10 +504,11 @@ private javax.swing.JButton getSendButton() { if (sendButton == null) { sendButton = new javax.swing.JButton(); @@ -216,11 +342,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java sendButton.setText("Send >>"); sendButton.setName("sendButton"); sendButton.addActionListener(this); -+System.out.println("getSendButton"); ++//System.out.println("getSendButton"); } return sendButton; -@@ -438,7 +514,7 @@ +@@ -438,7 +521,7 @@ private javax.swing.JButton getReceiveButton() { if (receiveButton == null) { receiveButton = new javax.swing.JButton(); @@ -229,7 +355,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java receiveButton.setText("<< Receive"); receiveButton.setName("receiveButton"); receiveButton.addActionListener(this); -@@ -453,7 +529,7 @@ +@@ -453,7 +536,7 @@ private javax.swing.JButton getDeleteButton() { if (deleteButton == null) { deleteButton = new javax.swing.JButton(); @@ -238,7 +364,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java deleteButton.setText("Delete File"); deleteButton.setName("deleteButton"); deleteButton.addActionListener(this); -@@ -468,7 +544,7 @@ +@@ -468,7 +551,7 @@ private javax.swing.JButton getNewFolderButton() { if (newFolderButton == null) { newFolderButton = new javax.swing.JButton(); @@ -247,7 +373,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java newFolderButton.setText("New Folder"); newFolderButton.setName("newFolderButton"); newFolderButton.addActionListener(this); -@@ -476,6 +552,24 @@ +@@ -476,6 +559,24 @@ return newFolderButton; } @@ -272,7 +398,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java /** * This method initializes stopButton * -@@ -486,7 +580,7 @@ +@@ -486,7 +587,7 @@ if (stopButton == null) { stopButton = new javax.swing.JButton(); @@ -281,144 +407,194 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java stopButton.setText("Stop"); stopButton.setName("stopButton"); stopButton.addActionListener(this); -@@ -503,7 +597,7 @@ +@@ -503,8 +604,12 @@ private javax.swing.JButton getCloseButton() { if (closeButton == null) { closeButton = new javax.swing.JButton(); - closeButton.setBounds(20, 325, 97, 25); +- closeButton.setText("Close"); + closeButton.setBounds(15, 325, 107, 25); // runge/x11vnc - closeButton.setText("Close"); ++ if (viewer.ftpOnly) { ++ closeButton.setText("Quit"); ++ } else { ++ closeButton.setText("Close"); ++ } closeButton.setName("closeButton"); closeButton.addActionListener(this); -@@ -551,6 +645,7 @@ + } +@@ -551,6 +656,7 @@ //Select the second entry (e.g. C:\) // localDrivesComboBox.setSelectedIndex(1); localDrivesComboBox.addActionListener(this); -+System.out.println("getLocalDrivesComboBox"); ++//System.out.println("getLocalDrivesComboBox"); } updateDriveList = false; return localDrivesComboBox; -@@ -567,6 +662,7 @@ +@@ -567,6 +673,7 @@ remoteDrivesComboBox.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); remoteDrivesComboBox.addActionListener(this); -+System.out.println("getRemoteDrivesComboBox"); ++//System.out.println("getRemoteDrivesComboBox"); } return remoteDrivesComboBox; -@@ -587,6 +683,7 @@ +@@ -587,6 +694,7 @@ localMachineLabel.setFont( new java.awt.Font("Dialog", java.awt.Font.BOLD, 11)); localMachineLabel.setEditable(false); -+System.out.println("getLocalMachineLabel"); ++//System.out.println("getLocalMachineLabel"); } return localMachineLabel; } -@@ -622,6 +719,7 @@ +@@ -622,6 +730,7 @@ localTopButton.setFont( new java.awt.Font("Dialog", java.awt.Font.BOLD, 10)); localTopButton.addActionListener(this); -+System.out.println("getLocalTopButton"); ++//System.out.println("getLocalTopButton"); } return localTopButton; } -@@ -638,6 +736,7 @@ +@@ -638,6 +747,7 @@ remoteTopButton.setFont( new java.awt.Font("Dialog", java.awt.Font.BOLD, 10)); remoteTopButton.addActionListener(this); -+System.out.println("getRemoteTopButton"); ++//System.out.println("getRemoteTopButton"); } return remoteTopButton; } -@@ -653,6 +752,7 @@ +@@ -650,9 +760,24 @@ + private javax.swing.JList getLocalFileTable() { + if (localFileTable == null) { + localList = new Vector(0); ++ localListInfo = new Vector(0); localFileTable = new JList(localList); ++ MouseMotionListener mlisten = new MouseMotionAdapter() { ++ public void mouseMoved(MouseEvent e) { ++ int index = localFileTable.locationToIndex(e.getPoint()); ++ if (index == lastLocalIndex) { ++ return; ++ } else if (index < 0) { ++ return; ++ } ++ lastLocalIndex = index; ++ connectionStatus.setText((String) localListInfo.get(index)); ++ } ++ }; localFileTable.addMouseListener(this); ++ localFileTable.addMouseMotionListener(mlisten); localFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); -+System.out.println("getLocalFileTable"); ++//System.out.println("getLocalFileTable"); } return localFileTable; } -@@ -669,6 +769,7 @@ +@@ -669,6 +794,7 @@ localScrollPane.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); localScrollPane.setName("localFileList"); -+System.out.println("getLocalScrollPane"); ++//System.out.println("getLocalScrollPane"); } return localScrollPane; } -@@ -684,6 +785,7 @@ +@@ -680,10 +806,25 @@ + private javax.swing.JList getRemoteFileTable() { + if (remoteFileTable == null) { + remoteList = new Vector(0); ++ remoteListInfo = new Vector(0); + remoteFileTable = new JList(remoteList); ++ MouseMotionListener mlisten = new MouseMotionAdapter() { ++ public void mouseMoved(MouseEvent e) { ++ int index = remoteFileTable.locationToIndex(e.getPoint()); ++ if (index == lastRemoteIndex) { ++ return; ++ } else if (index < 0) { ++ return; ++ } ++ lastRemoteIndex = index; ++ connectionStatus.setText((String) remoteListInfo.get(index)); ++ } ++ }; remoteFileTable.addMouseListener(this); ++ remoteFileTable.addMouseMotionListener(mlisten); remoteFileTable.setSelectedValue("C:\\", false); remoteFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); -+System.out.println("getRemoteFileTable"); ++//System.out.println("getRemoteFileTable"); } return remoteFileTable; -@@ -698,6 +800,7 @@ +@@ -698,6 +839,7 @@ remoteScrollPane = new javax.swing.JScrollPane(); remoteScrollPane.setViewportView(getRemoteFileTable()); remoteScrollPane.setPreferredSize(new java.awt.Dimension(325, 418)); -+System.out.println("getRemoteScrollPane"); ++//System.out.println("getRemoteScrollPane"); } return remoteScrollPane; } -@@ -716,6 +819,7 @@ +@@ -716,6 +858,7 @@ remoteLocation.setBackground(new Color(255,255,238)); remoteLocation.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); -+System.out.println("getRemoteLocation"); ++//System.out.println("getRemoteLocation"); } return remoteLocation; } -@@ -732,6 +836,7 @@ +@@ -732,6 +875,7 @@ localLocation.setBackground( new Color(255,255,238)); localLocation.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); -+System.out.println("getLocalLocation"); ++//System.out.println("getLocalLocation"); } return localLocation; } -@@ -748,6 +853,7 @@ +@@ -748,6 +892,7 @@ localStatus.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); localStatus.setEditable(false); -+System.out.println("getLocalStatus"); ++//System.out.println("getLocalStatus"); } return localStatus; } -@@ -764,6 +870,7 @@ +@@ -764,6 +909,7 @@ remoteStatus.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); remoteStatus.setEditable(false); -+System.out.println("getRemoteStatus"); ++//System.out.println("getRemoteStatus"); } return remoteStatus; } -@@ -780,6 +887,7 @@ +@@ -780,6 +926,7 @@ historyComboBox.insertItemAt(new String("Pulldown to view history ..."),0); historyComboBox.setSelectedIndex(0); historyComboBox.addActionListener(this); -+System.out.println("getHistoryComboBox"); ++//System.out.println("getHistoryComboBox"); } return historyComboBox; } -@@ -791,6 +899,7 @@ +@@ -791,6 +938,7 @@ private javax.swing.JProgressBar getJProgressBar() { if (jProgressBar == null) { jProgressBar = new javax.swing.JProgressBar(); -+System.out.println("getJProgressBar"); ++//System.out.println("getJProgressBar"); } return jProgressBar; } -@@ -806,6 +915,7 @@ +@@ -806,6 +954,7 @@ connectionStatus.setBackground(java.awt.Color.lightGray); connectionStatus.setFont( new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10)); -+System.out.println("getConnectionStatus"); ++//System.out.println("getConnectionStatus"); } connectionStatus.setEditable(false); return connectionStatus; -@@ -829,12 +939,19 @@ +@@ -815,7 +964,7 @@ + * Implements Action listener. + */ + public void actionPerformed(ActionEvent evt) { +- System.out.println(evt.getSource()); ++// System.out.println(evt.getSource()); + + if (evt.getSource() == closeButton) + { // Close Button +@@ -829,14 +978,22 @@ { doReceive(); } @@ -437,8 +613,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java +System.out.println("remoteDrivesComboBox"); // runge/x11vnc changeRemoteDrive(); remoteList.clear(); ++ remoteListInfo.clear(); remoteFileTable.setListData(remoteList); -@@ -845,6 +962,7 @@ + } + else if (evt.getSource() == localTopButton) +@@ -845,6 +1002,7 @@ } else if (evt.getSource() == remoteTopButton) { @@ -446,13 +625,17 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java changeRemoteDrive(); } else if(evt.getSource() == deleteButton) -@@ -880,22 +998,35 @@ +@@ -880,25 +1038,42 @@ historyComboBox.setSelectedIndex(0); } } - private void doClose() + public void doClose() { ++ if (viewer.ftpOnly) { ++ viewer.disconnect(); ++ return; ++ } try { this.setVisible(false); - viewer.rfb.writeFramebufferUpdateRequest( @@ -488,15 +671,28 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + } private void doDelete() { - System.out.println("Delete Button Pressed"); -@@ -979,6 +1110,56 @@ +- System.out.println("Delete Button Pressed"); ++// System.out.println("Delete Button Pressed"); + //Call this method to delete a file at server + if(selectedTable.equals("remote")) + { +@@ -952,7 +1127,7 @@ + + private void doReceive() + { +- System.out.println("Received Button Pressed"); ++// System.out.println("Received Button Pressed"); + + String sFileName = ((String) this.remoteFileTable.getSelectedValue()); + +@@ -979,9 +1154,59 @@ viewer.rfb.requestRemoteFile(remoteFileName,localDestinationPath); } +// begin runge/x11vnc + private void doView() + { -+ System.out.println("View Button Pressed"); ++// System.out.println("View Button Pressed"); + + if (selectedTable == null) { + return; @@ -545,20 +741,27 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + private void doSend() { - System.out.println("Send Button Pressed"); -@@ -1035,8 +1216,11 @@ +- System.out.println("Send Button Pressed"); ++// System.out.println("Send Button Pressed"); + + String sFileName = ((String) this.localFileTable.getSelectedValue()); + +@@ -1035,10 +1260,14 @@ if (!updateDriveList) { String drive = remoteDrivesComboBox.getSelectedItem().toString().substring(0,1)+ ":\\"; -+System.out.println("changeRemoteDrive-A " + drive); // runge/x11vnc ++//System.out.println("changeRemoteDrive-A " + drive); // runge/x11vnc + drive = saveRemoteHack(drive); viewer.rfb.readServerDirectory(drive); remoteLocation.setText(drive); -+System.out.println("changeRemoteDrive-B " + drive); // runge/x11vnc ++//System.out.println("changeRemoteDrive-B " + drive); // runge/x11vnc } remoteList.clear(); ++ remoteListInfo.clear(); remoteFileTable.setListData(remoteList); -@@ -1048,6 +1232,7 @@ + } + /** +@@ -1048,6 +1277,7 @@ private void changeLocalDrive() { File currentDrive = new File(localDrivesComboBox.getSelectedItem().toString()); @@ -566,7 +769,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java if(currentDrive.canRead()) { localSelection = null; -@@ -1060,6 +1245,7 @@ +@@ -1057,9 +1287,11 @@ + else + { + localList.clear(); ++ localListInfo.clear(); localStatus.setText("WARNING: Drive " + localDrivesComboBox.getSelectedItem().toString()); connectionStatus.setText(" > WARNING - Local Drive unavailable (possibly restricted access or media not present)"); } @@ -574,7 +781,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java } /** * Determines which FileTable was double-clicked and updates the table -@@ -1101,7 +1287,7 @@ +@@ -1101,7 +1333,7 @@ String name = (remoteFileTable.getSelectedValue().toString()).substring(1); if( !name.substring(0, 2).equals(" [")) remoteSelection = remoteLocation.getText() + name.substring(0, name.length()); @@ -583,7 +790,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java } /* -@@ -1115,10 +1301,38 @@ +@@ -1115,10 +1347,38 @@ localFileTable.setBackground(new Color(255, 255, 255)); File currentSelection = new File(currentLocalDirectory, getTrimmedSelection()); @@ -623,7 +830,15 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java /** * Updates the Remote File Table based on selection. Called from mouseClicked handler */ -@@ -1149,6 +1363,7 @@ +@@ -1140,6 +1400,7 @@ + remoteLocation.setText(drive); + viewer.rfb.readServerDirectory(drive); + remoteList.clear(); ++ remoteListInfo.clear(); + remoteFileTable.setListData(remoteList); + } + else if (!name.substring(0, 2).equals(" [") && !name.substring((name.length() - 1), name.length()).equals("]")) +@@ -1149,6 +1410,7 @@ remoteSelection = remoteLocation.getText() + name.substring(0, name.length()); drive = remoteLocation.getText(); // ?? @@ -631,7 +846,12 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java } else { -@@ -1163,6 +1378,7 @@ +@@ -1159,10 +1421,12 @@ + remoteLocation.setText(drive); + viewer.rfb.readServerDirectory(drive); + remoteList.clear(); ++ remoteListInfo.clear(); + remoteFileTable.setListData(remoteList); } //remoteLocation.setText(drive); } @@ -639,7 +859,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java /** * Updates the Local File Table based on selection. Called from MouseClicked handler */ -@@ -1188,6 +1404,7 @@ +@@ -1188,6 +1452,7 @@ else if (currentSelection.isFile()) { localSelection = currentSelection.getAbsoluteFile(); @@ -647,7 +867,45 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java } else if (currentSelection.isDirectory()) { -@@ -1247,10 +1464,34 @@ +@@ -1241,36 +1506,113 @@ + return null; + } + ++ String timeStr(long t) { ++ Date date = new Date(t); ++ return date.toString(); ++ } ++ String dotPast(double f, int n) { ++ String fs = "" + f; ++ int i = fs.lastIndexOf(".") + n; ++ if (i >= 0) { ++ int len = fs.length(); ++ if (i >= len) { ++ i = len-1; ++ } ++ fs = fs.substring(0, i); ++ } ++ return fs; ++ } ++ String sizeStr(int s) { ++ if (s < 0) { ++ return s + "? B"; ++ } else if (s < 1024) { ++ return s + " B"; ++ } else if (s < 1024 * 1024) { ++ double k = s / 1024.0; ++ String ks = dotPast(k, 3); ++ ++ return s + " (" + ks + " KB)"; ++ } else { ++ double m = s / (1024.0*1024.0); ++ String ms = dotPast(m, 3); ++ return s + " (" + ms + " MB)"; ++ } ++ } + + /* + * Navigates the local file structure up or down one directory */ public void changeLocalDirectory(File dir) { @@ -656,6 +914,8 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + + if (dir == null) { + connectionStatus.setText("Error changing local directory."); ++ historyComboBox.insertItemAt(new String("> Error changing local directory."), 0); ++ historyComboBox.setSelectedIndex(0); + return; + } + @@ -664,6 +924,8 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java + if (contents == null || allFiles == null) { + connectionStatus.setText("Error changing local directory."); ++ historyComboBox.insertItemAt(new String("> Error changing local directory."), 0); ++ historyComboBox.setSelectedIndex(0); + return; + } + @@ -681,9 +943,51 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java +// end runge/x11vnc + localList.clear(); ++ localListInfo.clear(); localList.addElement(" [..]"); ++ localListInfo.addElement(" [..]"); ++ ++ ArrayList DirInfo = new ArrayList(); ++ ArrayList FilInfo = new ArrayList(); -@@ -1296,3 +1537,135 @@ + // Populate the Lists + for (int i = 0; i < contents.length; i++) + { +- if (allFiles[i].isDirectory()) ++ String f2 = contents[i]; ++ if (f2.length() < 24) { ++ for (int ik = f2.length(); ik < 24; ik++) { ++ f2 = f2 + " "; ++ } ++ } ++ String s = f2 + " \tLastmod: " + timeStr(allFiles[i].lastModified()) + " \t\tSize: " + sizeStr((int) allFiles[i].length()); ++ if (allFiles[i].isDirectory()) { + // localList.addElement("[" + contents[i] + "]"); + DirsList.add(" [" + contents[i] + "]"); // sf@2004 +- else +- { ++ DirInfo.add(s); ++ } else { + // localList.addElement(contents[i]); + FilesList.add(" " + contents[i]); // sf@2004 ++ FilInfo.add(s); + } + } + // sf@2004 +- for (int i = 0; i < DirsList.size(); i++) ++ for (int i = 0; i < DirsList.size(); i++) { + localList.addElement(DirsList.get(i)); +- for (int i = 0; i < FilesList.size(); i++) ++ localListInfo.addElement(DirInfo.get(i)); ++ } ++ for (int i = 0; i < FilesList.size(); i++) { + localList.addElement(FilesList.get(i)); ++ localListInfo.addElement(FilInfo.get(i)); ++ } + + FilesList.clear(); + DirsList.clear(); +@@ -1296,3 +1638,135 @@ } } // @jve:visual-info decl-index=0 visual-constraint="10,10" @@ -836,8 +1140,20 @@ diff -Naur JavaViewer.orig/OptionsFrame.java JavaViewer/OptionsFrame.java choices[shareDesktopIndex].select("Yes"); diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java --- JavaViewer.orig/RfbProto.java 2006-05-24 15:14:40.000000000 -0400 -+++ JavaViewer/RfbProto.java 2007-05-18 22:03:42.000000000 -0400 -@@ -199,6 +199,10 @@ ++++ JavaViewer/RfbProto.java 2007-06-02 23:46:21.000000000 -0400 +@@ -86,8 +86,11 @@ + + // sf@2004 - FileTransfer part + ArrayList remoteDirsList; ++ ArrayList remoteDirsListInfo; + ArrayList remoteFilesList; ++ ArrayList remoteFilesListInfo; + ArrayList a; ++ ArrayList b; + boolean fFTInit = true; // sf@2004 + boolean fFTAllowed = true; + boolean fAbort = false; +@@ -199,6 +202,10 @@ // playback. int numUpdatesInSession; @@ -848,7 +1164,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java // // Constructor. Make TCP connection to RFB server. // -@@ -207,7 +211,27 @@ +@@ -207,7 +214,27 @@ viewer = v; host = h; port = p; @@ -877,20 +1193,229 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java is = new DataInputStream( new BufferedInputStream(sock.getInputStream(), 16384)); -@@ -831,6 +855,12 @@ +@@ -215,9 +242,12 @@ + osw = new OutputStreamWriter(sock.getOutputStream()); + inDirectory2 = false; + a = new ArrayList(); ++ b = new ArrayList(); + // sf@2004 + remoteDirsList = new ArrayList(); ++ remoteDirsListInfo = new ArrayList(); + remoteFilesList = new ArrayList(); ++ remoteFilesListInfo = new ArrayList(); + + sendFileSource = ""; + } +@@ -420,7 +450,13 @@ + // + + int readServerMessageType() throws IOException { +- int msgType = is.readUnsignedByte(); ++ int msgType; ++ try { ++ msgType = is.readUnsignedByte(); ++ } catch (Exception e) { ++ viewer.disconnect(); ++ return -1; ++ } + + // If the session is being recorded: + if (rec != null) { +@@ -600,6 +636,7 @@ + contentParamT = is.readUnsignedByte(); + contentParamT = contentParamT << 8; + contentParam = contentParam | contentParamT; ++//System.out.println("FTM: contentType " + contentType + " contentParam " + contentParam); + if (contentType == rfbRDrivesList || contentType == rfbDirPacket) + { + readDriveOrDirectory(contentParam); +@@ -610,7 +647,7 @@ + } + else if (contentType == rfbFilePacket) + { +- receiveFileChunk(); ++ receiveFileChunk(); + } + else if (contentType == rfbEndOfFile) + { +@@ -645,6 +682,7 @@ + { + System.out.println("ContentType: " + contentType); + } ++//System.out.println("FTM: done"); + } + + //Refactored from readRfbFileTransferMsg() +@@ -688,11 +726,11 @@ + + // Internally used. Write an Rfb message to the server + void writeRfbFileTransferMsg( +- int contentType, +- int contentParam, +- long size, // 0 : compression not supported - 1 : compression supported +- long length, +- String text) throws IOException ++ int contentType, ++ int contentParam, ++ long size, // 0 : compression not supported - 1 : compression supported ++ long length, ++ String text) throws IOException + { + byte b[] = new byte[12]; + +@@ -702,7 +740,10 @@ + + byte by = 0; + long c = 0; +- length++; ++ ++ if (text != null) { ++ length++; // we send the null I guess??? ++ } + c = size & 0xFF000000; + by = (byte) (c >>> 24); + b[4] = by; +@@ -729,6 +770,8 @@ + by = (byte) c; + b[11] = by; + os.write(b); ++ ++//System.out.println("size: " + size + " length: " + length + " text: " + text); + + + if (text != null) +@@ -746,12 +789,12 @@ + + //Internally used. Write an rfb message to the server for sending files ONLY + int writeRfbFileTransferMsgForSendFile( +- int contentType, +- int contentParam, +- long size, +- long length, +- String source +- ) throws IOException ++ int contentType, ++ int contentParam, ++ long size, ++ long length, ++ String source ++ ) throws IOException + { + File f = new File(source); + fis = new FileInputStream(f); +@@ -768,50 +811,51 @@ + + while (bytesRead!=-1) + { +- counter += bytesRead; +- myDeflater.setInput(byteBuffer, 0, bytesRead); +- myDeflater.finish(); +- compressedSize = myDeflater.deflate(CompressionBuffer); +- myDeflater.reset(); +- // If the compressed data is larger than the original one, we're dealing with +- // already compressed data +- if (compressedSize > bytesRead) +- fCompress = false; +- this.writeRfbFileTransferMsg( +- contentType, +- contentParam, +- (fCompress ? 1 : 0), +- (fCompress ? compressedSize-1 : bytesRead-1), +- null +- ); +- // Todo: Test write error ! +- os.write( +- fCompress ? CompressionBuffer : byteBuffer, +- 0, +- fCompress ? compressedSize : bytesRead +- ); +- +- // Todo: test read error ! +- bytesRead = fis.read(byteBuffer); +- +- // viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes"); +- viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length())); +- viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%"); +- +- if (fAbort == true) +- { +- fAbort = false; +- fError = true; +- break; +- } +- try +- { +- Thread.sleep(5); +- } +- catch(InterruptedException e) +- { +- System.err.println("Interrupted"); +- } ++ counter += bytesRead; ++ myDeflater.setInput(byteBuffer, 0, bytesRead); ++ myDeflater.finish(); ++ compressedSize = myDeflater.deflate(CompressionBuffer); ++ myDeflater.reset(); ++ // If the compressed data is larger than the original one, we're dealing with ++ // already compressed data ++ if (compressedSize > bytesRead) ++ fCompress = false; ++ this.writeRfbFileTransferMsg( ++ contentType, ++ contentParam, ++ (fCompress ? 1 : 0), ++// RUNGE (fCompress ? compressedSize-1 : bytesRead-1), ++ (fCompress ? compressedSize : bytesRead), ++ null ++ ); ++ // Todo: Test write error ! ++ os.write( ++ fCompress ? CompressionBuffer : byteBuffer, ++ 0, ++ fCompress ? compressedSize : bytesRead ++ ); ++ ++ // Todo: test read error ! ++ bytesRead = fis.read(byteBuffer); ++ ++ // viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes"); ++ viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length())); ++ viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%"); ++ ++ if (fAbort == true) ++ { ++ fAbort = false; ++ fError = true; ++ break; ++ } ++ try ++ { ++ Thread.sleep(5); ++ } ++ catch(InterruptedException e) ++ { ++ System.err.println("Interrupted"); ++ } + } + + writeRfbFileTransferMsg(fError ? rfbAbortFileTransfer : rfbEndOfFile, 0, 0, 0, null); +@@ -831,6 +875,15 @@ { System.out.print((char) is.readUnsignedByte()); } ++ System.out.println(""); + + if (size == rfbRErrorCmd || size == -1) { + viewer.ftp.enableButtons(); + viewer.ftp.connectionStatus.setText("Remote file not available for writing."); ++ viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - Remote file not available for writing."), 0); ++ viewer.ftp.historyComboBox.setSelectedIndex(0); + return; + } int ret = writeRfbFileTransferMsgForSendFile( rfbFilePacket, -@@ -907,7 +937,7 @@ +@@ -907,7 +960,7 @@ //Handles acknowledgement that the file has been deleted on the server void deleteRemoteFileFeedback() throws IOException { @@ -899,7 +1424,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java int length = is.readInt(); String f = ""; for (int i = 0; i < length; i++) -@@ -916,7 +946,11 @@ +@@ -916,7 +969,11 @@ } viewer.ftp.refreshRemoteLocation(); @@ -912,7 +1437,24 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java viewer.ftp.historyComboBox.setSelectedIndex(0); } -@@ -943,7 +977,7 @@ +@@ -927,11 +984,11 @@ + { + String temp = text; + writeRfbFileTransferMsg( +- rfbCommand, +- rfbCFileDelete, +- 0, +- temp.length(), +- temp); ++ rfbCommand, ++ rfbCFileDelete, ++ 0, ++ temp.length(), ++ temp); + } + catch (IOException e) + { +@@ -943,7 +1000,7 @@ // Handles acknowledgement that the directory has been created on the server void createRemoteDirectoryFeedback() throws IOException { @@ -921,7 +1463,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java int length = is.readInt(); String f=""; for (int i = 0; i < length; i++) -@@ -951,7 +985,11 @@ +@@ -951,7 +1008,11 @@ f += (char)is.readUnsignedByte(); } viewer.ftp.refreshRemoteLocation(); @@ -934,15 +1476,40 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java viewer.ftp.historyComboBox.setSelectedIndex(0); } -@@ -1004,6 +1042,7 @@ +@@ -979,15 +1040,17 @@ + { + try + { ++//System.out.println("requestRemoteFile text: " + text); ++//System.out.println("requestRemoteFile leng: " + text.length()); + String temp = text; + receivePath = localPath; + + writeRfbFileTransferMsg( +- rfbFileTransferRequest, +- 0, +- 1, // 0 : compression not supported - 1 : compression supported +- temp.length(), +- temp); ++ rfbFileTransferRequest, ++ 0, ++ 1, // 0 : compression not supported - 1 : compression supported ++ temp.length(), ++ temp); + } + catch (IOException e) + { +@@ -1004,6 +1067,9 @@ viewer.ftp.disableButtons(); int size = is.readInt(); int length = is.readInt(); + ++//System.out.println("receiveFileHeader size: " + size); ++//System.out.println("receiveFileHeader leng: " + length); String tempName = ""; for (int i = 0; i < length; i++) -@@ -1011,6 +1050,13 @@ +@@ -1011,6 +1077,15 @@ tempName += (char) is.readUnsignedByte(); } @@ -950,13 +1517,15 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java + fFileReceptionRunning = false; + viewer.ftp.enableButtons(); + viewer.ftp.connectionStatus.setText("Remote file not available for reading."); ++ viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - Remote file not available for reading."), 0); ++ viewer.ftp.historyComboBox.setSelectedIndex(0); + return; + } + // sf@2004 - Read the high part of file size (not yet in rfbFileTransferMsg for // backward compatibility reasons...) int sizeH = is.readInt(); -@@ -1021,7 +1067,15 @@ +@@ -1021,7 +1096,16 @@ fileSize=0; fileChunkCounter = 0; String fileName = receivePath; @@ -967,13 +1536,113 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java + fFileReceptionRunning = false; + writeRfbFileTransferMsg(rfbAbortFileTransfer, 0, 0, 0, null); + viewer.ftp.historyComboBox.insertItemAt(new String(" > ERROR opening Local File: <" + fileName ),0); ++ viewer.ftp.historyComboBox.setSelectedIndex(0); + viewer.ftp.enableButtons(); + return; + } writeRfbFileTransferMsg(rfbFileHeader, 0, 0, 0, null); } -@@ -1263,11 +1317,47 @@ +@@ -1133,11 +1217,11 @@ + { + String temp = text; + writeRfbFileTransferMsg( +- rfbDirContentRequest, +- rfbRDirContent, +- 0, +- temp.length(), +- temp); ++ rfbDirContentRequest, ++ rfbRDirContent, ++ 0, ++ temp.length(), ++ temp); + } + catch (IOException e) + { +@@ -1202,6 +1286,52 @@ + } + } + ++ int zogswap(int n) { ++ long l = n; ++ if (l < 0) { ++ l += 0x100000000L; ++ } ++ l = l & 0xFFFFFFFF; ++ l = (l >> 24) | ((l & 0x00ff0000) >> 8) | ((l & 0x0000ff00) << 8) | (l << 24); ++ return (int) l; ++ } ++ ++ String timeStr(int t) { ++ t = zogswap(t); ++ long tl = (long) t; ++ Date date = new Date(tl * 1000); ++ return date.toString(); ++ } ++ String dotPast(double f, int n) { ++ String fs = "" + f; ++ int i = fs.lastIndexOf(".") + n; ++ if (i >= 0) { ++ int len = fs.length(); ++ if (i >= len) { ++ i = len-1; ++ } ++ fs = fs.substring(0, i); ++ } ++ return fs; ++ } ++ String sizeStr(int s) { ++ s = zogswap(s); ++ if (s < 0) { ++ return s + "? B"; ++ } else if (s < 1024) { ++ return s + " B"; ++ } else if (s < 1024 * 1024) { ++ double k = s / 1024.0; ++ String ks = dotPast(k, 3); ++ ++ return s + " (" + ks + " KB)"; ++ } else { ++ double m = s / (1024.0*1024.0); ++ String ms = dotPast(m, 3); ++ return s + " (" + ms + " MB)"; ++ } ++ } ++ + //Internally used to receive directory content from server + //Here, the server sends one file/directory with it's attributes + void readFTPMsgDirectoryListContent() throws IOException +@@ -1217,17 +1347,25 @@ + dwReserved0, + dwReserved1; + long ftCreationTime, ftLastAccessTime, ftLastWriteTime; ++ int ftCreationTimeL, ftLastAccessTimeL, ftLastWriteTimeL; ++ int ftCreationTimeH, ftLastAccessTimeH, ftLastWriteTimeH; + char cFileName, cAlternateFileName; + int length = 0; + is.readInt(); + length = is.readInt(); + dwFileAttributes = is.readInt(); + length -= 4; +- ftCreationTime = is.readLong(); ++ //ftCreationTime = is.readLong(); ++ ftCreationTimeL = is.readInt(); ++ ftCreationTimeH = is.readInt(); + length -= 8; +- ftLastAccessTime = is.readLong(); ++ //ftLastAccessTime = is.readLong(); ++ ftLastAccessTimeL = is.readInt(); ++ ftLastAccessTimeH = is.readInt(); + length -= 8; +- ftLastWriteTime = is.readLong(); ++ //ftLastWriteTime = is.readLong(); ++ ftLastWriteTimeL = is.readInt(); ++ ftLastWriteTimeH = is.readInt(); + length -= 8; + nFileSizeHigh = is.readInt(); + length -= 4; +@@ -1263,11 +1401,68 @@ || dwFileAttributes == 369623040) { fileName = " [" + fileName + "]"; @@ -990,10 +1659,21 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java + break; + } + } ++ //String s = "Lastmod: " + timeStr(ftLastWriteTimeL) + " " + fileName; ++ String f2 = fileName; ++ if (f2.length() < 24) { ++ for (int ik = f2.length(); ik < 24; ik++) { ++ f2 = f2 + " "; ++ } ++ } ++ String s = f2 + " \tLastmod: " + timeStr(ftLastWriteTimeL) + " \t\tSize: " + sizeStr(nFileSizeLow); ++ //s = fileName + " Lastmod: " + zogswap(ftLastWriteTimeL); + if (i >= 0) { + remoteDirsList.add(i, fileName); ++ remoteDirsListInfo.add(i, s); + } else { + remoteDirsList.add(fileName); ++ remoteDirsListInfo.add(s); + } +// end runge/x11vnc } @@ -1014,36 +1694,83 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java + break; + } + } ++ String f2 = fileName; ++ if (f2.length() < 24) { ++ for (int ik = f2.length(); ik < 24; ik++) { ++ f2 = f2 + " "; ++ } ++ } ++ String s = f2 + " \tLastmod: " + timeStr(ftLastWriteTimeL) + " \t\tSize: " + sizeStr(nFileSizeLow); ++ //s = fileName + " Lastmod: " + ftLastWriteTimeL + "/" + zogswap(ftLastWriteTimeL) + " Size: " + nFileSizeLow + "/" + zogswap(nFileSizeLow); + if (i >= 0) { + remoteFilesList.add(i, fileName); ++ remoteFilesListInfo.add(i, s); + } else { + remoteFilesList.add(fileName); ++ remoteFilesListInfo.add(s); + } +// end runge/x11vnc } // a.add(fileName); -@@ -1289,6 +1379,16 @@ +@@ -1282,14 +1477,31 @@ + + // sf@2004 + a.clear(); +- for (int i = 0; i < remoteDirsList.size(); i++) ++ b.clear(); ++ for (int i = 0; i < remoteDirsList.size(); i++) { + a.add(remoteDirsList.get(i)); +- for (int i = 0; i < remoteFilesList.size(); i++) ++ b.add(remoteDirsListInfo.get(i)); ++ } ++ for (int i = 0; i < remoteFilesList.size(); i++) { + a.add(remoteFilesList.get(i)); ++ b.add(remoteFilesListInfo.get(i)); ++ } remoteDirsList.clear(); ++ remoteDirsListInfo.clear(); remoteFilesList.clear(); ++ remoteFilesListInfo.clear(); +- viewer.ftp.printDirectory(a); +// begin runge/x11vnc + // Hack for double listing at startup... probably libvncserver bug.. + readServerDriveListCnt++; + if (readServerDriveListCnt == 2) { -+ if (System.currentTimeMillis() - readServerDriveListTime < 1500) { -+System.out.println("readServerDriveListCnt skip " + readServerDriveListCnt); ++ if (System.currentTimeMillis() - readServerDriveListTime < 2000) { ++//System.out.println("readServerDriveListCnt skip " + readServerDriveListCnt); + return; + } + } +// end runge/x11vnc - viewer.ftp.printDirectory(a); ++ viewer.ftp.printDirectory(a, b); + } + + //Internally used to signify the drive requested is not ready +@@ -1299,6 +1511,8 @@ + System.out.println("Remote Drive unavailable"); + viewer.ftp.connectionStatus.setText(" > WARNING - Remote Drive unavailable (possibly restricted access or media not present)"); + viewer.ftp.remoteStatus.setText("WARNING: Remote Drive unavailable"); ++ viewer.ftp.historyComboBox.insertItemAt(new String(" > WARNING: Remote Drive unavailable."), 0); ++ viewer.ftp.historyComboBox.setSelectedIndex(0); } -@@ -1312,6 +1412,10 @@ - 0, - 0, - null); + //Call this method to request the list of drives on the server. +@@ -1307,11 +1521,15 @@ + try + { + viewer.rfb.writeRfbFileTransferMsg( +- RfbProto.rfbDirContentRequest, +- RfbProto.rfbRDrivesList, +- 0, +- 0, +- null); ++ RfbProto.rfbDirContentRequest, ++ RfbProto.rfbRDrivesList, ++ 0, ++ 0, ++ null); +// begin runge/x11vnc + readServerDriveListCnt = 0; + readServerDriveListTime = System.currentTimeMillis(); @@ -1051,6 +1778,41 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java } catch (IOException e) { +@@ -1355,21 +1573,21 @@ + int h, + boolean incremental) + throws IOException { +- if (!viewer.ftp.isVisible()) { +- byte[] b = new byte[10]; ++ if (!viewer.ftp.isVisible()) { ++ byte[] b = new byte[10]; + +- b[0] = (byte) FramebufferUpdateRequest; +- b[1] = (byte) (incremental ? 1 : 0); +- b[2] = (byte) ((x >> 8) & 0xff); +- b[3] = (byte) (x & 0xff); +- b[4] = (byte) ((y >> 8) & 0xff); +- b[5] = (byte) (y & 0xff); +- b[6] = (byte) ((w >> 8) & 0xff); +- b[7] = (byte) (w & 0xff); +- b[8] = (byte) ((h >> 8) & 0xff); +- b[9] = (byte) (h & 0xff); ++ b[0] = (byte) FramebufferUpdateRequest; ++ b[1] = (byte) (incremental ? 1 : 0); ++ b[2] = (byte) ((x >> 8) & 0xff); ++ b[3] = (byte) (x & 0xff); ++ b[4] = (byte) ((y >> 8) & 0xff); ++ b[5] = (byte) (y & 0xff); ++ b[6] = (byte) ((w >> 8) & 0xff); ++ b[7] = (byte) (w & 0xff); ++ b[8] = (byte) ((h >> 8) & 0xff); ++ b[9] = (byte) (h & 0xff); + +- os.write(b); ++ os.write(b); + } + } + diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java --- JavaViewer.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500 +++ JavaViewer/SSLSocketToMe.java 2007-04-29 20:40:35.000000000 -0400 @@ -2478,7 +3240,7 @@ diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java +} diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java --- JavaViewer.orig/VncCanvas.java 2005-11-21 18:50:18.000000000 -0500 -+++ JavaViewer/VncCanvas.java 2007-05-16 15:57:36.000000000 -0400 ++++ JavaViewer/VncCanvas.java 2007-05-31 15:33:20.000000000 -0400 @@ -27,6 +27,9 @@ import java.lang.*; import java.util.zip.*; @@ -2512,7 +3274,17 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java colors = new Color[256]; // sf@2005 - Now Default for (int i = 0; i < 256; i++) -@@ -237,6 +256,9 @@ +@@ -202,6 +221,9 @@ + + public void setPixelFormat() throws IOException { + // sf@2005 - Adding more color modes ++ if (viewer.graftFtp) { ++ return; ++ } + if (viewer.options.eightBitColors > 0) + { + viewer.options.oldEightBitColors = viewer.options.eightBitColors; +@@ -237,6 +259,9 @@ } else { @@ -2522,7 +3294,38 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java rfb.writeSetPixelFormat( 32, 24, -@@ -1532,9 +1554,14 @@ +@@ -376,12 +401,14 @@ + // Start/stop session recording if necessary. + viewer.checkRecordingStatus(); + +- rfb.writeFramebufferUpdateRequest( +- 0, +- 0, +- rfb.framebufferWidth, +- rfb.framebufferHeight, +- false); ++ if (!viewer.graftFtp) { ++ rfb.writeFramebufferUpdateRequest( ++ 0, ++ 0, ++ rfb.framebufferWidth, ++ rfb.framebufferHeight, ++ false); ++ } + + // + // main dispatch loop +@@ -390,6 +417,9 @@ + while (true) { + // Read message type from the server. + int msgType = rfb.readServerMessageType(); ++ if (viewer.ftpOnly && msgType != RfbProto.rfbFileTransfer) { ++ System.out.println("msgType:" + msgType); ++ } + + // Process the message depending on its type. + switch (msgType) { +@@ -1532,9 +1562,14 @@ else { result = @@ -2540,7 +3343,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java } } else { result = 0; // Transparent pixel -@@ -1565,9 +1592,14 @@ +@@ -1565,9 +1600,14 @@ else { result = @@ -2560,8 +3363,17 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java result = 0; // Transparent pixel diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java --- JavaViewer.orig/VncViewer.java 2006-05-24 15:14:40.000000000 -0400 -+++ JavaViewer/VncViewer.java 2007-05-15 15:09:10.000000000 -0400 -@@ -115,6 +115,22 @@ ++++ JavaViewer/VncViewer.java 2007-05-31 16:13:10.000000000 -0400 +@@ -80,7 +80,7 @@ + GridBagLayout gridbag; + ButtonPanel buttonPanel; + AuthPanel authenticator; +- VncCanvas vc; ++ VncCanvas vc = null; + OptionsFrame options; + ClipboardFrame clipboard; + RecordingFrame rec; +@@ -115,6 +115,28 @@ int i; // mslogon support 2 end @@ -2578,18 +3390,126 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java +boolean trustUrlVncCert; + +boolean ignoreMSLogonCheck; ++boolean delayAuthPanel; ++boolean ftpOnly; ++boolean graftFtp; ++ ++boolean gotAuth; ++int authGot; +// end runge/x11vnc + + // // init() // -@@ -336,7 +352,12 @@ +@@ -124,19 +146,20 @@ + readParameters(); + + if (inSeparateFrame) { +- vncFrame = new Frame("Ultr@VNC"); +- if (!inAnApplet) { +- vncFrame.add("Center", this); +- } +- vncContainer = vncFrame; ++ vncFrame = new Frame("Ultr@VNC"); ++ if (!inAnApplet) { ++ vncFrame.add("Center", this); ++ } ++ vncContainer = vncFrame; + } else { +- vncContainer = this; ++ vncContainer = this; + } + + recordingSync = new Object(); + + options = new OptionsFrame(this); + clipboard = new ClipboardFrame(this); ++ + // authenticator = new AuthPanel(false); // mslogon support : go to connectAndAuthenticate() + if (RecordingFrame.checkSecurity()) + rec = new RecordingFrame(this); +@@ -147,7 +170,7 @@ + cursorUpdatesDef = null; + eightBitColorsDef = null; + +- if (inSeparateFrame) ++ if (inSeparateFrame && vncFrame != null) + vncFrame.addWindowListener(this); + + ftp = new FTPFrame(this); // KMC: FTPFrame creation +@@ -186,6 +209,30 @@ + gbc.weightx = 1.0; + gbc.weighty = 1.0; + ++ if (ftpOnly) { ++ if (showControls) { ++ buttonPanel.enableButtons(); ++ } ++ ActionListener taskPerformer = new ActionListener() { ++ public void actionPerformed(ActionEvent evt) { ++ vncFrame.setVisible(false); ++ ftp.setSavedLocations(); ++ if (ftp.isVisible()) { ++ ftp.doClose(); ++ } else { ++ ftp.doOpen(); ++ } ++ rfb.readServerDriveList(); ++ } ++ }; ++ Timer t = new Timer(300, taskPerformer); ++ t.setRepeats(false); ++ t.start(); ++ ++ vc.processNormalProtocol(); ++ return; ++ } ++ + // Add ScrollPanel to applet mode + + // Create a panel which itself is resizeable and can hold +@@ -286,6 +333,24 @@ + + void connectAndAuthenticate() throws Exception { + ++ if (graftFtp) { ++ rfb = new RfbProto(host, port, this); ++ rfb.desktopName = "ftponly"; ++ rfb.framebufferWidth = 12; ++ rfb.framebufferHeight = 12; ++ rfb.bitsPerPixel = 32; ++ rfb.depth = 24; ++ rfb.trueColour = true; ++ rfb.redMax = 255; ++ rfb.greenMax = 255; ++ rfb.blueMax = 255; ++ rfb.redShift = 16; ++ rfb.greenShift = 8; ++ rfb.blueShift = 0; ++ rfb.inNormalProtocol = true; ++ return; ++ } ++ + // If "ENCPASSWORD" parameter is set, decrypt the password into + // the passwordParam string. + +@@ -336,7 +401,22 @@ // - prologueDetectAuthProtocol() ; +// begin runge/x11vnc ++ gotAuth = false; ++ if (delayAuthPanel) { ++ if (tryAuthenticate(null, null)) { ++ if (inSeparateFrame) { ++ vncFrame.pack(); ++ vncFrame.show(); ++ } ++ return; ++ } ++ } +// prologueDetectAuthProtocol() ; + if (ignoreMSLogonCheck == false) { + prologueDetectAuthProtocol() ; @@ -2598,16 +3518,86 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java authenticator = new AuthPanel(mslogon); -@@ -435,7 +456,7 @@ +@@ -390,6 +470,10 @@ + break; + //mslogon support end + ++// begin runge/x11vnc ++ gotAuth = false; ++// end runge/x11vnc ++ + // Retry on authentication failure. + authenticator.retry(); + } +@@ -405,9 +489,11 @@ - rfb.readVersionMsg(); + void prologueDetectAuthProtocol() throws Exception { -- System.out.println("RFB server supports protocol version " + -+ System.out.println("RFB server supports protocol version: " + +- rfb = new RfbProto(host, port, this); ++ if (!gotAuth) { ++ rfb = new RfbProto(host, port, this); + +- rfb.readVersionMsg(); ++ rfb.readVersionMsg(); ++ } + + System.out.println("RFB server supports protocol version " + rfb.serverMajor + "." + rfb.serverMinor); +@@ -431,16 +517,36 @@ - rfb.writeVersionMsg(); -@@ -804,6 +825,75 @@ + boolean tryAuthenticate(String us, String pw) throws Exception { + +- rfb = new RfbProto(host, port, this); ++ int authScheme; + +- rfb.readVersionMsg(); ++ if (!gotAuth) { ++ rfb = new RfbProto(host, port, this); + +- System.out.println("RFB server supports protocol version " + +- rfb.serverMajor + "." + rfb.serverMinor); ++ rfb.readVersionMsg(); + +- rfb.writeVersionMsg(); ++ System.out.println("RFB server supports protocol version: " + ++ rfb.serverMajor + "." + rfb.serverMinor); ++ ++ rfb.writeVersionMsg(); ++ ++ authScheme = rfb.readAuthScheme(); + +- int authScheme = rfb.readAuthScheme(); ++ gotAuth = true; ++ authGot = authScheme; ++ } else { ++ authScheme = authGot; ++ } ++// begin runge/x11vnc ++ if (delayAuthPanel && pw == null) { ++ if (authScheme == RfbProto.NoAuth) { ++ System.out.println("No authentication needed"); ++ return true; ++ } else { ++ return false; ++ } ++ } ++System.out.println("as: " + authScheme); ++// end runge/x11vnc + + switch (authScheme) { + +@@ -629,6 +735,10 @@ + + void doProtocolInitialisation() throws IOException { + ++ if (graftFtp) { ++ return; ++ } ++ + rfb.writeClientInit(); + + rfb.readServerInit(); +@@ -804,6 +914,90 @@ deferScreenUpdates = readIntParameter("Defer screen updates", 20); deferCursorUpdates = readIntParameter("Defer cursor updates", 10); deferUpdateRequests = readIntParameter("Defer update requests", 50); @@ -2679,6 +3669,21 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java + if (str != null && str.equalsIgnoreCase("Yes")) { + ignoreMSLogonCheck = true; + } ++ ftpOnly = false; ++ str = readParameter("ftpOnly", false); ++ if (str != null && str.equalsIgnoreCase("Yes")) { ++ ftpOnly = true; ++ } ++ graftFtp = false; ++ str = readParameter("graftFtp", false); ++ if (str != null && str.equalsIgnoreCase("Yes")) { ++ graftFtp = true; ++ } ++ delayAuthPanel = false; ++ str = readParameter("delayAuthPanel", false); ++ if (str != null && str.equalsIgnoreCase("Yes")) { ++ delayAuthPanel = true; ++ } +// end runge/x11vnc } |