comparison src/org/tn5250j/framework/tn5250/tnvt.java @ 119:6969d6cebcd7

add more 5250 config items
author Carl Byington <carl@five-ten-sg.com>
date Wed, 18 Jun 2014 18:55:56 -0700
parents 77ac18bc1b2f
children dcac61b6f2e6
comparison
equal deleted inserted replaced
118:9c0aaf27ce28 119:6969d6cebcd7
83 import android.content.Intent; 83 import android.content.Intent;
84 import android.net.Uri; 84 import android.net.Uri;
85 import android.util.Log; 85 import android.util.Log;
86 86
87 import com.five_ten_sg.connectbot.R; 87 import com.five_ten_sg.connectbot.R;
88 import com.five_ten_sg.connectbot.bean.HostBean;
88 import com.five_ten_sg.connectbot.service.TerminalBridge; 89 import com.five_ten_sg.connectbot.service.TerminalBridge;
89 import com.five_ten_sg.connectbot.service.TerminalManager; 90 import com.five_ten_sg.connectbot.service.TerminalManager;
90 import de.mud.terminal.vt320; 91 import de.mud.terminal.vt320;
91 92
92 import org.tn5250j.TN5250jConstants; 93 import org.tn5250j.TN5250jConstants;
152 // WVL - LDC : TR.000300 : Callback scenario from 5250 153 // WVL - LDC : TR.000300 : Callback scenario from 5250
153 private boolean scan; // = false; 154 private boolean scan; // = false;
154 private static int STRSCAN = 1; 155 private static int STRSCAN = 1;
155 // WVL - LDC : 05/08/2005 : TFX.006253 - support STRPCCMD 156 // WVL - LDC : 05/08/2005 : TFX.006253 - support STRPCCMD
156 private boolean strpccmd; // = false; 157 private boolean strpccmd; // = false;
158 private String encryption;
157 private String user; 159 private String user;
158 private String password; 160 private String password;
159 private String library; 161 private String library;
160 private String initialMenu; 162 private String initialMenu;
161 private String program; 163 private String program;
184 this.enhanced = enhanced; 186 this.enhanced = enhanced;
185 this.bridge = bridge; 187 this.bridge = bridge;
186 this.manager = manager; 188 this.manager = manager;
187 setCodePage("37"); 189 setCodePage("37");
188 dataIncluded = new boolean[24]; 190 dataIncluded = new boolean[24];
189
190 if (System.getProperties().containsKey("SESSION_CONNECT_USER")) {
191 user = System.getProperties().getProperty("SESSION_CONNECT_USER");
192
193 if (System.getProperties().containsKey("SESSION_CONNECT_PASSWORD"))
194 password = System.getProperties().getProperty(
195 "SESSION_CONNECT_PASSWORD");
196
197 if (System.getProperties().containsKey("SESSION_CONNECT_LIBRARY"))
198 library = System.getProperties().getProperty(
199 "SESSION_CONNECT_LIBRARY");
200
201 if (System.getProperties().containsKey("SESSION_CONNECT_MENU"))
202 initialMenu = System.getProperties().getProperty(
203 "SESSION_CONNECT_MENU");
204
205 if (System.getProperties().containsKey("SESSION_CONNECT_PROGRAM"))
206 program = System.getProperties().getProperty(
207 "SESSION_CONNECT_PROGRAM");
208 }
209
210 baosp = new ByteArrayOutputStream(); 191 baosp = new ByteArrayOutputStream();
211 baosrsp = new ByteArrayOutputStream(); 192 baosrsp = new ByteArrayOutputStream();
212 } 193 }
213 194
214 public void showURL(String url) { 195 public void showURL(String url) {
258 systemProperties.put("socksProxyPort", proxyPort); 239 systemProperties.put("socksProxyPort", proxyPort);
259 System.setProperties(systemProperties); 240 System.setProperties(systemProperties);
260 Log.i(TAG, " socks set "); 241 Log.i(TAG, " socks set ");
261 } 242 }
262 243
263 public final boolean connect(String hostname, int port, String encryption, String homeDirectory, vt320 buffer) { 244 private String fixer(String value, String default) {
245 if ((value == null) || (value.length() == 0)) return default;
246 return value;
247 }
248
249 public final boolean connect(HostBean host, String homeDirectory, vt320 buffer) {
264 try { 250 try {
265 this.hostname = hostname; 251 this.hostname = host.getHostname();
266 this.port = port; 252 this.port = host.getPort();
267 this.buffer = buffer; 253 this.buffer = buffer;
254 this.encryption = fixer(host.getEncryption5250(), "NONE");
255 this.user = host.getUsername();
256 this.password = host.getPassword();
257 this.library = host.getLibrary();
258 this.initialMenu = host.getInitialMenu();
259 this.program = host.getProgram();
268 260
269 try { 261 try {
270 screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, 262 screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,
271 ScreenOIA.OIA_LEVEL_INPUT_INHIBITED, "X - Connecting"); 263 ScreenOIA.OIA_LEVEL_INPUT_INHIBITED, "X - Connecting");
272 } 264 }