diff src/com/five_ten_sg/connectbot/service/TerminalBridge.java @ 223:61ed3984fc1d

proper labels on the soft 24 function keypad
author Carl Byington <carl@five-ten-sg.com>
date Tue, 08 Jul 2014 17:20:07 -0700
parents 2e4ab8c33851
children bc40032ad1da
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Tue Jul 08 10:46:40 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Tue Jul 08 17:20:07 2014 -0700
@@ -40,6 +40,7 @@
 import com.five_ten_sg.connectbot.transport.TransportFactory;
 import com.five_ten_sg.connectbot.util.HostDatabase;
 import com.five_ten_sg.connectbot.util.PreferenceConstants;
+import com.five_ten_sg.connectbot.util.StringPickerDialog;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.graphics.Bitmap;
@@ -1261,32 +1262,32 @@
      * Function keys dialog
      */
     public boolean showFKeysDialog() {
-        final String pickerString = "1234567890abcdefghijklmn";
+        final String []pickerString = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24"};
         final HashMap<String,Integer> keymap = new HashMap<String,Integer>();
-        keymap.put("1", vt320.KEY_F1);
-        keymap.put("2", vt320.KEY_F2);
-        keymap.put("3", vt320.KEY_F3);
-        keymap.put("4", vt320.KEY_F4);
-        keymap.put("5", vt320.KEY_F5);
-        keymap.put("6", vt320.KEY_F6);
-        keymap.put("7", vt320.KEY_F7);
-        keymap.put("8", vt320.KEY_F8);
-        keymap.put("9", vt320.KEY_F9);
-        keymap.put("0", vt320.KEY_F10);
-        keymap.put("a", vt320.KEY_F11);
-        keymap.put("b", vt320.KEY_F12);
-        keymap.put("c", vt320.KEY_F13);
-        keymap.put("d", vt320.KEY_F14);
-        keymap.put("e", vt320.KEY_F15);
-        keymap.put("f", vt320.KEY_F16);
-        keymap.put("g", vt320.KEY_F17);
-        keymap.put("h", vt320.KEY_F18);
-        keymap.put("i", vt320.KEY_F19);
-        keymap.put("j", vt320.KEY_F20);
-        keymap.put("k", vt320.KEY_F21);
-        keymap.put("l", vt320.KEY_F22);
-        keymap.put("m", vt320.KEY_F23);
-        keymap.put("n", vt320.KEY_F24);
+        keymap.put("F1", vt320.KEY_F1);
+        keymap.put("F2", vt320.KEY_F2);
+        keymap.put("F3", vt320.KEY_F3);
+        keymap.put("F4", vt320.KEY_F4);
+        keymap.put("F5", vt320.KEY_F5);
+        keymap.put("F6", vt320.KEY_F6);
+        keymap.put("F7", vt320.KEY_F7);
+        keymap.put("F8", vt320.KEY_F8);
+        keymap.put("F9", vt320.KEY_F9);
+        keymap.put("F10", vt320.KEY_F10);
+        keymap.put("F11", vt320.KEY_F11);
+        keymap.put("F12", vt320.KEY_F12);
+        keymap.put("F13", vt320.KEY_F13);
+        keymap.put("F14", vt320.KEY_F14);
+        keymap.put("F15", vt320.KEY_F15);
+        keymap.put("F16", vt320.KEY_F16);
+        keymap.put("F17", vt320.KEY_F17);
+        keymap.put("F18", vt320.KEY_F18);
+        keymap.put("F19", vt320.KEY_F19);
+        keymap.put("F20", vt320.KEY_F20);
+        keymap.put("F21", vt320.KEY_F21);
+        keymap.put("F22", vt320.KEY_F22);
+        keymap.put("F23", vt320.KEY_F23);
+        keymap.put("F24", vt320.KEY_F24);
 
         CharSequence str = "";
         Editable content = Editable.Factory.getInstance().newEditable(str);
@@ -1294,7 +1295,7 @@
         if (parent == null)
             return false;
 
-        CharacterPickerDialog cpd = new CharacterPickerDialog(parent.getContext(),
+        StringPickerDialog cpd = new StringPickerDialog(parent.getContext(),
         parent, content, pickerString, true) {
             private void buttonPressed(CharSequence result) {
                 String s = result.toString();
@@ -1303,7 +1304,7 @@
             }
             @Override
             public void onItemClick(AdapterView p, View v, int pos, long id) {
-                final String result = String.valueOf(pickerString.charAt(pos));
+                final String result = pickerString[pos];
                 buttonPressed(result);
             }
             @Override