Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/service/TerminalBridge.java @ 307:071eccdff8ea ganymed
fix java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:16:58 -0700 |
parents | db26984b69f5 |
children | 651aff5a46c7 |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Wed Jul 30 12:09:51 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java Wed Jul 30 14:16:58 2014 -0700 @@ -332,7 +332,6 @@ // get proper font size setMyFontSize(); - // finally send any post-login string, if requested injectString(host.getPostLogin()); } @@ -445,6 +444,7 @@ */ final void setFontSize(float size) { if (size <= 0.0) size = 12.0f; + size = (float)(int)((size * 10.0f) + 0.5f) / 10.0f; defaultPaint.setTextSize(size); fontSize = size; @@ -782,6 +782,7 @@ this.columns = cols; this.rows = rows; forcedSize = true; + if (fixed) setFontSize(host.getFontSize()); else setFontSize(size); } @@ -1136,7 +1137,7 @@ */ public boolean showArrowsDialog() { final String []pickerStrings = {"←", "→", "↑", "↓", "tab", "ins", "del", "ret"}; - final HashMap<String,Integer> keymap = new HashMap<String,Integer>(); + final HashMap<String, Integer> keymap = new HashMap<String, Integer>(); keymap.put("←", vt320.KEY_LEFT); keymap.put("→", vt320.KEY_RIGHT); keymap.put("↑", vt320.KEY_UP); @@ -1145,15 +1146,14 @@ keymap.put("ins", vt320.KEY_INSERT); keymap.put("del", vt320.KEY_DELETE); keymap.put("ret", vt320.KEY_ENTER); - CharSequence str = ""; Editable content = Editable.Factory.getInstance().newEditable(str); if (parent == null) return false; StringPickerDialog cpd = new StringPickerDialog(parent.getContext(), - parent, content, - pickerStrings, true) { + parent, content, + pickerStrings, true) { private void buttonPressed(String s) { if (keymap.containsKey(s)) buffer.keyPressed(keymap.get(s), ' ', 0); } @@ -1165,6 +1165,7 @@ public void onClick(View v) { if (v instanceof Button) { final String s = ((Button) v).getText().toString(); + if (s.equals("")) dismiss(); else buttonPressed(s); } @@ -1260,7 +1261,7 @@ */ public boolean showFKeysDialog() { final String []pickerStrings = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", "←", "→", "↑", "↓", "tab", "ins", "del", "ret"}; - final HashMap<String,Integer> keymap = new HashMap<String,Integer>(); + final HashMap<String, Integer> keymap = new HashMap<String, Integer>(); keymap.put("F1", vt320.KEY_F1); keymap.put("F2", vt320.KEY_F2); keymap.put("F3", vt320.KEY_F3); @@ -1293,17 +1294,17 @@ keymap.put("ins", vt320.KEY_INSERT); keymap.put("del", vt320.KEY_DELETE); keymap.put("ret", vt320.KEY_ENTER); - CharSequence str = ""; Editable content = Editable.Factory.getInstance().newEditable(str); if (parent == null) return false; StringPickerDialog cpd = new StringPickerDialog(parent.getContext(), - parent, content, - pickerStrings, true) { + parent, content, + pickerStrings, true) { private void buttonPressed(String s) { if (keymap.containsKey(s)) buffer.keyPressed(keymap.get(s), ' ', 0); + dismiss(); } @Override @@ -1314,6 +1315,7 @@ public void onClick(View v) { if (v instanceof Button) { final String s = ((Button) v).getText().toString(); + if (s.equals("")) dismiss(); else buttonPressed(s); }