From 2bd5c430d01bcbc2087d630d431a793a4c0a497d Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 13 Aug 2021 16:53:55 +0200 Subject: Add a dialog in Log Window allowing to start pending auth --- main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java | 1 - main/src/main/res/values/strings.xml | 1 + main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt | 2 -- main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java | 8 ++++++++ main/src/ui/res/layout/log_fragment.xml | 8 ++++++++ main/src/ui/res/layout/vpnstatus.xml | 7 +++++++ 6 files changed, 24 insertions(+), 3 deletions(-) (limited to 'main') diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java index 4d286b81..5b88f1a9 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java @@ -5,7 +5,6 @@ package de.blinkt.openvpn.core; -import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Build; diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index 8b21deb9..4511d80c 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -505,5 +505,6 @@ HTTP Proxy: %1$s %2$d Please you the Always-On Feature of Android to enable VPN at boot time. Open VPN Settings + Press here open a window to enter additional required authentication diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt index 5a42599f..d01797f2 100644 --- a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt +++ b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt @@ -601,8 +601,6 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener // We parsed the intent, relay on saved instance for restoring setIntent(null) } - - } private fun doImportIntent(intent: Intent) { diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java index 64eb720d..611e10e9 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java @@ -87,8 +87,10 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. private TextView mUpStatus; private TextView mDownStatus; private TextView mConnectStatus; + private TextView mStartPendingIntent; private boolean mShowOptionsLayout; private CheckBox mClearLogCheckBox; + private Intent mPendingIntent; @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { @@ -622,6 +624,10 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. mUpStatus = (TextView) v.findViewById(R.id.speedUp); mDownStatus = (TextView) v.findViewById(R.id.speedDown); mConnectStatus = (TextView) v.findViewById(R.id.speedStatus); + mStartPendingIntent = (TextView) v.findViewById(R.id.trigger_pending_action); + mStartPendingIntent.setOnClickListener((view) -> {if (mPendingIntent != null) + startActivity(mPendingIntent); + }); if (mShowOptionsLayout) mOptionsLayout.setVisibility(View.VISIBLE); return v; @@ -663,6 +669,8 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. if (mConnectStatus != null) mConnectStatus.setText(cleanLogMessage); } + mStartPendingIntent.setVisibility(intent == null ? View.GONE : View.VISIBLE); + mPendingIntent = intent; }); } } diff --git a/main/src/ui/res/layout/log_fragment.xml b/main/src/ui/res/layout/log_fragment.xml index abfe7894..df87d1c1 100644 --- a/main/src/ui/res/layout/log_fragment.xml +++ b/main/src/ui/res/layout/log_fragment.xml @@ -25,6 +25,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content"/> + + \ No newline at end of file -- cgit v1.2.3