summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2017-12-14 21:21:22 +0100
committerFup Duck <fupduck@sacknagel.com>2017-12-14 21:21:46 +0100
commit08ec840de9657085d9a0baaab54f6b33e16a12d0 (patch)
tree6991abe8325d0128cd04950727bf5f7ffb3946c9 /app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java
parent1312c0dab26508f41246ea925176709fffeb465c (diff)
add LogFragment
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java b/app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java
index d5931c83..a1fc7cdc 100644
--- a/app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java
+++ b/app/src/main/java/de/blinkt/openvpn/fragments/LogFragment.java
@@ -423,6 +423,45 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar.
private TextView mSpeedView;
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.clearlog) {
+ ladapter.clearLog();
+ return true;
+ } else if (item.getItemId() == R.id.cancel) {
+ Intent intent = new Intent(getActivity(), DisconnectVPN.class);
+ startActivity(intent);
+ return true;
+ } else if (item.getItemId() == R.id.send) {
+ ladapter.shareLog();
+ } else if (item.getItemId() == R.id.edit_vpn) {
+ VpnProfile lastConnectedprofile = ProfileManager.get(getActivity(), VpnStatus.getLastConnectedVPNProfile());
+
+ if (lastConnectedprofile != null) {
+ Intent vprefintent = new Intent(getActivity(), Dashboard.class)
+ .putExtra(VpnProfile.EXTRA_PROFILEUUID, lastConnectedprofile.getUUIDString());
+ startActivityForResult(vprefintent, START_VPN_CONFIG);
+ } else {
+ Toast.makeText(getActivity(), R.string.log_no_last_vpn, Toast.LENGTH_LONG).show();
+ }
+ } else if (item.getItemId() == R.id.toggle_time) {
+ showHideOptionsPanel();
+ } else if (item.getItemId() == android.R.id.home) {
+ // This is called when the Home (Up) button is pressed
+ // in the Action Bar.
+ Intent parentActivityIntent = new Intent(getActivity(), Dashboard.class);
+ parentActivityIntent.addFlags(
+ Intent.FLAG_ACTIVITY_CLEAR_TOP |
+ Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(parentActivityIntent);
+ getActivity().finish();
+ return true;
+
+ }
+ return super.onOptionsItemSelected(item);
+
+ }
+
private void showHideOptionsPanel() {
boolean optionsVisible = (mOptionsLayout.getVisibility() != View.GONE);