changeset 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 9c0aaf27ce28
children dcac61b6f2e6
files src/com/five_ten_sg/connectbot/bean/HostBean.java src/org/tn5250j/framework/tn5250/tnvt.java
diffstat 2 files changed, 61 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/bean/HostBean.java	Wed Jun 18 16:53:58 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/bean/HostBean.java	Wed Jun 18 18:55:56 2014 -0700
@@ -56,6 +56,10 @@
     private String  monitor = null;
     private String  hostemulation = null;
     private String  encryption5250 = null;
+    private String  password = null;
+    private String  library = null;
+    private String  initialMenu = null;
+    private String  program = null;
 
     public HostBean() {
     }
@@ -286,6 +290,46 @@
         this.encryption5250 = encryption5250;
     }
 
+    public String getPassword() {
+        return this.password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getLibrary() {
+        return this.library;
+    }
+
+    public void setLibrary(String library) {
+        this.library = library;
+    }
+
+    public String getInitialMenu() {
+        return this.initialMenu;
+    }
+
+    public void setInitialMenu(String initialMenu) {
+        this.initialMenu = initialMenu;
+    }
+
+    public String getProgram() {
+        return this.program;
+    }
+
+    public void setProgram(String program) {
+        this.program = program;
+    }
+
+    public String getxxx() {
+        return this.xxx;
+    }
+
+    public void setxxx(String xxx) {
+        this.xxx = xxx;
+    }
+
     @Override
     public ContentValues getValues() {
         ContentValues values = new ContentValues();
--- a/src/org/tn5250j/framework/tn5250/tnvt.java	Wed Jun 18 16:53:58 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/tnvt.java	Wed Jun 18 18:55:56 2014 -0700
@@ -85,6 +85,7 @@
 import android.util.Log;
 
 import com.five_ten_sg.connectbot.R;
+import com.five_ten_sg.connectbot.bean.HostBean;
 import com.five_ten_sg.connectbot.service.TerminalBridge;
 import com.five_ten_sg.connectbot.service.TerminalManager;
 import de.mud.terminal.vt320;
@@ -154,6 +155,7 @@
     private static int STRSCAN = 1;
     // WVL - LDC : 05/08/2005 : TFX.006253 - support STRPCCMD
     private boolean strpccmd; // = false;
+    private String encryption;
     private String user;
     private String password;
     private String library;
@@ -186,27 +188,6 @@
         this.manager    = manager;
         setCodePage("37");
         dataIncluded = new boolean[24];
-
-        if (System.getProperties().containsKey("SESSION_CONNECT_USER")) {
-            user = System.getProperties().getProperty("SESSION_CONNECT_USER");
-
-            if (System.getProperties().containsKey("SESSION_CONNECT_PASSWORD"))
-                password = System.getProperties().getProperty(
-                               "SESSION_CONNECT_PASSWORD");
-
-            if (System.getProperties().containsKey("SESSION_CONNECT_LIBRARY"))
-                library = System.getProperties().getProperty(
-                              "SESSION_CONNECT_LIBRARY");
-
-            if (System.getProperties().containsKey("SESSION_CONNECT_MENU"))
-                initialMenu = System.getProperties().getProperty(
-                                  "SESSION_CONNECT_MENU");
-
-            if (System.getProperties().containsKey("SESSION_CONNECT_PROGRAM"))
-                program = System.getProperties().getProperty(
-                              "SESSION_CONNECT_PROGRAM");
-        }
-
         baosp = new ByteArrayOutputStream();
         baosrsp = new ByteArrayOutputStream();
     }
@@ -260,11 +241,22 @@
         Log.i(TAG, " socks set ");
     }
 
-    public final boolean connect(String hostname, int port, String encryption, String homeDirectory, vt320 buffer) {
+    private String fixer(String value, String default) {
+        if ((value == null) || (value.length() == 0)) return default;
+        return value;
+    }
+
+    public final boolean connect(HostBean host, String homeDirectory, vt320 buffer) {
         try {
-            this.hostname = hostname;
-            this.port     = port;
-            this.buffer   = buffer;
+            this.hostname    = host.getHostname();
+            this.port        = host.getPort();
+            this.buffer      = buffer;
+            this.encryption  = fixer(host.getEncryption5250(), "NONE");
+            this.user        = host.getUsername();
+            this.password    = host.getPassword();
+            this.library     = host.getLibrary();
+            this.initialMenu = host.getInitialMenu();
+            this.program     = host.getProgram();
 
             try {
                 screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,