aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-08-23 20:50:28 +0000
committerKenny Root <kenny@the-b.org>2009-08-23 20:50:28 +0000
commit44b8858d0c21d7e1e4dbe16195e4bc2b718117c6 (patch)
tree3a1c5e526eb5343d2549bb08c510cd7226491b8b /src
parent4964305192e660147248006978a2bdbe2ed72143 (diff)
downloadconnectbot-44b8858d0c21d7e1e4dbe16195e4bc2b718117c6.tar.gz
connectbot-44b8858d0c21d7e1e4dbe16195e4bc2b718117c6.tar.bz2
connectbot-44b8858d0c21d7e1e4dbe16195e4bc2b718117c6.zip
Validate Force Resize input are integers
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@402 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src')
-rw-r--r--src/org/connectbot/ConsoleActivity.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index 9223a18..803b84b 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -764,8 +764,19 @@ public class ConsoleActivity extends Activity {
.setView(resizeView)
.setPositiveButton(R.string.button_resize, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
- int width = Integer.parseInt(((EditText)resizeView.findViewById(R.id.width)).getText().toString());
- int height = Integer.parseInt(((EditText)resizeView.findViewById(R.id.height)).getText().toString());
+ int width, height;
+ try {
+ width = Integer.parseInt(((EditText) resizeView
+ .findViewById(R.id.width))
+ .getText().toString());
+ height = Integer.parseInt(((EditText) resizeView
+ .findViewById(R.id.height))
+ .getText().toString());
+ } catch (NumberFormatException nfe) {
+ // TODO change this to a real dialog where we can
+ // make the input boxes turn red to indicate an error.
+ return;
+ }
terminalView.forceSize(width, height);
}