changeset 512:e1dd1fd46e18

change connections file name and look for it in the accuspeech voice projects directory, then the downloads directory
author Carl Byington <carl@five-ten-sg.com>
date Fri, 10 Feb 2023 14:32:41 -0700
parents 6dbddfa27f6c
children 13a922d1fc5c
files 510Connectbot.connections app/src/main/java/com/five_ten_sg/connectbot/HostListActivity.java deployment.connections
diffstat 3 files changed, 116 insertions(+), 108 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/510Connectbot.connections	Fri Feb 10 14:32:41 2023 -0700
@@ -0,0 +1,101 @@
+#
+# available host keys:
+#
+# nickname          (string)
+# color             (string)    ("red", "green", "blue", "gray")
+# fontsize          (float)
+# fixed_size        (boolean)
+# fixed_width       (integer)
+# fixed_height      (integer)
+# pubkeyid          (integer)   (-2, -1)    -2=none, -1=any
+# useauthagent      (string)    ("no", "confirm", "yes")
+# postlogin         (string)
+# compression       (boolean)
+# httpproxy         (string)
+# wantsession       (boolean)
+# stayconnected     (boolean)
+# delkey            (string)    ("del", "backspace")
+# encoding          (string)    ("UTF-8", etc)
+# username          (string)
+# hostname          (string)
+# port              (integer)
+# monitor           (string)
+# emulation         (string)    ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen", or other answerback string)
+# encryption5250    (string)    ("NONE", "TLSv1.2", "TLSv1.3")
+# library5250       (string)
+# menu5250          (string)
+# program5250       (string)
+# wantx11forward    (boolean)
+# x11host           (string)
+# x11port           (integer)
+# autolaunch        (boolean)
+
+
+#
+# global settings are under global:// tag
+#
+# available global keys:
+#
+#   memkeys                     (boolean)
+#   connPersist                 (boolean)
+#   emulation                   (string) ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen")
+#   scrollback                  (integer)
+#   rotation                    (string) ("Default", "Force landscape", "Force portrait", "Automatic")
+#   shiftfkeys                  (boolean)
+#   ctrlfkeys                   (boolean)
+#   keymode                     (string) ("Use right-side keys", "Use left-side keys", "none")
+#   camera                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
+#   volup                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
+#   voldn                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
+#   search                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
+#   ptt                         (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
+#   keepalive                   (boolean)
+#   wifilock                    (boolean)
+#   bumpyarrows                 (boolean)
+#   eula                        (boolean)
+#   extended_longpress          (boolean)
+#   ctrl_string                 (string)
+#   picker_string               (string)
+#   picker_keep_open            (boolean)
+#   list_custom_keymap          (string)    ("none", "full", "asus_tf", "sgh_i927", "sgh_i927_ics", "se_xppro")
+#   bell                        (boolean)
+#   bellVolume                  (float)
+#   bellVibrate                 (boolean)
+#   bellNotification            (boolean)
+#   screen_capture_folder       (string)
+#   screen_capture_popup        (boolean)
+#   file_dialog                 (string)
+#   download_folder             (string)
+#   remote_upload_folder        (string)
+#   upload_dest_prompt          (boolean)
+#   background_file_transfer    (boolean)
+#   debug_keycodes              (boolean)
+#   delete_deployment           (boolean)
+#   fg_color                    (integer)   (1 based just as shown by color activity)
+#   bg_color                    (integer)   (1 based just as shown by color activity)
+#
+
+
+tn5250://pub400.com:23#pub400
+    encryption5250=TLSv1.3
+    fontsize=20
+    fixed_size=true
+    fixed_width=40
+    fixed_height=25
+
+global://
+    emulation=xterm-256color
+    scrollback=200
+    rotation=Force portrait
+    camera=None
+    volup=Soft Function Keypad
+    voldn=Tab
+    search=None
+    ptt=Monitor Key
+    eula=true
+    delete_deployment=false
+    fg_color=11
+    bg_color=1
+
+#
+# end
--- a/app/src/main/java/com/five_ten_sg/connectbot/HostListActivity.java	Fri Feb 10 13:42:14 2023 -0700
+++ b/app/src/main/java/com/five_ten_sg/connectbot/HostListActivity.java	Fri Feb 10 14:32:41 2023 -0700
@@ -210,10 +210,10 @@
         makingShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())
                          || Intent.ACTION_PICK.equals(getIntent().getAction());
 
-        // connect with hosts database, read deployment file,  and populate list
+        // connect with hosts database, read connections file,  and populate list
         hostdb = new HostDatabase(this);
-        // build hosts from a deployment text file
-        Uri launch = createDeploymentHosts();
+        // build hosts from a connections text file
+        Uri launch = createHostConnections();
         updateList();
 
         // check for eula agreement, which might be set from the deployment file
@@ -458,16 +458,24 @@
         return true;
     }
 
-    private Uri createDeploymentHosts() {
+    private Uri createHostConnections() {
         Uri launch = null;
         try {
             boolean del = true;
             int[] c = hostdb.getGlobalDefaultColors();
             int fg = c[0];
             int bg = c[1];
-            String fn = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() +
-                        File.separator + "deployment.connections";
-            BufferedReader reader = new BufferedReader(new FileReader(fn));
+            String con = "/510Connectbot.connections";
+            String external_dir = Environment.getExternalStorageDirectory().getAbsolutePath();
+            String accuspeech   = "/AccuSpeech/VoiceProjects";
+            String download_dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
+            BufferedReader reader = null;
+            try {
+                reader = new BufferedReader(new FileReader(external_dir + accuspeech + con));
+            }
+            catch (Exception e) {
+                reader = new BufferedReader(new FileReader(download_dir + con));
+            }
             String line = null;
 
             while ((line = reader.readLine()) != null) {
--- a/deployment.connections	Fri Feb 10 13:42:14 2023 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-#
-# available host keys:
-#
-# nickname          (string)
-# color             (string)    ("red", "green", "blue", "gray")
-# fontsize          (float)
-# fixed_size        (boolean)
-# fixed_width       (integer)
-# fixed_height      (integer)
-# pubkeyid          (integer)   (-2, -1)    -2=none, -1=any
-# useauthagent      (string)    ("no", "confirm", "yes")
-# postlogin         (string)
-# compression       (boolean)
-# httpproxy         (string)
-# wantsession       (boolean)
-# stayconnected     (boolean)
-# delkey            (string)    ("del", "backspace")
-# encoding          (string)    ("UTF-8", etc)
-# username          (string)
-# hostname          (string)
-# port              (integer)
-# monitor           (string)
-# emulation         (string)    ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen", or other answerback string)
-# encryption5250    (string)    ("NONE", "TLSv1.2", "TLSv1.3")
-# library5250       (string)
-# menu5250          (string)
-# program5250       (string)
-# wantx11forward    (boolean)
-# x11host           (string)
-# x11port           (integer)
-# autolaunch        (boolean)
-
-
-#
-# global settings are under global:// tag
-#
-# available global keys:
-#
-#   memkeys                     (boolean)
-#   connPersist                 (boolean)
-#   emulation                   (string) ("xterm-color", "xterm-256color", "xterm", "vt100", "ansi", "screen")
-#   scrollback                  (integer)
-#   rotation                    (string) ("Default", "Force landscape", "Force portrait", "Automatic")
-#   shiftfkeys                  (boolean)
-#   ctrlfkeys                   (boolean)
-#   keymode                     (string) ("Use right-side keys", "Use left-side keys", "none")
-#   camera                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
-#   volup                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
-#   voldn                       (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
-#   search                      (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
-#   ptt                         (string) ("CTRL", "Esc", "Tab", "Screen Capture", "Ctrl+A then Space", "Ctrl+A", "Esc+A", "Monitor Key", "Soft Function Keypad", "Increase Font Size", "Decrease Font Size", "None")
-#   keepalive                   (boolean)
-#   wifilock                    (boolean)
-#   bumpyarrows                 (boolean)
-#   eula                        (boolean)
-#   extended_longpress          (boolean)
-#   ctrl_string                 (string)
-#   picker_string               (string)
-#   picker_keep_open            (boolean)
-#   list_custom_keymap          (string)    ("none", "full", "asus_tf", "sgh_i927", "sgh_i927_ics", "se_xppro")
-#   bell                        (boolean)
-#   bellVolume                  (float)
-#   bellVibrate                 (boolean)
-#   bellNotification            (boolean)
-#   screen_capture_folder       (string)
-#   screen_capture_popup        (boolean)
-#   file_dialog                 (string)
-#   download_folder             (string)
-#   remote_upload_folder        (string)
-#   upload_dest_prompt          (boolean)
-#   background_file_transfer    (boolean)
-#   debug_keycodes              (boolean)
-#   delete_deployment           (boolean)
-#   fg_color                    (integer)   (1 based just as shown by color activity)
-#   bg_color                    (integer)   (1 based just as shown by color activity)
-#
-
-
-tn5250://pub400.com:23#pub400
-    encryption5250=TLSv1.3
-    fontsize=20
-    fixed_size=true
-    fixed_width=40
-    fixed_height=25
-
-global://
-    emulation=xterm-256color
-    scrollback=200
-    rotation=Force portrait
-    camera=None
-    volup=Soft Function Keypad
-    voldn=Tab
-    search=None
-    ptt=Monitor Key
-    eula=true
-    delete_deployment=false
-    fg_color=11
-    bg_color=1
-
-#
-# end