changeset 23:cfcb8d9859a8 tn5250

adding tn5250 files
author Carl Byington <carl@five-ten-sg.com>
date Tue, 03 Jun 2014 11:37:06 -0700
parents e067ee54f638
children d1c549560aff
files res/values/strings.xml src/com/five_ten_sg/connectbot/TerminalView.java src/com/five_ten_sg/connectbot/transport/TN5250.java src/org/tn5250j/framework/tn5250/tnvt.java
diffstat 4 files changed, 16 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/res/values/strings.xml	Tue Jun 03 10:40:11 2014 -0700
+++ b/res/values/strings.xml	Tue Jun 03 11:37:06 2014 -0700
@@ -119,10 +119,11 @@
 	<!-- First field is encryption algorithm. Second is the actual fingerprint in hex digits -->
 	<string name="host_fingerprint">"Host %1$s key fingerprint is %2$s"</string>
 
-    <!-- tn5250 certificate strings -->
+    <!-- tn5250 strings -->
 	<string name="host_certificate">"The certificate is %1$s"</string>
 	<string name="prompt_accept_certificate">"Unknown Certificate - Do you accept it?"</string>
 	<string name="prompt_save_certificate">"Do you want to save this certificate?"</string>
+	<string name="prompt_sys_request">"Enter sys-request string"</string>
 
 	<string name="alert_passwords_do_not_match_msg">"Passwords do not match!"</string>
 	<string name="alert_wrong_password_msg">"Wrong password!"</string>
--- a/src/com/five_ten_sg/connectbot/TerminalView.java	Tue Jun 03 10:40:11 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/TerminalView.java	Tue Jun 03 11:37:06 2014 -0700
@@ -85,6 +85,8 @@
     private Matcher mCodeMatcher = null;
     private AccessibilityEventSender mEventSender = null;
 
+    public  static String android_home_directory = "";
+
     private static final String BACKSPACE_CODE = "\\x08\\x1b\\[K";
     private static final String CONTROL_CODE_PATTERN = "\\x1b\\[K[^m]+[m|:]";
 
@@ -96,6 +98,7 @@
 
     public TerminalView(Context context, TerminalBridge bridge) {
         super(context);
+        android_home_directory = context.getApplicationInfo().dataDir;
         this.context = context;
         this.bridge = bridge;
         paint = new Paint();
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Tue Jun 03 10:40:11 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Tue Jun 03 11:37:06 2014 -0700
@@ -130,18 +130,12 @@
     */
    @Override
    public void connect() {
-       try {
-            connected = handler.connect(host.getHostname(), host.getPort());
+        connected = handler.connect(host.getHostname(), host.getPort());
+        if (connected) {
             is = handler.bin;
             os = handler.bout;
             bridge.onConnected();
         }
-        catch (UnknownHostException e) {
-            Log.d(TAG, "IO Exception connecting to host", e);
-        }
-        catch (IOException e) {
-            Log.d(TAG, "IO Exception connecting to host", e);
-        }
     }
 
 
--- a/src/org/tn5250j/framework/tn5250/tnvt.java	Tue Jun 03 10:40:11 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/tnvt.java	Tue Jun 03 11:37:06 2014 -0700
@@ -648,7 +648,8 @@
 	 * @see {@link #systemRequest(String)}
 	 */
 	public final void systemRequest() {
-		final String sysreq = this.controller.showSystemRequest();
+        String ask = manager.res.getString(R.string.prompt_sys_request);
+		String sysreq = bridge.promptHelper.requestStringPrompt(null, ask);
 		systemRequest(sysreq);
 	}
 
@@ -998,9 +999,8 @@
 
 				String remainder = new String(screen, i + 1, screen.length
 						- (i + 1));
-				//        System.out.println("Sensing action command in the input! = "
-				// + command);
-				controller.fireScanned(command, remainder);
+				//controller.fireScanned(command, remainder);
+                log.info("trying to run " + command + " " + remainder);
 				break;
 			}
 		}
@@ -1008,8 +1008,7 @@
 
 	public void run() {
 
-		if (enhanced)
-			sfParser = new WTDSFParser(this);
+		if (enhanced) sfParser = new WTDSFParser(this);
 
 		bk = new Stream5250();
 
@@ -1051,20 +1050,15 @@
 			case 2:
 				log.debug("Output Only");
 				parseIncoming();
-				//               System.out.println(screen52.dirty);
 				screen52.updateDirty();
-
-				//            invited = true;
-
 				break;
 			case 3:
 				log.debug("Put/Get Operation");
 				parseIncoming();
-				//               inviteIt =true;
 				setInvited();
 				if (!firstScreen) {
 					firstScreen = true;
-					controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED);
+					//controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED);
 				}
 				break;
 			case 4:
@@ -1523,7 +1517,7 @@
 				case ESC: // ESCAPE
 					break;
 				case 7: // audible bell
-					controller.signalBell();
+					manager.playBeep();
 					bk.getNextByte();
 					bk.getNextByte();
 					break;
@@ -2165,7 +2159,7 @@
 		log.debug(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff));
 
 		if ((byte1 & 0x04) == 0x04) {
-			controller.signalBell();
+			manager.playBeep();
 		}
 		if ((byte1 & 0x02) == 0x02) {
 			screen52.getOIA().setMessageLightOff();
@@ -2703,11 +2697,8 @@
 		return codePage;
 	}
 
-	/**
-	 * @see org.tn5250j.Session5250#signalBell()
-	 */
 	public void signalBell() {
-		controller.signalBell();
+		manager.playBeep();
 	}
 
 }