diff src/com/five_ten_sg/connectbot/util/HostDatabase.java @ 61:ce8f13242339 tn5250

add 5250 config entries
author Carl Byington <carl@five-ten-sg.com>
date Fri, 13 Jun 2014 15:27:08 -0700
parents 0ce5cc452d02
children aac8e0496ef9
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/util/HostDatabase.java	Wed Jun 11 15:44:59 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/util/HostDatabase.java	Fri Jun 13 15:27:08 2014 -0700
@@ -73,6 +73,8 @@
     public final static String FIELD_HOST_X11HOST = "x11host";
     public final static String FIELD_HOST_X11PORT = "x11port";
     public final static String FIELD_HOST_MONITOR = "monitor";
+    public final static String FIELD_HOST_EMULATION = "emulation";
+    public final static String FIELD_HOST_ENCRYPTION5250 = "encryption5250";
 
     public final static String TABLE_PORTFORWARDS = "portforwards";
     public final static String FIELD_PORTFORWARD_HOSTID = "hostid";
@@ -179,7 +181,9 @@
                    + FIELD_HOST_WANTX11FORWARD + " TEXT DEFAULT '" + Boolean.toString(false) + "', "
                    + FIELD_HOST_X11HOST + " TEXT DEFAULT '" + X11HOST_DEFAULT + "', "
                    + FIELD_HOST_X11PORT + " INTEGER DEFAULT " + X11PORT_DEFAULT + ", "
-                   + FIELD_HOST_MONITOR + " TEXT)");
+                   + FIELD_HOST_MONITOR + " TEXT, "
+                   + FIELD_HOST_EMULATION + " TEXT, "
+                   + FIELD_HOST_ENCRYPTION5250 + " TEXT)");
         db.execSQL("CREATE TABLE " + TABLE_PORTFORWARDS
                    + " (_id INTEGER PRIMARY KEY, "
                    + FIELD_PORTFORWARD_HOSTID + " INTEGER, "
@@ -290,6 +294,12 @@
             case 24:
                 db.execSQL("ALTER TABLE " + TABLE_HOSTS
                            + " ADD COLUMN " + FIELD_HOST_MONITOR + " TEXT");
+
+            case 25:
+                db.execSQL("ALTER TABLE " + TABLE_HOSTS
+                           + " ADD COLUMN " + FIELD_HOST_EMULATION + " TEXT");
+                db.execSQL("ALTER TABLE " + TABLE_HOSTS
+                           + " ADD COLUMN " + FIELD_HOST_ENCRYPTION5250 + " TEXT");
         }
     }
 
@@ -403,7 +413,9 @@
                   COL_WANTX11FORWARD = c.getColumnIndexOrThrow(FIELD_HOST_WANTX11FORWARD),
                   COL_X11HOST = c.getColumnIndexOrThrow(FIELD_HOST_X11HOST),
                   COL_X11PORT = c.getColumnIndexOrThrow(FIELD_HOST_X11PORT),
-                  COL_MONITOR = c.getColumnIndexOrThrow(FIELD_HOST_MONITOR);
+                  COL_MONITOR = c.getColumnIndexOrThrow(FIELD_HOST_MONITOR),
+                  COL_EMULATION = c.getColumnIndexOrThrow(FIELD_HOST_EMULATION),
+                  COL_ENCRYPTION5250 = c.getColumnIndexOrThrow(FIELD_HOST_ENCRYPTION5250);
 
         while (c.moveToNext()) {
             HostBean host = new HostBean();
@@ -430,6 +442,8 @@
             host.setX11Host(c.getString(COL_X11HOST));
             host.setX11Port(c.getInt(COL_X11PORT));
             host.setMonitor(c.getString(COL_MONITOR));
+            host.setEmulation(c.getString(COL_EMULATION));
+            host.setEncryption5250(c.getString(COL_ENCRYPTION5250));
             hosts.add(host);
         }