changeset 470:2cc170e3fc9b stable-1.9.3-8

audible bell checkbox enables/disables bell volume setting; monitor init string is now a url socket://target/initstring
author Carl Byington <carl@five-ten-sg.com>
date Fri, 04 Oct 2019 16:44:44 -0700
parents fbb1a98998fb
children 4f686f5a8b0f
files app/src/main/AndroidManifest.xml app/src/main/java/com/five_ten_sg/connectbot/service/TerminalManager.java app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java xml/510connectbot.in
diffstat 4 files changed, 53 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/app/src/main/AndroidManifest.xml	Thu Sep 12 16:08:16 2019 -0700
+++ b/app/src/main/AndroidManifest.xml	Fri Oct 04 16:44:44 2019 -0700
@@ -17,8 +17,8 @@
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	package="com.five_ten_sg.connectbot"
-	android:versionName="1.9.3-7"
-	android:versionCode="1937"
+	android:versionName="1.9.3-8"
+	android:versionCode="1938"
 	android:installLocation="auto">
 
     <!--  permissions must match HostListActivity.java -->
--- a/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalManager.java	Thu Sep 12 16:08:16 2019 -0700
+++ b/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalManager.java	Fri Oct 04 16:44:44 2019 -0700
@@ -106,6 +106,7 @@
     private volatile boolean wantKeyVibration;
     public static final long VIBRATE_DURATION = 30;
 
+    private boolean wantBell;
     private boolean wantBellVibration;
 
     private boolean resizeAllowed = true;
@@ -146,8 +147,9 @@
 
         vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
         wantKeyVibration = prefs.getBoolean(PreferenceConstants.BUMPY_ARROWS, true);
+        wantBell          = prefs.getBoolean(PreferenceConstants.BELL, true);
         wantBellVibration = prefs.getBoolean(PreferenceConstants.BELL_VIBRATE, true);
-        enableMediaPlayer();
+        if (wantBell) enableMediaPlayer();
         hardKeyboardHidden = (res.getConfiguration().hardKeyboardHidden ==
                               Configuration.HARDKEYBOARDHIDDEN_YES);
         final boolean lockingWifi = prefs.getBoolean(PreferenceConstants.WIFI_LOCK, true);
@@ -602,12 +604,11 @@
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
                                           String key) {
         if (PreferenceConstants.BELL.equals(key)) {
-            boolean wantAudible = sharedPreferences.getBoolean(
-                                      PreferenceConstants.BELL, true);
+            wantBell = sharedPreferences.getBoolean(PreferenceConstants.BELL, true);
 
-            if (wantAudible && mediaPlayer == null)
+            if (wantBell && mediaPlayer == null)
                 enableMediaPlayer();
-            else if (!wantAudible && mediaPlayer != null)
+            else if (!wantBell && mediaPlayer != null)
                 disableMediaPlayer();
         }
         else if (PreferenceConstants.BELL_VOLUME.equals(key)) {
--- a/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Thu Sep 12 16:08:16 2019 -0700
+++ b/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Fri Oct 04 16:44:44 2019 -0700
@@ -64,12 +64,13 @@
     public  static final char CURSOR_USER_KEY       = 2;
 
     private static final int    MONITORPORT       = 6000;
-    private static final String LOCALHOST         = "127.0.0.1";
 
     private Context             parent       = null;
     private vt320               buffer       = null;
     private View                view         = null;
     private HostBean            host         = null;
+    private Uri                 uri          = null;
+    private String              target       = null;
     private String              init         = null;
     private int                 start_line   = 0;       // monitor part of the screen for changes
     private int                 end_line     = 500;     // ""
@@ -190,7 +191,7 @@
             Log.i(TAG, "bound to service");
 
             try {
-                InetAddress serverAddr = InetAddress.getByName(LOCALHOST);
+                InetAddress serverAddr = InetAddress.getByName(target);
                 int tries = 0;
                 while (tries < 10) {
                     try {
@@ -234,12 +235,14 @@
     };
 
 
-    public TerminalMonitor(Context parent, vt320 buffer, View view, HostBean host, String init) {
+    public TerminalMonitor(Context parent, vt320 buffer, View view, HostBean host, String url) {
         this.parent      = parent;
         this.buffer      = buffer;
         this.view        = view;
         this.host        = host;
-        this.init        = init;
+        this.uri         = Uri.parse(url);
+        this.target      = uri.getHost();
+        this.init        = uri.getPath();
         // setup the windows->android keymapping
         // http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731
         keymap      = new HashMap<Integer, Integer>();
--- a/xml/510connectbot.in	Thu Sep 12 16:08:16 2019 -0700
+++ b/xml/510connectbot.in	Fri Oct 04 16:44:44 2019 -0700
@@ -29,7 +29,7 @@
 
     <refentry id="x@PACKAGE@.1">
         <refentryinfo>
-            <date>2019-05-13</date>
+            <date>2019-10-04</date>
             <author>
                 <firstname>Carl</firstname>
                 <surname>Byington</surname>
@@ -104,7 +104,7 @@
                 </para></listitem>
 
                 <listitem><para>
-                    A deployment.connections text file is read (and deleted) on
+                    A deployment.connections text file is read (and optionally deleted) on
                     startup. This may be used to preconfigure the global options
                     and to create an initial set of host connections. This is only
                     useful for bulk deployments.
@@ -179,9 +179,12 @@
             </para>
 
             <para>
-                Any arguments that are keystrokes or characters are represented
-                as 16 bit unicode. Note that the first 256 such characters are
-                identical to the ISO-8859-1 latin character set.
+                Any arguments that are characters are represented as 16 bit
+                unicode. Note that the first 256 such characters are identical to the
+                ISO-8859-1 latin character set. There is no provision for handling
+                surrogate pairs as in UTF-16. Keystroke arguments (see DEPRESS) are
+                represented as Microsoft Virtual-Key codes, defined at
+                <ulink url="https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes">here</ulink>.
             </para>
 
             <para>
@@ -227,6 +230,22 @@
             </para>
 
             <para>
+                Every SCREENCHANGE message from the TE will be followed by a
+                CURSORMOVE message.
+            </para>
+
+            <para>
+                When the TE sends the screen contents as a result of a previous screen
+                watch, the screen watch area is then reset to the entire screen. The
+                voice application is then responsible for sending a screenwatch
+                command to set the watch area to something appropriate for that new
+                screen. Once the application has set the watch area to some part of a
+                single line, there is no mechanism for the application to reset it to
+                back to the entire screen. That reset only happens when the TE sends
+                the screen contents.
+            </para>
+
+            <para>
                 FIELDVALUE = 5 (TE -> Monitor).
                 SETFIELD = 5 (Monitor -> TE).
                 The first argument is the line number (0..23)
@@ -237,6 +256,10 @@
                 When sent from the monitor to the emulator, this causes
                 the emulator to send the field codes to the host (for async
                 modes) or to set the specified field contents (for block modes).
+                If the field length is zero, the TE should move the cursor to the specified line/column.
+            </para>
+
+            <para>
                 This is also used as the reply message from the emulator to the
                 monitor for a previous GETFIELD from the monitor.
             </para>
@@ -263,10 +286,15 @@
             </para>
 
             <para>
+                Subsequent screenwatch requests replace the current one, so the TE
+                has only one watch area at any time.
+            </para>
+
+            <para>
                 DEPRESS = 8 (Monitor -> TE). The argument is a single uint16
                 value containing the vk_key value. This command causes the emulator
                 to simulate a keypress for that key. The codes are defined
-                <ulink url="http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731">here</ulink>.
+                <ulink url="https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes">here</ulink>.
             </para>
 
             <para>
@@ -291,7 +319,8 @@
                 SAYSTRING = 12 (TE -> Monitor). The first argument is nonzero if
                 any current speech should be flushed. The second argument is nonzero
                 if this speech should be synchronous. That is followed by uint16
-                character codes to be spoken.
+                character codes to be spoken. Note that the language is specified
+                by the monitor, not the TE.
             </para>
         </refsect1>
 
@@ -331,7 +360,7 @@
 
     <refentry id="x@PACKAGE@.5">
         <refentryinfo>
-            <date>2019-05-13</date>
+            <date>2019-10-04</date>
             <author>
                 <firstname>Carl</firstname>
                 <surname>Byington</surname>
@@ -407,6 +436,7 @@
     fixed_size=true
     fixed_width=80
     fixed_height=25
+    monitor=socket://localhost/pub400
 
 
 #