aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/connectbot/HostListActivity.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-08-14 12:16:32 +0000
committerKenny Root <kenny@the-b.org>2009-08-14 12:16:32 +0000
commit9c092118f8ebd2cd3b40f8a689c234b450778b11 (patch)
treeeb003b0764c7f3eac15f262e9a142c509fbbbf2b /src/org/connectbot/HostListActivity.java
parent8be636afaee6decbf7e7465870e2296c343b36c4 (diff)
downloadconnectbot-9c092118f8ebd2cd3b40f8a689c234b450778b11.tar.gz
connectbot-9c092118f8ebd2cd3b40f8a689c234b450778b11.tar.bz2
connectbot-9c092118f8ebd2cd3b40f8a689c234b450778b11.zip
Don't auto-start local connections upon selection
There is apparently a race condition in building the UIs. The local transport was starting up prematurely and causing the host list to cycle multiple times at some point. This change also makes it so that hosts quick-connected using the same nickname as a previous host simply uses the previous host instead of creating a new entry that can never be "reached" git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@396 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src/org/connectbot/HostListActivity.java')
-rw-r--r--src/org/connectbot/HostListActivity.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/org/connectbot/HostListActivity.java b/src/org/connectbot/HostListActivity.java
index 1cdee4f..cc2a1b2 100644
--- a/src/org/connectbot/HostListActivity.java
+++ b/src/org/connectbot/HostListActivity.java
@@ -247,15 +247,7 @@ public class HostListActivity extends ListActivity {
quickconnect.setHint(formatHint);
quickconnect.setError(null);
-
- // Start ConsoleActivity immediately if the hint is empty.
- if ("".equals(formatHint)) {
- quickconnect.setEnabled(false);
- startConsoleActivity();
- } else {
- quickconnect.setEnabled(true);
- quickconnect.requestFocus();
- }
+ quickconnect.requestFocus();
}
public void onNothingSelected(AdapterView<?> arg0) { }
});
@@ -410,14 +402,17 @@ public class HostListActivity extends ListActivity {
return false;
}
- HostBean host = TransportFactory.getTransport(uri.getScheme()).createHost(uri);
- host.setColor(HostDatabase.COLOR_GRAY);
- host.setPubkeyId(HostDatabase.PUBKEYID_ANY);
- hostdb.saveHost(host);
+ HostBean host = TransportFactory.findHost(hostdb, uri);
+ if (host == null) {
+ host = TransportFactory.getTransport(uri.getScheme()).createHost(uri);
+ host.setColor(HostDatabase.COLOR_GRAY);
+ host.setPubkeyId(HostDatabase.PUBKEYID_ANY);
+ hostdb.saveHost(host);
+ }
Intent intent = new Intent(HostListActivity.this, ConsoleActivity.class);
intent.setData(uri);
- HostListActivity.this.startActivity(intent);
+ startActivity(intent);
return true;
}