From f70cf6167bc7590215da4bb2d952fafcd909c1d1 Mon Sep 17 00:00:00 2001 From: mendhak Date: Mon, 24 Mar 2014 21:52:52 +0000 Subject: [PATCH] Enable automatic close on disconnect (for automation) --- res/values/strings.xml | 3 +++ res/xml/host_prefs.xml | 6 ++++++ src/sk/vx/connectbot/bean/HostBean.java | 12 +++++++++++- src/sk/vx/connectbot/service/TerminalBridge.java | 2 +- src/sk/vx/connectbot/util/HostDatabase.java | 14 +++++++++++--- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index a689e54d..e0eeb804 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -662,4 +662,7 @@ String of characters for the CTRL+? combination Fullscreen + + Close on disconnect + Close immediately after remote disconnect without prompting. diff --git a/res/xml/host_prefs.xml b/res/xml/host_prefs.xml index f8ff58b3..6f36605c 100644 --- a/res/xml/host_prefs.xml +++ b/res/xml/host_prefs.xml @@ -92,6 +92,12 @@ android:summary="@string/hostpref_stayconnected_summary" /> + + createHostBeans(Cursor c) { COL_STAYCONNECTED = c.getColumnIndexOrThrow(FIELD_HOST_STAYCONNECTED), COL_WANTX11FORWARD = c.getColumnIndexOrThrow(FIELD_HOST_WANTX11FORWARD), COL_X11HOST = c.getColumnIndexOrThrow(FIELD_HOST_X11HOST), - COL_X11PORT = c.getColumnIndexOrThrow(FIELD_HOST_X11PORT); + COL_X11PORT = c.getColumnIndexOrThrow(FIELD_HOST_X11PORT), + COL_QUICKDISCONNECT = c.getColumnIndexOrThrow(FIELD_HOST_QUICKDISCONNECT); while (c.moveToNext()) { HostBean host = new HostBean(); @@ -427,6 +434,7 @@ private List createHostBeans(Cursor c) { host.setWantX11Forward(Boolean.valueOf(c.getString(COL_WANTX11FORWARD))); host.setX11Host(c.getString(COL_X11HOST)); host.setX11Port(c.getInt(COL_X11PORT)); + host.setQuickDisconnect(Boolean.valueOf(c.getString(COL_QUICKDISCONNECT))); hosts.add(host); }