diff -Naur src/tk/wetnet/j2me/vnc/VNC.java src.ssh2/tk/wetnet/j2me/vnc/VNC.java --- src/tk/wetnet/j2me/vnc/VNC.java Wed Feb 9 04:09:34 2005 +++ src.ssh2/tk/wetnet/j2me/vnc/VNC.java Thu Feb 10 07:53:27 2005 @@ -101,6 +101,11 @@ private TextField url = new TextField( "#host#", "", 25, TextField.ANY ); private TextField password = new TextField( "#password#", "", 14, TextField.PASSWORD ); + + private TextField ssh2server = new TextField( "#ssh2server#", "", 25, TextField.ANY); + private TextField usr = new TextField( "#ssh2usr#", "", 8, TextField.ANY ); + private TextField ssh2password = new TextField( "#ssh2password#", "", 8, TextField.PASSWORD); + private Command connect = new Command( "#connect#", Command.OK, 0 ); private Command add = new Command( "#add#", Command.ITEM, 9 ); @@ -108,8 +113,7 @@ private Command delete = new Command( "#delete#", Command.OK, 0 ); private Command back = new Command( "#back#", Command.BACK, 1 ); - private Command exit = new Command( "#exit#", Command.EXIT, 1 ); - + private Command setProxy = new Command( "#setproxy#", Command.ITEM, 2 ); private ChoiceGroup hosts = null; @@ -218,6 +222,24 @@ httpProxy.getString() ) ); ((tk.wetnet.j2me.httpsocket.HTTPSocket)con).ready(); + + } + else if( shared.isSelected( 3 ) ) { + //#ifdef DEBUG + log( "Use SSH2"); + //#endif + String sshd=ssh2server.getString(); + String vncserver="127.0.0.1"; + if(sshd.length()>0 && + !host.equals(sshd)){ + vncserver=host; + host=sshd; + } + con=new SSH2StreamConnection(host, + usr.getString(), + ssh2password.getString(), + vncserver, + port); } else { con = (StreamConnection)Connector. open( "socket://" + host + ":" + port, @@ -493,6 +515,9 @@ connectionForm.append( url ); connectionForm.append( password ); connectionForm.append( shared ); + connectionForm.append( usr ); + connectionForm.append( ssh2server ); + connectionForm.append( ssh2password ); connectionForm.addCommand( connect ); connectionForm.addCommand( add ); connectionForm.addCommand( manage ); @@ -509,6 +534,7 @@ shared.append( "#shareddesktop#", null ); shared.append( "#ncm#", null ); shared.append( "#usehttp#", null ); + shared.append( "#ssh2#", null ); try { rs = RecordStore.openRecordStore( "hosts", true );