You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5495 lines
158 KiB
5495 lines
158 KiB
16 years ago
|
diff -Naur JavaViewer.orig/ButtonPanel.java JavaViewer/ButtonPanel.java
|
||
|
--- JavaViewer.orig/ButtonPanel.java 2004-12-12 20:51:02.000000000 -0500
|
||
16 years ago
|
+++ 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 @@
|
||
16 years ago
|
}
|
||
|
else if (evt.getSource() == ftpButton)
|
||
|
{
|
||
16 years ago
|
- viewer.ftp.setVisible(!viewer.ftp.isVisible());
|
||
16 years ago
|
+// begin runge/x11vnc
|
||
16 years ago
|
+ if (viewer.ftpOnly) {
|
||
|
+ viewer.vncFrame.setVisible(false);
|
||
|
+ }
|
||
16 years ago
|
+ viewer.ftp.setSavedLocations();
|
||
16 years ago
|
+ if (viewer.ftp.isVisible()) {
|
||
|
+ viewer.ftp.doClose();
|
||
|
+ } else {
|
||
|
+ viewer.ftp.doOpen();
|
||
|
+ }
|
||
16 years ago
|
+// end runge/x11vnc
|
||
|
viewer.rfb.readServerDriveList();
|
||
|
-
|
||
|
+
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
|
||
|
--- JavaViewer.orig/FTPFrame.java 2005-03-15 23:53:14.000000000 -0500
|
||
14 years ago
|
+++ JavaViewer/FTPFrame.java 2009-01-13 09:48:30.000000000 -0500
|
||
15 years ago
|
@@ -24,8 +24,17 @@
|
||
16 years ago
|
import java.io.*;
|
||
|
import java.util.ArrayList;
|
||
16 years ago
|
import java.util.Vector;
|
||
16 years ago
|
+import java.util.Date;
|
||
16 years ago
|
import javax.swing.*;
|
||
|
|
||
15 years ago
|
+import java.nio.ByteBuffer;
|
||
|
+import java.nio.CharBuffer;
|
||
|
+import java.nio.charset.*;
|
||
|
+
|
||
16 years ago
|
+// begin runge/x11vnc
|
||
|
+import java.util.Arrays;
|
||
|
+// end runge/x11vnc
|
||
|
+
|
||
|
|
||
|
/*
|
||
|
* Created on Feb 25, 2004
|
||
15 years ago
|
@@ -74,12 +83,31 @@
|
||
16 years ago
|
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
|
||
16 years ago
|
private File localSelection = null; // Holds the currently selected local file
|
||
|
private String remoteSelection = null; // Holds the currently selected remote file
|
||
|
public String selectedTable = null;
|
||
|
+
|
||
|
+// begin runge/x11vnc
|
||
|
+ private javax.swing.JButton viewButton = null;
|
||
15 years ago
|
+ private javax.swing.JButton refreshButton = null;
|
||
16 years ago
|
+ public File saveLocalDirectory = null;
|
||
|
+ public long saveLocalDirectoryTime = 0;
|
||
|
+ public int saveLocalDirectoryCount = 0;
|
||
|
+ public String saveRemoteDirectory = null;
|
||
|
+ public long saveRemoteDirectoryTime = 0;
|
||
|
+ public int saveRemoteDirectoryCount = 0;
|
||
|
+ private boolean localCurrentIsDir = true;
|
||
16 years ago
|
+ private int lastRemoteIndex = -1;
|
||
|
+ private int lastLocalIndex = -1;
|
||
15 years ago
|
+ private boolean doingShortcutDir = false;
|
||
|
+ private boolean gotShortcutDir = false;
|
||
|
+ private boolean ignore_events = false;
|
||
16 years ago
|
+// end runge/x11vnc
|
||
|
|
||
|
// sf@2004 - Separate directories and files for better lisibility
|
||
|
private ArrayList DirsList;
|
||
15 years ago
|
@@ -125,11 +153,61 @@
|
||
16 years ago
|
|
||
|
void refreshRemoteLocation()
|
||
|
{
|
||
|
+
|
||
15 years ago
|
+//System.out.println("refreshRemoteLocation1");
|
||
16 years ago
|
remoteList.clear();
|
||
16 years ago
|
+ remoteListInfo.clear();
|
||
16 years ago
|
remoteFileTable.setListData(remoteList);
|
||
|
+System.out.println("refreshRemoteLocation '" + remoteLocation.getText() + "'"); // runge/x11vnc
|
||
|
viewer.rfb.readServerDirectory(remoteLocation.getText());
|
||
|
}
|
||
|
|
||
|
+// begin runge/x11vnc
|
||
|
+ public void setSavedLocations() {
|
||
|
+ saveLocalDirectory = currentLocalDirectory;
|
||
|
+ saveLocalDirectoryTime = System.currentTimeMillis();
|
||
|
+ saveLocalDirectoryCount = 0;
|
||
|
+
|
||
|
+ if (remoteLocation != null) {
|
||
|
+ saveRemoteDirectory = remoteLocation.getText();
|
||
|
+System.out.println("RemoteSave '" + saveRemoteDirectory + "'");
|
||
|
+ }
|
||
|
+ saveRemoteDirectoryTime = System.currentTimeMillis();
|
||
|
+ saveRemoteDirectoryCount = 0;
|
||
|
+ }
|
||
|
+
|
||
|
+ private File saveLocalHack(File dir) {
|
||
|
+ saveLocalDirectoryCount++;
|
||
16 years ago
|
+//System.out.println("L " + saveLocalDirectoryCount + " dt: " + (System.currentTimeMillis() - saveLocalDirectoryTime) + " - " + saveLocalDirectory);
|
||
16 years ago
|
+ if (System.currentTimeMillis() > saveLocalDirectoryTime + 2000 || saveLocalDirectoryCount > 2) {
|
||
|
+ saveLocalDirectory = null;
|
||
|
+ }
|
||
|
+ if (saveLocalDirectory != null) {
|
||
|
+ currentLocalDirectory = saveLocalDirectory;
|
||
|
+ localLocation.setText(saveLocalDirectory.toString());
|
||
|
+ return saveLocalDirectory;
|
||
|
+ } else {
|
||
|
+ return dir;
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ private String saveRemoteHack(String indrive) {
|
||
|
+ saveRemoteDirectoryCount++;
|
||
16 years ago
|
+//System.out.println("R " + saveRemoteDirectoryCount + " - " + saveRemoteDirectory);
|
||
16 years ago
|
+ if (saveRemoteDirectory != null && saveRemoteDirectoryCount > 1) {
|
||
|
+ saveRemoteDirectory = null;
|
||
|
+ }
|
||
|
+ if (saveRemoteDirectory != null) {
|
||
|
+ if (! saveRemoteDirectory.equals("")) {
|
||
|
+System.out.println("saveRemoteHack setText + refreshRemoteLocation '" + saveRemoteDirectory + "'");
|
||
|
+ return saveRemoteDirectory;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ return indrive;
|
||
|
+ }
|
||
|
+// end runge/x11vnc
|
||
|
+
|
||
|
+
|
||
|
/*
|
||
|
* 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
|
||
15 years ago
|
@@ -143,6 +221,9 @@
|
||
15 years ago
|
int size = str.length();
|
||
|
String driveType = null;
|
||
|
String[] drive = new String[str.length() / 3];
|
||
|
+ int idx = 0, C_drive = -1, O_drive = -1;
|
||
|
+
|
||
|
+System.out.println("ComboBox: Str '" + str + "'");
|
||
|
|
||
|
// Loop through the string to create a String[]
|
||
|
for (int i = 0; i < size; i = i + 3) {
|
||
14 years ago
|
@@ -150,26 +231,68 @@
|
||
15 years ago
|
driveType = str.substring(i + 2, i + 3);
|
||
|
if (driveType.compareTo("f") == 0)
|
||
|
drive[i / 3] += "\\ Floppy";
|
||
|
- if (driveType.compareTo("l") == 0)
|
||
|
+ if (driveType.compareTo("l") == 0) {
|
||
|
drive[i / 3] += "\\ Local Disk";
|
||
|
+ if (drive[i/3].substring(0,1).toUpperCase().equals("C")) {
|
||
|
+ C_drive = idx;
|
||
|
+ } else if (O_drive < 0) {
|
||
|
+ O_drive = idx;
|
||
|
+ }
|
||
|
+ }
|
||
|
if (driveType.compareTo("c") == 0)
|
||
|
drive[i / 3] += "\\ CD-ROM";
|
||
|
if (driveType.compareTo("n") == 0)
|
||
|
drive[i / 3] += "\\ Network";
|
||
|
|
||
|
remoteDrivesComboBox.addItem(drive[i / 3]);
|
||
|
+System.out.println("ComboBox: Add " + idx + " '" + drive[i/3] + "'");
|
||
|
+ idx++;
|
||
14 years ago
|
+ }
|
||
15 years ago
|
+
|
||
|
+ // runge
|
||
14 years ago
|
+ if (viewer.ftpDropDown != null) {
|
||
|
+ String[] dd = viewer.ftpDropDown.split("\\.");
|
||
|
+ for (int i=0; i < dd.length; i++) {
|
||
|
+ if (!dd[i].equals("")) {
|
||
14 years ago
|
+ String s = dd[i];
|
||
|
+ if (s.startsWith("TOP_")) {
|
||
|
+ s = s.substring(4);
|
||
|
+ remoteDrivesComboBox.insertItemAt(" [" + s + "]", 0);
|
||
|
+ } else {
|
||
|
+ remoteDrivesComboBox.addItem(" [" + s + "]");
|
||
|
+ }
|
||
14 years ago
|
+ }
|
||
|
+ }
|
||
|
+ } else {
|
||
|
+ remoteDrivesComboBox.addItem(" [My Documents]");
|
||
|
+ remoteDrivesComboBox.addItem(" [Desktop]");
|
||
|
+ remoteDrivesComboBox.addItem(" [Home]");
|
||
|
}
|
||
15 years ago
|
+
|
||
|
//sf@ - Select Drive C:as default if possible
|
||
|
boolean bFound = false;
|
||
|
- for(int i = 0; i < remoteDrivesComboBox.getItemCount() ; i++)
|
||
|
- {
|
||
|
- if(remoteDrivesComboBox.getItemAt(i).toString().substring(0,1).toUpperCase().equals("C"))
|
||
|
- {
|
||
|
- remoteDrivesComboBox.setSelectedIndex(i);
|
||
|
+
|
||
|
+ if (false) {
|
||
|
+ for(int i = 0; i < remoteDrivesComboBox.getItemCount() ; i++) {
|
||
|
+ if(remoteDrivesComboBox.getItemAt(i).toString().substring(0,1).toUpperCase().equals("C")) {
|
||
|
+ remoteDrivesComboBox.setSelectedIndex(i);
|
||
|
+ bFound = true;
|
||
|
+ }
|
||
|
+ }
|
||
|
+ } else {
|
||
15 years ago
|
+ if (C_drive >= 0) {
|
||
15 years ago
|
+ remoteDrivesComboBox.setSelectedIndex(C_drive);
|
||
15 years ago
|
+ bFound = true;
|
||
15 years ago
|
+System.out.println("ComboBox: C_drive index: " + C_drive);
|
||
15 years ago
|
+ } else if (O_drive >= 0) {
|
||
15 years ago
|
+ remoteDrivesComboBox.setSelectedIndex(O_drive);
|
||
15 years ago
|
bFound = true;
|
||
15 years ago
|
+System.out.println("ComboBox: Other_drive index: " + O_drive);
|
||
|
}
|
||
|
}
|
||
|
+
|
||
|
if (!bFound) remoteDrivesComboBox.setSelectedIndex(0);
|
||
|
+
|
||
|
updateDriveList = false;
|
||
|
return drive;
|
||
|
}
|
||
14 years ago
|
@@ -185,6 +308,8 @@
|
||
16 years ago
|
stopButton.setVisible(true);
|
||
|
stopButton.setEnabled(true);
|
||
|
receiveButton.setEnabled(false);
|
||
|
+ viewButton.setEnabled(false); // runge/x11vnc
|
||
15 years ago
|
+ refreshButton.setEnabled(false);
|
||
16 years ago
|
remoteTopButton.setEnabled(false);
|
||
|
sendButton.setEnabled(false);
|
||
|
remoteFileTable.setEnabled(false);
|
||
14 years ago
|
@@ -207,6 +332,8 @@
|
||
16 years ago
|
stopButton.setVisible(false);
|
||
|
stopButton.setEnabled(false);
|
||
|
receiveButton.setEnabled(true);
|
||
|
+ viewButton.setEnabled(true); // runge/x11vnc
|
||
15 years ago
|
+ refreshButton.setEnabled(true);
|
||
16 years ago
|
remoteTopButton.setEnabled(true);
|
||
|
sendButton.setEnabled(true);
|
||
|
remoteFileTable.setEnabled(true);
|
||
14 years ago
|
@@ -221,10 +348,11 @@
|
||
16 years ago
|
/*
|
||
|
* 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);
|
||
|
}
|
||
14 years ago
|
@@ -235,10 +363,12 @@
|
||
15 years ago
|
* @return void
|
||
|
*/
|
||
|
private void initialize() {
|
||
|
+ ignore_events = true;
|
||
|
this.setSize(794, 500);
|
||
|
this.setContentPane(getJContentPane());
|
||
|
+ ignore_events = false;
|
||
|
updateDriveList = true;
|
||
|
- }
|
||
|
+ }
|
||
|
/**
|
||
|
* This method initializes jContentPane. This is the main content pane
|
||
|
*
|
||
14 years ago
|
@@ -253,6 +383,33 @@
|
||
16 years ago
|
jContentPane.add(getRemotePanel(), java.awt.BorderLayout.EAST);
|
||
|
jContentPane.add(getLocalPanel(), java.awt.BorderLayout.WEST);
|
||
|
jContentPane.add(getButtonPanel(), java.awt.BorderLayout.CENTER);
|
||
15 years ago
|
+
|
||
|
+ KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
||
|
+ AbstractAction escapeAction = new AbstractAction() {
|
||
|
+ public void actionPerformed(ActionEvent actionEvent) {
|
||
|
+ System.out.println("Escape Pressed");
|
||
|
+ if (viewer.ftpOnly) {
|
||
|
+ System.out.println("exiting...");
|
||
|
+ System.exit(0);
|
||
|
+ } else {
|
||
|
+ doClose();
|
||
|
+ }
|
||
|
+ }
|
||
|
+ };
|
||
|
+ jContentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(stroke, "escapeAction");
|
||
|
+ jContentPane.getInputMap().put(stroke, "escapeAction");
|
||
|
+ jContentPane.getActionMap().put("escapeAction", escapeAction);
|
||
|
+
|
||
|
+ stroke = KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK);
|
||
|
+ AbstractAction resetAction = new AbstractAction() {
|
||
|
+ public void actionPerformed(ActionEvent actionEvent) {
|
||
|
+ System.out.println("Ctrl-R Pressed");
|
||
|
+ doReset();
|
||
|
+ }
|
||
|
+ };
|
||
|
+ jContentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(stroke, "resetAction");
|
||
|
+ jContentPane.getInputMap().put(stroke, "resetAction");
|
||
|
+ jContentPane.getActionMap().put("resetAction", resetAction);
|
||
16 years ago
|
}
|
||
|
return jContentPane;
|
||
|
}
|
||
14 years ago
|
@@ -270,6 +427,7 @@
|
||
16 years ago
|
topPanelLocal.add(getLocalMachineLabel(), java.awt.BorderLayout.CENTER);
|
||
|
topPanelLocal.add(getLocalTopButton(), java.awt.BorderLayout.EAST);
|
||
|
topPanelLocal.setBackground(java.awt.Color.lightGray);
|
||
16 years ago
|
+//System.out.println("getTopPanelLocal");
|
||
16 years ago
|
}
|
||
|
return topPanelLocal;
|
||
|
}
|
||
14 years ago
|
@@ -288,6 +446,7 @@
|
||
16 years ago
|
topPanelRemote.add(getRemoteMachineLabel(), java.awt.BorderLayout.CENTER);
|
||
|
topPanelRemote.add(getRemoteTopButton(), java.awt.BorderLayout.EAST);
|
||
|
topPanelRemote.setBackground(java.awt.Color.lightGray);
|
||
16 years ago
|
+//System.out.println("getTopPanelRemote");
|
||
16 years ago
|
}
|
||
|
return topPanelRemote;
|
||
|
}
|
||
14 years ago
|
@@ -301,6 +460,7 @@
|
||
16 years ago
|
if (topPanelCenter == null) {
|
||
|
topPanelCenter = new javax.swing.JPanel();
|
||
|
topPanelCenter.add(getDummyButton(), null);
|
||
16 years ago
|
+//System.out.println("getTopPanelCenter");
|
||
16 years ago
|
}
|
||
|
return topPanelCenter;
|
||
|
}
|
||
14 years ago
|
@@ -328,6 +488,7 @@
|
||
16 years ago
|
topPanel.add(getRemoteTopButton(), null);
|
||
|
topPanel.setBackground(java.awt.Color.lightGray);
|
||
|
*/
|
||
16 years ago
|
+//System.out.println("getTopPanel");
|
||
16 years ago
|
}
|
||
|
return topPanel;
|
||
|
}
|
||
14 years ago
|
@@ -348,6 +509,7 @@
|
||
16 years ago
|
statusPanel.add(getJProgressBar(), null);
|
||
|
statusPanel.add(getConnectionStatus(), null);
|
||
|
statusPanel.setBackground(java.awt.Color.lightGray);
|
||
16 years ago
|
+//System.out.println("getStatusPanel");
|
||
16 years ago
|
|
||
|
}
|
||
|
return statusPanel;
|
||
14 years ago
|
@@ -368,6 +530,7 @@
|
||
16 years ago
|
remotePanel.add(getRemoteScrollPane(), null);
|
||
|
remotePanel.add(getRemoteStatus(), null);
|
||
|
remotePanel.setBackground(java.awt.Color.lightGray);
|
||
16 years ago
|
+//System.out.println("getRemotePanel");
|
||
16 years ago
|
}
|
||
|
return remotePanel;
|
||
|
}
|
||
14 years ago
|
@@ -390,6 +553,7 @@
|
||
16 years ago
|
localPanel.setComponentOrientation(
|
||
|
java.awt.ComponentOrientation.UNKNOWN);
|
||
|
localPanel.setName("localPanel");
|
||
16 years ago
|
+//System.out.println("getLocalPanel");
|
||
16 years ago
|
}
|
||
|
return localPanel;
|
||
|
}
|
||
14 years ago
|
@@ -405,12 +569,15 @@
|
||
16 years ago
|
buttonPanel = new javax.swing.JPanel();
|
||
|
buttonPanel.setLayout(null);
|
||
|
buttonPanel.add(getReceiveButton(), null);
|
||
15 years ago
|
+ buttonPanel.add(getRefreshButton(), null); // runge/x11vnc
|
||
16 years ago
|
+ buttonPanel.add(getViewButton(), null); // runge/x11vnc
|
||
|
buttonPanel.add(getNewFolderButton(), null);
|
||
|
buttonPanel.add(getCloseButton(), null);
|
||
|
buttonPanel.add(getDeleteButton(), null);
|
||
16 years ago
|
buttonPanel.add(getSendButton(), null);
|
||
|
buttonPanel.add(getStopButton(), null);
|
||
|
buttonPanel.setBackground(java.awt.Color.lightGray);
|
||
16 years ago
|
+//System.out.println("getButtonPanel");
|
||
16 years ago
|
}
|
||
|
return buttonPanel;
|
||
|
}
|
||
14 years ago
|
@@ -422,10 +589,11 @@
|
||
16 years ago
|
private javax.swing.JButton getSendButton() {
|
||
|
if (sendButton == null) {
|
||
|
sendButton = new javax.swing.JButton();
|
||
|
- sendButton.setBounds(20, 30, 97, 25);
|
||
|
+ sendButton.setBounds(15, 30, 107, 25); // runge/x11vnc
|
||
|
sendButton.setText("Send >>");
|
||
|
sendButton.setName("sendButton");
|
||
|
sendButton.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getSendButton");
|
||
16 years ago
|
|
||
|
}
|
||
|
return sendButton;
|
||
14 years ago
|
@@ -438,7 +606,7 @@
|
||
16 years ago
|
private javax.swing.JButton getReceiveButton() {
|
||
|
if (receiveButton == null) {
|
||
|
receiveButton = new javax.swing.JButton();
|
||
|
- receiveButton.setBounds(20, 60, 97, 25);
|
||
|
+ receiveButton.setBounds(15, 60, 107, 25); // runge/x11vnc
|
||
|
receiveButton.setText("<< Receive");
|
||
|
receiveButton.setName("receiveButton");
|
||
|
receiveButton.addActionListener(this);
|
||
14 years ago
|
@@ -453,7 +621,7 @@
|
||
16 years ago
|
private javax.swing.JButton getDeleteButton() {
|
||
|
if (deleteButton == null) {
|
||
|
deleteButton = new javax.swing.JButton();
|
||
|
- deleteButton.setBounds(20, 110, 97, 25);
|
||
|
+ deleteButton.setBounds(15, 110, 107, 25); // runge/x11vnc
|
||
|
deleteButton.setText("Delete File");
|
||
|
deleteButton.setName("deleteButton");
|
||
|
deleteButton.addActionListener(this);
|
||
14 years ago
|
@@ -468,7 +636,7 @@
|
||
16 years ago
|
private javax.swing.JButton getNewFolderButton() {
|
||
|
if (newFolderButton == null) {
|
||
|
newFolderButton = new javax.swing.JButton();
|
||
|
- newFolderButton.setBounds(20, 140, 97, 25);
|
||
|
+ newFolderButton.setBounds(15, 140, 107, 25); // runge/x11vnc
|
||
|
newFolderButton.setText("New Folder");
|
||
|
newFolderButton.setName("newFolderButton");
|
||
|
newFolderButton.addActionListener(this);
|
||
14 years ago
|
@@ -476,6 +644,39 @@
|
||
16 years ago
|
return newFolderButton;
|
||
|
}
|
||
|
|
||
|
+// begin runge/x11vnc
|
||
|
+ /**
|
||
15 years ago
|
+ * This method initializes refreshButton
|
||
|
+ *
|
||
|
+ * @return javax.swing.JButton
|
||
|
+ */
|
||
|
+ private javax.swing.JButton getRefreshButton() {
|
||
|
+ if (refreshButton == null) {
|
||
|
+ refreshButton = new javax.swing.JButton();
|
||
|
+ refreshButton.setBounds(15, 170, 107, 25);
|
||
|
+ refreshButton.setText("Refresh");
|
||
|
+ refreshButton.setName("refreshButton");
|
||
|
+ refreshButton.addActionListener(this);
|
||
|
+ }
|
||
|
+ return refreshButton;
|
||
|
+ }
|
||
|
+ /**
|
||
16 years ago
|
+ * This method initializes viewButton
|
||
|
+ *
|
||
|
+ * @return javax.swing.JButton
|
||
|
+ */
|
||
|
+ private javax.swing.JButton getViewButton() {
|
||
|
+ if (viewButton == null) {
|
||
|
+ viewButton = new javax.swing.JButton();
|
||
15 years ago
|
+ viewButton.setBounds(15, 200, 107, 25);
|
||
16 years ago
|
+ viewButton.setText("View File");
|
||
|
+ viewButton.setName("viewButton");
|
||
|
+ viewButton.addActionListener(this);
|
||
|
+ }
|
||
|
+ return viewButton;
|
||
|
+ }
|
||
|
+// end runge/x11vnc
|
||
|
+
|
||
|
/**
|
||
|
* This method initializes stopButton
|
||
|
*
|
||
14 years ago
|
@@ -486,7 +687,7 @@
|
||
16 years ago
|
if (stopButton == null)
|
||
|
{
|
||
|
stopButton = new javax.swing.JButton();
|
||
|
- stopButton.setBounds(20, 200, 97, 25);
|
||
15 years ago
|
+ stopButton.setBounds(15, 230, 107, 25); // runge/x11vnc
|
||
16 years ago
|
stopButton.setText("Stop");
|
||
|
stopButton.setName("stopButton");
|
||
|
stopButton.addActionListener(this);
|
||
14 years ago
|
@@ -503,8 +704,12 @@
|
||
16 years ago
|
private javax.swing.JButton getCloseButton() {
|
||
|
if (closeButton == null) {
|
||
|
closeButton = new javax.swing.JButton();
|
||
|
- closeButton.setBounds(20, 325, 97, 25);
|
||
16 years ago
|
- closeButton.setText("Close");
|
||
16 years ago
|
+ closeButton.setBounds(15, 325, 107, 25); // runge/x11vnc
|
||
16 years ago
|
+ if (viewer.ftpOnly) {
|
||
|
+ closeButton.setText("Quit");
|
||
|
+ } else {
|
||
|
+ closeButton.setText("Close");
|
||
|
+ }
|
||
16 years ago
|
closeButton.setName("closeButton");
|
||
|
closeButton.addActionListener(this);
|
||
16 years ago
|
}
|
||
14 years ago
|
@@ -551,6 +756,7 @@
|
||
16 years ago
|
//Select the second entry (e.g. C:\)
|
||
|
// localDrivesComboBox.setSelectedIndex(1);
|
||
|
localDrivesComboBox.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getLocalDrivesComboBox");
|
||
16 years ago
|
}
|
||
|
updateDriveList = false;
|
||
|
return localDrivesComboBox;
|
||
14 years ago
|
@@ -567,6 +773,7 @@
|
||
16 years ago
|
remoteDrivesComboBox.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
|
remoteDrivesComboBox.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getRemoteDrivesComboBox");
|
||
16 years ago
|
|
||
|
}
|
||
|
return remoteDrivesComboBox;
|
||
14 years ago
|
@@ -587,6 +794,7 @@
|
||
16 years ago
|
localMachineLabel.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.BOLD, 11));
|
||
|
localMachineLabel.setEditable(false);
|
||
16 years ago
|
+//System.out.println("getLocalMachineLabel");
|
||
16 years ago
|
}
|
||
|
return localMachineLabel;
|
||
|
}
|
||
14 years ago
|
@@ -622,6 +830,7 @@
|
||
16 years ago
|
localTopButton.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
|
||
|
localTopButton.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getLocalTopButton");
|
||
16 years ago
|
}
|
||
|
return localTopButton;
|
||
|
}
|
||
14 years ago
|
@@ -638,6 +847,7 @@
|
||
16 years ago
|
remoteTopButton.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
|
||
|
remoteTopButton.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getRemoteTopButton");
|
||
16 years ago
|
}
|
||
|
return remoteTopButton;
|
||
|
}
|
||
14 years ago
|
@@ -650,9 +860,24 @@
|
||
16 years ago
|
private javax.swing.JList getLocalFileTable() {
|
||
|
if (localFileTable == null) {
|
||
|
localList = new Vector(0);
|
||
|
+ localListInfo = new Vector(0);
|
||
16 years ago
|
localFileTable = new JList(localList);
|
||
16 years ago
|
+ 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));
|
||
|
+ }
|
||
|
+ };
|
||
16 years ago
|
localFileTable.addMouseListener(this);
|
||
16 years ago
|
+ localFileTable.addMouseMotionListener(mlisten);
|
||
16 years ago
|
localFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||
16 years ago
|
+//System.out.println("getLocalFileTable");
|
||
16 years ago
|
}
|
||
|
return localFileTable;
|
||
|
}
|
||
14 years ago
|
@@ -669,6 +894,7 @@
|
||
16 years ago
|
localScrollPane.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
|
localScrollPane.setName("localFileList");
|
||
16 years ago
|
+//System.out.println("getLocalScrollPane");
|
||
16 years ago
|
}
|
||
|
return localScrollPane;
|
||
|
}
|
||
14 years ago
|
@@ -680,10 +906,25 @@
|
||
16 years ago
|
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));
|
||
|
+ }
|
||
|
+ };
|
||
16 years ago
|
remoteFileTable.addMouseListener(this);
|
||
16 years ago
|
+ remoteFileTable.addMouseMotionListener(mlisten);
|
||
16 years ago
|
remoteFileTable.setSelectedValue("C:\\", false);
|
||
|
remoteFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||
16 years ago
|
+//System.out.println("getRemoteFileTable");
|
||
16 years ago
|
|
||
|
}
|
||
|
return remoteFileTable;
|
||
14 years ago
|
@@ -698,6 +939,7 @@
|
||
16 years ago
|
remoteScrollPane = new javax.swing.JScrollPane();
|
||
|
remoteScrollPane.setViewportView(getRemoteFileTable());
|
||
|
remoteScrollPane.setPreferredSize(new java.awt.Dimension(325, 418));
|
||
16 years ago
|
+//System.out.println("getRemoteScrollPane");
|
||
16 years ago
|
}
|
||
|
return remoteScrollPane;
|
||
|
}
|
||
14 years ago
|
@@ -716,6 +958,7 @@
|
||
16 years ago
|
remoteLocation.setBackground(new Color(255,255,238));
|
||
|
remoteLocation.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
16 years ago
|
+//System.out.println("getRemoteLocation");
|
||
16 years ago
|
}
|
||
|
return remoteLocation;
|
||
|
}
|
||
14 years ago
|
@@ -732,6 +975,7 @@
|
||
16 years ago
|
localLocation.setBackground( new Color(255,255,238));
|
||
|
localLocation.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
16 years ago
|
+//System.out.println("getLocalLocation");
|
||
16 years ago
|
}
|
||
|
return localLocation;
|
||
|
}
|
||
14 years ago
|
@@ -748,6 +992,7 @@
|
||
16 years ago
|
localStatus.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
|
localStatus.setEditable(false);
|
||
16 years ago
|
+//System.out.println("getLocalStatus");
|
||
16 years ago
|
}
|
||
|
return localStatus;
|
||
|
}
|
||
14 years ago
|
@@ -764,6 +1009,7 @@
|
||
16 years ago
|
remoteStatus.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
|
remoteStatus.setEditable(false);
|
||
16 years ago
|
+//System.out.println("getRemoteStatus");
|
||
16 years ago
|
}
|
||
|
return remoteStatus;
|
||
|
}
|
||
14 years ago
|
@@ -777,9 +1023,10 @@
|
||
15 years ago
|
historyComboBox = new javax.swing.JComboBox();
|
||
|
historyComboBox.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
|
||
|
- historyComboBox.insertItemAt(new String("Pulldown to view history ..."),0);
|
||
|
+ historyComboBox.insertItemAt(new String("Pulldown to view history; Press Escape to Close/Quit; Press Ctrl-R to Reset Panel."),0);
|
||
16 years ago
|
historyComboBox.setSelectedIndex(0);
|
||
|
historyComboBox.addActionListener(this);
|
||
16 years ago
|
+//System.out.println("getHistoryComboBox");
|
||
16 years ago
|
}
|
||
|
return historyComboBox;
|
||
|
}
|
||
14 years ago
|
@@ -791,6 +1038,7 @@
|
||
16 years ago
|
private javax.swing.JProgressBar getJProgressBar() {
|
||
|
if (jProgressBar == null) {
|
||
|
jProgressBar = new javax.swing.JProgressBar();
|
||
16 years ago
|
+//System.out.println("getJProgressBar");
|
||
16 years ago
|
}
|
||
|
return jProgressBar;
|
||
|
}
|
||
14 years ago
|
@@ -806,6 +1054,7 @@
|
||
16 years ago
|
connectionStatus.setBackground(java.awt.Color.lightGray);
|
||
|
connectionStatus.setFont(
|
||
|
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
|
||
16 years ago
|
+//System.out.println("getConnectionStatus");
|
||
16 years ago
|
}
|
||
|
connectionStatus.setEditable(false);
|
||
|
return connectionStatus;
|
||
14 years ago
|
@@ -815,7 +1064,12 @@
|
||
16 years ago
|
* Implements Action listener.
|
||
|
*/
|
||
|
public void actionPerformed(ActionEvent evt) {
|
||
|
- System.out.println(evt.getSource());
|
||
|
+// System.out.println(evt.getSource());
|
||
15 years ago
|
+
|
||
|
+ if (ignore_events) {
|
||
|
+ System.out.println("ignore_events: " + evt.getSource());
|
||
|
+ return;
|
||
|
+ }
|
||
16 years ago
|
|
||
|
if (evt.getSource() == closeButton)
|
||
|
{ // Close Button
|
||
14 years ago
|
@@ -829,15 +1083,27 @@
|
||
16 years ago
|
{
|
||
|
doReceive();
|
||
|
}
|
||
|
+// begin runge/x11vnc
|
||
|
+ else if (evt.getSource() == viewButton)
|
||
|
+ {
|
||
|
+ doView();
|
||
|
+ }
|
||
|
+// end runge/x11vnc
|
||
|
else if (evt.getSource() == localDrivesComboBox)
|
||
|
{
|
||
|
changeLocalDrive();
|
||
|
}
|
||
|
else if (evt.getSource() == remoteDrivesComboBox)
|
||
|
{
|
||
15 years ago
|
+//System.out.println("remoteDrivesComboBox"); // runge/x11vnc
|
||
16 years ago
|
changeRemoteDrive();
|
||
15 years ago
|
- remoteList.clear();
|
||
|
- remoteFileTable.setListData(remoteList);
|
||
|
+
|
||
|
+ // are these really needed? changeRemoteDrive() does them at the end.
|
||
|
+ if (false) {
|
||
|
+ remoteList.clear();
|
||
|
+ remoteListInfo.clear();
|
||
|
+ remoteFileTable.setListData(remoteList);
|
||
|
+ }
|
||
16 years ago
|
}
|
||
|
else if (evt.getSource() == localTopButton)
|
||
15 years ago
|
{
|
||
14 years ago
|
@@ -845,12 +1111,17 @@
|
||
16 years ago
|
}
|
||
|
else if (evt.getSource() == remoteTopButton)
|
||
|
{
|
||
15 years ago
|
+//System.out.println("remoteTopButton"); // runge/x11vnc
|
||
16 years ago
|
changeRemoteDrive();
|
||
|
}
|
||
|
else if(evt.getSource() == deleteButton)
|
||
15 years ago
|
{
|
||
|
doDelete();
|
||
|
}
|
||
|
+ else if(evt.getSource() == refreshButton)
|
||
|
+ {
|
||
|
+ doRefresh();
|
||
|
+ }
|
||
|
else if(evt.getSource()==newFolderButton)
|
||
|
{
|
||
|
doNewFolder();
|
||
14 years ago
|
@@ -864,7 +1135,7 @@
|
||
15 years ago
|
|
||
|
private void doNewFolder()
|
||
|
{
|
||
|
- String name = JOptionPane.showInputDialog(null,"Enter new directory name", "Create New Directory", JOptionPane.QUESTION_MESSAGE);
|
||
|
+ String name = JOptionPane.showInputDialog(jContentPane,"Enter new directory name", "Create New Directory", JOptionPane.QUESTION_MESSAGE);
|
||
|
if(selectedTable.equals("remote"))
|
||
|
{
|
||
|
name = remoteLocation.getText()+name;
|
||
14 years ago
|
@@ -880,34 +1151,106 @@
|
||
16 years ago
|
historyComboBox.setSelectedIndex(0);
|
||
|
}
|
||
|
}
|
||
|
- private void doClose()
|
||
|
+ public void doClose()
|
||
|
{
|
||
16 years ago
|
+ if (viewer.ftpOnly) {
|
||
|
+ viewer.disconnect();
|
||
|
+ return;
|
||
|
+ }
|
||
16 years ago
|
try {
|
||
|
this.setVisible(false);
|
||
|
- viewer.rfb.writeFramebufferUpdateRequest(
|
||
|
- 0,
|
||
|
- 0,
|
||
|
- viewer.rfb.framebufferWidth,
|
||
|
- viewer.rfb.framebufferHeight,
|
||
|
- true);
|
||
|
+ viewer.rfb.writeFramebufferUpdateRequest(0, 0, viewer.rfb.framebufferWidth,
|
||
|
+ viewer.rfb.framebufferHeight, true);
|
||
|
+
|
||
|
+ if (false) {
|
||
|
+ this.dispose();
|
||
|
+ jContentPane = null;
|
||
|
+ }
|
||
|
} catch (IOException e) {
|
||
|
// TODO Auto-generated catch block
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
}
|
||
15 years ago
|
+ private void unSwing() {
|
||
|
+ jContentPane = null;
|
||
|
+ topPanel = null;
|
||
|
+ topPanelLocal = null;
|
||
|
+ topPanelRemote = null;
|
||
|
+ topPanelCenter = null;
|
||
|
+ statusPanel = null;
|
||
|
+ remotePanel = null;
|
||
|
+ localPanel = null;
|
||
|
+ buttonPanel = null;
|
||
|
+ sendButton = null;
|
||
|
+ receiveButton = null;
|
||
|
+ deleteButton = null;
|
||
|
+ newFolderButton = null;
|
||
|
+ stopButton = null;
|
||
|
+ closeButton = null;
|
||
|
+ dummyButton = null;
|
||
|
+ localDrivesComboBox = null;
|
||
|
+ remoteDrivesComboBox = null;
|
||
|
+ localMachineLabel = null;
|
||
|
+ remoteMachineLabel = null;
|
||
|
+ localTopButton = null;
|
||
|
+ remoteTopButton = null;
|
||
|
+ localScrollPane = null;
|
||
|
+ localFileTable = null;
|
||
|
+ remoteScrollPane = null;
|
||
|
+ remoteFileTable = null;
|
||
|
+ remoteLocation = null;
|
||
|
+ localLocation = null;
|
||
|
+ localStatus = null;
|
||
|
+ remoteStatus = null;
|
||
|
+ historyComboBox = null;
|
||
|
+ jProgressBar = null;
|
||
|
+ connectionStatus = null;
|
||
|
+ viewButton = null;
|
||
|
+ refreshButton = null;
|
||
|
+ }
|
||
|
+
|
||
|
+ public void doReset()
|
||
|
+ {
|
||
|
+ try {
|
||
|
+ this.setVisible(false);
|
||
|
+ this.dispose();
|
||
|
+ jContentPane = null;
|
||
|
+ try {Thread.sleep(500);} catch (InterruptedException e) {}
|
||
|
+ viewer.ftp_init();
|
||
|
+ } catch (Exception e) {
|
||
|
+ // TODO Auto-generated catch block
|
||
|
+ e.printStackTrace();
|
||
|
+ }
|
||
|
+ }
|
||
16 years ago
|
|
||
|
+ public void doOpen()
|
||
|
+ {
|
||
|
+ try {
|
||
|
+ this.setVisible(true);
|
||
|
+ if (false) {
|
||
|
+ this.initialize();
|
||
|
+ }
|
||
|
+ } catch (Exception e) {
|
||
|
+ // TODO Auto-generated catch block
|
||
|
+ e.printStackTrace();
|
||
|
+ }
|
||
|
+ }
|
||
|
private void doDelete()
|
||
|
{
|
||
16 years ago
|
- 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"))
|
||
|
{
|
||
15 years ago
|
- String sFileName = ((String) this.remoteFileTable.getSelectedValue());
|
||
|
+ Object selected = this.remoteFileTable.getSelectedValue();
|
||
|
+ if (selected == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+ String sFileName = ((String) selected);
|
||
|
|
||
|
// sf@2004 - Directory can't be deleted
|
||
|
if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
|
||
|
{
|
||
|
- JOptionPane.showMessageDialog(null, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
+ JOptionPane.showMessageDialog(jContentPane, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
return;
|
||
|
}
|
||
|
|
||
14 years ago
|
@@ -916,7 +1259,7 @@
|
||
15 years ago
|
// sf@2004 - Delete prompt
|
||
|
if (remoteList.contains(sFileName))
|
||
|
{
|
||
|
- int r = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Remote Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
+ int r = JOptionPane.showConfirmDialog(jContentPane, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Remote Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
if (r == JOptionPane.NO_OPTION)
|
||
|
return;
|
||
|
}
|
||
14 years ago
|
@@ -926,18 +1269,22 @@
|
||
15 years ago
|
}
|
||
|
else
|
||
|
{
|
||
|
- String sFileName = ((String) this.localFileTable.getSelectedValue());
|
||
|
+ Object selected = this.localFileTable.getSelectedValue();
|
||
|
+ if (selected == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+ String sFileName = ((String) selected);
|
||
|
|
||
|
// sf@2004 - Directory can't be deleted
|
||
|
if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
|
||
|
{
|
||
|
- JOptionPane.showMessageDialog(null, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
+ JOptionPane.showMessageDialog(jContentPane, (String)"Directory Deletion is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
return;
|
||
|
}
|
||
|
// sf@2004 - Delete prompt
|
||
|
if (localList.contains(sFileName))
|
||
|
{
|
||
|
- int r = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Local Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
+ int r = JOptionPane.showConfirmDialog(jContentPane, "Are you sure you want to delete the file \n< " + sFileName + " >\n on Local Machine ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
if (r == JOptionPane.NO_OPTION)
|
||
|
return;
|
||
|
}
|
||
14 years ago
|
@@ -952,21 +1299,25 @@
|
||
16 years ago
|
|
||
|
private void doReceive()
|
||
|
{
|
||
|
- System.out.println("Received Button Pressed");
|
||
|
+// System.out.println("Received Button Pressed");
|
||
|
|
||
15 years ago
|
- String sFileName = ((String) this.remoteFileTable.getSelectedValue());
|
||
|
+ Object selected = this.remoteFileTable.getSelectedValue();
|
||
|
+ if (selected == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+ String sFileName = ((String) selected);
|
||
|
|
||
|
// sf@2004 - Directory can't be transfered
|
||
|
if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
|
||
|
{
|
||
|
- JOptionPane.showMessageDialog(null, (String)"Directory Transfer is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
+ JOptionPane.showMessageDialog(jContentPane, (String)"Directory Transfer is not yet available in this version...", "FileTransfer Info", JOptionPane.INFORMATION_MESSAGE);
|
||
|
return;
|
||
|
}
|
||
16 years ago
|
|
||
15 years ago
|
// sf@2004 - Overwrite prompt
|
||
|
if (localList.contains(sFileName))
|
||
|
{
|
||
|
- int r = JOptionPane.showConfirmDialog(null, "The file < " + sFileName + " >\n already exists on Local Machine\n Are you sure you want to overwrite it ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
+ int r = JOptionPane.showConfirmDialog(jContentPane, "The file < " + sFileName + " >\n already exists on Local Machine\n Are you sure you want to overwrite it ?", "File Transfer Warning", JOptionPane.YES_NO_OPTION);
|
||
|
if (r == JOptionPane.NO_OPTION)
|
||
|
return;
|
||
|
}
|
||
14 years ago
|
@@ -979,23 +1330,101 @@
|
||
16 years ago
|
viewer.rfb.requestRemoteFile(remoteFileName,localDestinationPath);
|
||
|
}
|
||
|
|
||
|
+// begin runge/x11vnc
|
||
15 years ago
|
+ private void doRefresh()
|
||
|
+ {
|
||
|
+ System.out.println("Refreshing Local and Remote.");
|
||
|
+ refreshLocalLocation();
|
||
|
+ refreshRemoteLocation();
|
||
|
+ }
|
||
|
+
|
||
16 years ago
|
+ private void doView()
|
||
|
+ {
|
||
16 years ago
|
+// System.out.println("View Button Pressed");
|
||
16 years ago
|
+
|
||
|
+ if (selectedTable == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+ if (selectedTable.equals("remote")) {
|
||
|
+ viewRemote();
|
||
|
+ } else if (selectedTable.equals("local")) {
|
||
|
+ viewLocal();
|
||
|
+ }
|
||
|
+ }
|
||
|
+
|
||
|
+ private File doReceiveTmp()
|
||
|
+ {
|
||
|
+
|
||
|
+ if (remoteFileTable == null) {
|
||
|
+ return null;
|
||
|
+ }
|
||
15 years ago
|
+ Object selected = this.remoteFileTable.getSelectedValue();
|
||
|
+ if (selected == null) {
|
||
|
+ return null;
|
||
|
+ }
|
||
|
+ String sFileName = ((String) selected);
|
||
|
+
|
||
16 years ago
|
+ if (sFileName == null) {
|
||
|
+ return null;
|
||
|
+ }
|
||
|
+
|
||
|
+ // sf@2004 - Directory can't be transfered
|
||
|
+ if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
|
||
|
+ {
|
||
|
+ return null;
|
||
|
+ }
|
||
|
+
|
||
|
+ File tmp = null;
|
||
|
+ try {
|
||
|
+ tmp = File.createTempFile("ULTRAFTP", ".txt");
|
||
|
+ } catch (Exception e) {
|
||
|
+ return null;
|
||
|
+ }
|
||
|
+
|
||
|
+ //updateHistory("Downloaded " + localSelection.toString());
|
||
|
+ String remoteFileName = this.remoteLocation.getText();
|
||
|
+ remoteFileName+= ((String) this.remoteFileTable.getSelectedValue()).substring(1);
|
||
15 years ago
|
+ System.out.println("remoteFileName: " + remoteFileName);
|
||
|
+if (false) {
|
||
|
+ char[] b = remoteFileName.toCharArray();
|
||
|
+ for (int n = 0; n < b.length; n++) {
|
||
|
+ System.out.print(Integer.toHexString(b[n]) + " ");
|
||
|
+ }
|
||
|
+ System.out.println("");
|
||
|
+ for (int n = 0; n < b.length; n++) {
|
||
|
+ System.out.print(b[n]);
|
||
|
+ }
|
||
|
+ System.out.println("");
|
||
|
+}
|
||
16 years ago
|
+
|
||
|
+ String localDestinationPath = tmp.getAbsolutePath();
|
||
|
+ viewer.rfb.requestRemoteFile(remoteFileName,localDestinationPath);
|
||
|
+ System.out.println("ReceiveTmp: " + localDestinationPath);
|
||
|
+ return tmp;
|
||
|
+ }
|
||
|
+// end runge/x11vnc
|
||
|
+
|
||
|
private void doSend()
|
||
|
{
|
||
16 years ago
|
- System.out.println("Send Button Pressed");
|
||
|
+// System.out.println("Send Button Pressed");
|
||
|
|
||
15 years ago
|
- String sFileName = ((String) this.localFileTable.getSelectedValue());
|
||
|
+ Object selected = this.localFileTable.getSelectedValue();
|
||
|
+ if (selected == null) {
|
||
|
+ return;
|
||
|
+ }
|
||
|
+ String sFileName = ((String) selected);
|
||
|
|
||
|
// sf@2004 - Directory can't be transfered
|
||
|
if (sFileName.substring(0, 2).equals(" [") && sFileName.substring((sFileName.length() - 1), sFileName.length()).equals("]"))
|
||
|
{
|
||
|
- JOptionPane.showMessageDialog(null, (String) |