"_httpdownload/"), 440, 250);
}
else if(e.getSource() == hp)
{
HttpBrowser h = new HttpBrowser("http://j-ftp.sourceforge.net");
JFtp.desktop.add(h, new Integer(Integer.MAX_VALUE - 10));
}
else if(e.getSource() == raw)
{
RawConnection c = new RawConnection();
}
else if(e.getSource() == readme)
{
show(Settings.readme);
}
else if(e.getSource() == changelog)
{
show(Settings.changelog);
}
else if(e.getSource() == todo)
{
show(Settings.todo);
}
else if(e.getSource() == shell)
{
UIUtils.runCommand("/bin/bash");
}
else if(e.getSource() == loadAudio)
{
try
{
JFileChooser f = new JFileChooser();
f.showOpenDialog(jftp);
File file = f.getSelectedFile();
Player p = new Player(new FileInputStream(file));
p.play();
}
catch(Exception ex)
{
ex.printStackTrace();
Log.debug("Error: (" + ex + ")");
}
}
else if(e.getSource() == exit)
{
jftp.windowClosing(null); // handles everything
}
else if(e.getSource() == close)
{
JFtp.statusP.jftp.closeCurrentTab();
/*
jftp.safeDisconnect();
FilesystemConnection con = new FilesystemConnection();
jftp.remoteDir.setCon(con);
con.addConnectionListener((ConnectionListener)jftp.remoteDir);
if(!con.chdir("/")) con.chdir("C:\\");
*/
}
else if((e.getSource() == ftpCon) && (!jftp.uiBlocked))
{
//jftp.safeDisconnect();
HostChooser hc = new HostChooser();
hc.toFront();
//hc.setModal(true);
hc.update();
}
else if((e.getSource() == smbCon) && (!jftp.uiBlocked))
{
//jftp.safeDisconnect();
SmbHostChooser hc = new SmbHostChooser();
hc.toFront();
//hc.setModal(true);
hc.update();
}
else if((e.getSource() == sftpCon) && (!jftp.uiBlocked))
{
//jftp.safeDisconnect();
SftpHostChooser hc = new SftpHostChooser();
hc.toFront();
//hc.setModal(true);
hc.update();
}
else if((e.getSource() == nfsCon) && (!jftp.uiBlocked))
{
// jftp.safeDisconnect();
NfsHostChooser hc = new NfsHostChooser();
hc.toFront();
//hc.setModal(true);
hc.update();
}
else if(e.getSource() == resuming)
{
boolean res = resuming.getState();
Settings.enableResuming = res;
Settings.setProperty("jftp.enableResuming", res);
ask.setEnabled(Settings.enableResuming);
Settings.save();
}
else if(e.getSource() == useTableLayout)
{
boolean res = useTableLayout.getState();
Settings.setProperty("jftp.useJTableLayout", res);
Settings.save();
JOptionPane.showMessageDialog(this, "Please restart JFtp to have the UI changed.");
}
else if(e.getSource() == useNewIcons)
{
boolean res = useNewIcons.getState();
Settings.setProperty("jftp.gui.look.newIcons", res);
Settings.save();
JOptionPane.showMessageDialog(this, "Please restart JFtp to have the UI changed.");
}
else if(e.getSource() == hideHidden)
{
boolean res = hideHidden.getState();
Settings.setProperty("jftp.hideHiddenDotNames", res);
Settings.save();
JFtp.localUpdate();
}
else if(e.getSource() == nl)
{
boolean res = nl.getState();
Settings.showNewlineOption = res;
}
else if(e.getSource() == stdback)
{
Settings.setProperty("jftp.useBackground", stdback.getState());
Settings.save();
JFtp.statusP.jftp.fireUpdate();
}
else if(e.getSource() == sshKeys)
{
Settings.setProperty("jftp.useSshKeyVerification",
sshKeys.getState());
Settings.save();
JFtp.statusP.jftp.fireUpdate();
}
else if(e.getSource() == rssDisabled)
{
Settings.setProperty("jftp.enableRSS", rssDisabled.getState());
Settings.save();
JFtp.statusP.jftp.fireUpdate();
}
else if(e.getSource() == loadRss)
{
String what = JOptionPane.showInputDialog("Enter URL", "http://");
if(what == null)
{
return;
}
Settings.setProperty("jftp.customRSSFeed", what);
Settings.save();
JFtp.statusP.jftp.feeder.switchTo(what);
}
else if(e.getSource() == loadSlash)
{
Settings.setProperty("jftp.customRSSFeed",
"http://slashdot.org/rss/slashdot.rss");
Settings.save();
JFtp.statusP.jftp.feeder.switchTo("http://slashdot.org/rss/slashdot.rss");
}
else if(e.getSource() == loadCNN1)
{
Settings.setProperty("jftp.customRSSFeed",
"http://rss.cnn.com/rss/cnn_topstories.rss");
Settings.save();
JFtp.statusP.jftp.feeder.switchTo("http://rss.cnn.com/rss/cnn_topstories.rss");
}
else if(e.getSource() == loadCNN2)
{
Settings.setProperty("jftp.customRSSFeed",
"http://rss.cnn.com/rss/cnn_world.rss");
Settings.save();
JFtp.statusP.jftp.feeder.switchTo("http://rss.cnn.com/rss/cnn_world.rss");
}
else if(e.getSource() == loadCNN3)
{
Settings.setProperty("jftp.customRSSFeed",
"http://rss.cnn.com/rss/cnn_tech.rss");
Settings.save();
JFtp.statusP.jftp.feeder.switchTo("http://rss.cnn.com/rss/cnn_tech.rss");
}
else if(e.getSource() == debug)
{
Settings.setProperty("jftp.enableDebug", debug.getState());
Settings.save();
}
else if(e.getSource() == disableLog)
{
Settings.setProperty("jftp.disableLog", disableLog.getState());
Settings.save();
}
else if(e.getSource() == smbThreads)
{
Settings.setProperty("jftp.enableSmbMultiThreading",
smbThreads.getState());
Settings.save();
}
else if(e.getSource() == sftpThreads)
{
Settings.setProperty("jftp.enableSftpMultiThreading",
sftpThreads.getState());
Settings.save();
}
else if(e.getSource() == ask)
{
Settings.askToResume = ask.getState();
}
else if(e.getSource() == http)
{
HttpDownloader dl = new HttpDownloader();
jftp.addToDesktop("Http download", dl, 480, 100);
jftp.setLocation(dl.hashCode(), 100, 150);
}
else if(e.getSource() == fadeMenu)
{
Settings.setProperty("jftp.gui.enableStatusAnimation",
fadeMenu.getState());
Settings.save();
}
else if(e.getSource() == askToDelete)
{
Settings.setProperty("jftp.gui.askToDelete", askToDelete.getState());
Settings.save();
}
//***MY ADDITIONS (***how can I make this flexible enough to
//*** easily add > 5 connections?)
else if((e.getSource() == lastConnections[0]) && (!jftp.uiBlocked))
{
connectionSelected(0);
}
else if((e.getSource() == lastConnections[1]) && (!jftp.uiBlocked))
{
connectionSelected(1);
}
else if((e.getSource() == lastConnections[2]) && (!jftp.uiBlocked))
{
connectionSelected(2);
}
else if((e.getSource() == lastConnections[3]) && (!jftp.uiBlocked))
{
connectionSelected(3);
}
else if((e.getSource() == lastConnections[4]) && (!jftp.uiBlocked))
{
connectionSelected(4);
}
else if((e.getSource() == lastConnections[5]) && (!jftp.uiBlocked))
{
connectionSelected(5);
}
else if((e.getSource() == lastConnections[6]) && (!jftp.uiBlocked))
{
connectionSelected(6);
}
else if((e.getSource() == lastConnections[7]) && (!jftp.uiBlocked))
{
connectionSelected(7);
}
else if((e.getSource() == lastConnections[8]) && (!jftp.uiBlocked))
{
connectionSelected(8);
}
else if(e.getSource() == opts)
{
AdvancedOptions adv = new AdvancedOptions();
jftp.addToDesktop("Advanced Options", adv, 500, 180);
jftp.setLocation(adv.hashCode(), 110, 180);
}
else if(e.getSource() == manage)
{
BookmarkManager m = new BookmarkManager();
JFtp.desktop.add(m, new Integer(Integer.MAX_VALUE - 10));
}
else if(marks.contains(e.getSource()))
{
((BookmarkItem) e.getSource()).connect();
}