changeset 47:a3fd10a8c0de tn5250

start tn5250 integration
author Carl Byington <carl@five-ten-sg.com>
date Wed, 11 Jun 2014 10:03:40 -0700
parents 34ce32c4e807
children 1e931ef5f776
files src/com/five_ten_sg/connectbot/service/TerminalBridge.java src/com/five_ten_sg/connectbot/transport/AbsTransport.java src/com/five_ten_sg/connectbot/transport/TN5250.java
diffstat 3 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Wed Jun 11 09:55:40 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Wed Jun 11 10:03:40 2014 -0700
@@ -100,7 +100,7 @@
     public Bitmap bitmap = null;
     public vt320  buffer = null;
 
-    private TerminalView parent = null;
+    public  TerminalView parent = null;
     private final Canvas canvas = new Canvas();
 
     private boolean disconnected = false;
@@ -453,8 +453,7 @@
         charHeight = (int)FloatMath.ceil(fm.descent - fm.top);
 
         // refresh any bitmap with new font size
-        if (parent != null)
-            parentChanged(parent);
+        if (parent != null) parentChanged(parent);
 
         for (FontSizeChangedListener ofscl : fontSizeChangedListeners)
             ofscl.onFontSizeChanged(size);
@@ -1388,10 +1387,7 @@
                         dismiss();
                         return true;
                     }
-
-//                  return keyListener.onKey(parent, event.getKeyCode(), event);
                 }
-
                 return super.dispatchKeyEvent(event);
             }
         };
--- a/src/com/five_ten_sg/connectbot/transport/AbsTransport.java	Wed Jun 11 09:55:40 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/AbsTransport.java	Wed Jun 11 10:03:40 2014 -0700
@@ -86,7 +86,7 @@
         // play beep noise
         @Override
         public void beep() {
-            if (bridge.parent.isShown())
+            if ((bridge.parent != null) && (bridge.parent.isShown()))
                 manager.playBeep();
             else
                 manager.sendActivityNotification(host);
@@ -237,14 +237,18 @@
         return emulation;
     }
 
-    public vt320 getTransportBuffer() {
-        if (buffer == null) buffer = new vt320Default();
+    protected vt320 setupTransportBuffer() {
         int scrollback = (host.getWantSession()) ?  manager.getScrollback() : 0;
         buffer.setBufferSize(scrollback);
         buffer.setDisplay(bridge);
         return buffer;
     }
 
+    public vt320 getTransportBuffer() {
+        buffer = new vt320Default();
+        return setupTransportBuffer();
+    }
+
     public void setLinks(TerminalManager manager, TerminalBridge bridge, HostBean host, String emulation) {
         this.manager   = manager;
         this.bridge    = bridge;
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Wed Jun 11 09:55:40 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Wed Jun 11 10:03:40 2014 -0700
@@ -252,7 +252,7 @@
     @Override
     public vt320 getTransportBuffer() {
         buffer = new vt320x5250();
-        return super();
+        return setupTransportBuffer();
     }