File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import android.content.Context
2323import android.content.Intent
2424import android.content.SharedPreferences
2525import android.content.res.Resources
26+ import android.net.Uri
2627import android.os.Build
2728import android.os.Bundle
2829import android.os.Environment
@@ -494,4 +495,10 @@ sealed class FatalInitializationError {
494495 when (this ) {
495496 is WebViewError -> ExceptionUtil .getExceptionMessage(error)
496497 }
498+
499+ val infoLink: Uri ?
500+ get() =
501+ when (this ) {
502+ is WebViewError -> null
503+ }
497504}
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ import com.ichi2.utils.customView
194194import com.ichi2.utils.dp
195195import com.ichi2.utils.message
196196import com.ichi2.utils.negativeButton
197+ import com.ichi2.utils.neutralButton
197198import com.ichi2.utils.positiveButton
198199import com.ichi2.utils.show
199200import com.ichi2.utils.title
@@ -1005,6 +1006,11 @@ open class DeckPicker :
10051006 positiveButton(R .string.close) {
10061007 closeCollectionAndFinish()
10071008 }
1009+ failure.infoLink?.let { url ->
1010+ neutralButton(R .string.help) {
1011+ openUrl(url)
1012+ }
1013+ }
10081014 cancelable(false )
10091015 }
10101016 is DiskFull -> displayNoStorageError()
Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ object InitialActivity {
155155 data class InitializationError (
156156 val error : FatalInitializationError ,
157157 ) : StartupFailure() {
158+ val infoLink
159+ get() = error.infoLink
160+
158161 fun toHumanReadableString (context : Context ): String =
159162 when (error) {
160163 is FatalInitializationError .WebViewError ->
You can’t perform that action at this time.
0 commit comments