aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/dia_portforward.xml9
-rw-r--r--src/org/connectbot/PortForwardListActivity.java17
2 files changed, 17 insertions, 9 deletions
diff --git a/res/layout/dia_portforward.xml b/res/layout/dia_portforward.xml
index fe7abcb..b40d0ca 100644
--- a/res/layout/dia_portforward.xml
+++ b/res/layout/dia_portforward.xml
@@ -75,12 +75,11 @@
<EditText
android:id="@+id/portforward_source"
- android:hint="143"
+ android:hint="8080"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:numeric="integer"
- android:singleLine="true"
android:layout_weight="1"
+ android:inputType="number"
/>
</TableRow>
@@ -94,11 +93,11 @@
<EditText
android:id="@+id/portforward_destination"
- android:hint="localhost:143"
+ android:hint="localhost:80"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:singleLine="true"
android:layout_weight="1"
+ android:inputType="textEmailAddress"
/>
</TableRow>
</TableLayout>
diff --git a/src/org/connectbot/PortForwardListActivity.java b/src/org/connectbot/PortForwardListActivity.java
index 1c48e18..319ec72 100644
--- a/src/org/connectbot/PortForwardListActivity.java
+++ b/src/org/connectbot/PortForwardListActivity.java
@@ -66,6 +66,8 @@ import android.widget.AdapterView.OnItemSelectedListener;
public class PortForwardListActivity extends ListActivity {
public final static String TAG = PortForwardListActivity.class.toString();
+ private static final int LISTENER_CYCLE_TIME = 500;
+
protected HostDatabase hostdb;
private List<PortForwardBean> portForwards;
@@ -281,6 +283,9 @@ public class PortForwardListActivity extends ListActivity {
.setPositiveButton(R.string.button_change, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
try {
+ if (hostBridge != null)
+ hostBridge.disablePortForward(pfb);
+
pfb.setNickname(nicknameEdit.getText().toString());
switch (typeSpinner.getSelectedItemPosition()) {
@@ -299,10 +304,14 @@ public class PortForwardListActivity extends ListActivity {
pfb.setDest(destEdit.getText().toString());
// Use the new settings for the existing connection.
- if (hostBridge != null) {
- hostBridge.disablePortForward(pfb);
- hostBridge.enablePortForward(pfb);
- }
+ if (hostBridge != null)
+ updateHandler.postDelayed(new Runnable() {
+ public void run() {
+ hostBridge.enablePortForward(pfb);
+ updateHandler.sendEmptyMessage(-1);
+ }
+ }, LISTENER_CYCLE_TIME);
+
if (!hostdb.savePortForward(pfb))
throw new SQLException("Could not save port forward");