0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 03:52:27 +02:00

Add a dialog in Log Window allowing to start pending auth

This commit is contained in:
Arne Schwabe 2021-08-13 16:53:55 +02:00
parent 2765afc92e
commit 2bd5c430d0
6 changed files with 24 additions and 3 deletions

View File

@ -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;

View File

@ -505,5 +505,6 @@
<string name="proxy_info">HTTP Proxy: %1$s %2$d</string>
<string name="use_alwayson_vpn">Please you the Always-On Feature of Android to enable VPN at boot time.</string>
<string name="open_vpn_settings">Open VPN Settings</string>
<string name="trigger_pending_auth_dialog">Press here open a window to enter additional required authentication</string>
</resources>

View File

@ -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) {

View File

@ -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;
});
}
}

View File

@ -25,6 +25,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<TextView
android:id="@+id/trigger_pending_action"
android:textAppearance="@android:style/TextAppearance.Large"
android:visibility="gone"
android:text="@string/trigger_pending_auth_dialog"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
<ListView
android:id="@android:id/list"

View File

@ -48,5 +48,12 @@
tools:text="Connected to a very long ipv4 and 3483489348238824829482384928"
style="@style/logWindowStatusText"/>
<TextView
android:id="@+id/trigger_pending_action"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textAppearance="@android:style/TextAppearance.Large"
android:visibility="gone"
android:text="@string/trigger_pending_auth_dialog"/>
</merge>