summaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2021-08-13 16:53:55 +0200
committerArne Schwabe <arne@rfc2549.org>2021-08-13 16:53:55 +0200
commit2bd5c430d01bcbc2087d630d431a793a4c0a497d (patch)
treeb66a27cd59556c4e12ebe0ff18144beb1dcc19c6 /main/src/ui
parent2765afc92e13d9e751a036d53736bf42978e5b87 (diff)
Add a dialog in Log Window allowing to start pending auth
Diffstat (limited to 'main/src/ui')
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt2
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java8
-rw-r--r--main/src/ui/res/layout/log_fragment.xml8
-rw-r--r--main/src/ui/res/layout/vpnstatus.xml7
4 files changed, 23 insertions, 2 deletions
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"/>
</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"
diff --git a/main/src/ui/res/layout/vpnstatus.xml b/main/src/ui/res/layout/vpnstatus.xml
index 3b464b62..a16eea39 100644
--- a/main/src/ui/res/layout/vpnstatus.xml
+++ b/main/src/ui/res/layout/vpnstatus.xml
@@ -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> \ No newline at end of file