summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/LogWindow.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-18 00:06:49 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-18 00:06:49 +0200
commit7ad69e645000fc66951a79104b0ce5ac3478b9f3 (patch)
treeabc5069ab0559e074436fcb58f5ac5bb6e7fc6ed /src/de/blinkt/openvpn/LogWindow.java
parent39e94d54313cf140929339a9f2613d79cbf734b0 (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;quot; with &quot;, 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.java36
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);
+ }
}