diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-18 00:06:49 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-18 00:06:49 +0200 |
commit | f743921f5812cd7f6c6b681382d60508ed02a4a9 (patch) | |
tree | abc5069ab0559e074436fcb58f5ac5bb6e7fc6ed /src/de/blinkt/openvpn/LogWindow.java | |
parent | e445ab7fdc6c3912291eaad7aac209b511bcd245 (diff) |
- Make Ipv6 support complete (minus tun-ipv6 warning)
- Implement byte counter support in the log window
- Fix spelling of secret (closes issue #22)
- Replace "quot; with ", no idea what went wrong there (closes issue #21)
Diffstat (limited to 'src/de/blinkt/openvpn/LogWindow.java')
-rw-r--r-- | src/de/blinkt/openvpn/LogWindow.java | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/LogWindow.java b/src/de/blinkt/openvpn/LogWindow.java index 3455e385..2e2612d3 100644 --- a/src/de/blinkt/openvpn/LogWindow.java +++ b/src/de/blinkt/openvpn/LogWindow.java @@ -28,8 +28,9 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import de.blinkt.openvpn.OpenVPN.LogListener; +import de.blinkt.openvpn.OpenVPN.SpeedListener; -public class LogWindow extends ListActivity { +public class LogWindow extends ListActivity implements SpeedListener { private String[] mBconfig=null; @@ -190,6 +191,7 @@ public class LogWindow extends ListActivity { private LogWindowListAdapter ladapter; + private TextView mSpeedView; @Override public boolean onOptionsItemSelected(MenuItem item) { @@ -228,12 +230,23 @@ public class LogWindow extends ListActivity { return true; } + @Override + protected void onResume() { + super.onResume(); + OpenVPN.addSpeedListener(this); + } + @Override + protected void onStop() { + super.onStop(); + OpenVPN.removeSpeedListener(this); + } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setContentView(R.layout.logwindow); ListView lv = getListView(); lv.setOnItemLongClickListener(new OnItemLongClickListener() { @@ -249,12 +262,29 @@ public class LogWindow extends ListActivity { return true; } }); - //lv.setTextFilterEnabled(true); + ladapter = new LogWindowListAdapter(); lv.setAdapter(ladapter); + mSpeedView = (TextView) findViewById(R.id.speed); } - + @Override + public void updateSpeed(final String logmessage) { + runOnUiThread(new Runnable() { + + @Override + public void run() { + mSpeedView.setText(logmessage); + } + }); + + } + + @Override + protected void onDestroy() { + super.onDestroy(); + OpenVPN.removeLogListener(ladapter); + } } |