diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/BackendUndo.kt b/AnkiDroid/src/main/java/com/ichi2/anki/BackendUndo.kt index 1698db1edca5..ee302b20221b 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/BackendUndo.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/BackendUndo.kt @@ -20,6 +20,7 @@ import com.ichi2.anki.UIUtils.showSimpleSnackbar import com.ichi2.libanki.CollectionV16 import com.ichi2.libanki.undoNew import com.ichi2.libanki.undoableOp +import com.ichi2.utils.BlocksSchemaUpgrade import net.ankiweb.rsdroid.BackendException suspend fun AnkiActivity.backendUndoAndShowPopup(col: CollectionV16): Boolean { @@ -36,7 +37,7 @@ suspend fun AnkiActivity.backendUndoAndShowPopup(col: CollectionV16): Boolean { ) true } catch (exc: BackendException) { - // FIXME: -Backend module should export this as a separate Exception + @BlocksSchemaUpgrade("Backend module should export this as a separate Exception") if (exc.localizedMessage == "UndoEmpty") { // backend undo queue empty false diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/ModelBrowser.kt b/AnkiDroid/src/main/java/com/ichi2/anki/ModelBrowser.kt index ecf90c2aee7c..53bd30000a79 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/ModelBrowser.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/ModelBrowser.kt @@ -47,6 +47,7 @@ import com.ichi2.libanki.StdModels import com.ichi2.libanki.Utils import com.ichi2.libanki.utils.TimeManager import com.ichi2.ui.FixedEditText +import com.ichi2.utils.BlocksSchemaUpgrade import com.ichi2.utils.KotlinCleanup import com.ichi2.utils.displayKeyboard import com.ichi2.widget.WidgetStatus.update @@ -427,7 +428,7 @@ class ModelBrowser : AnkiActivity() { */ private fun openTemplateEditor() { if (!BackendFactory.defaultLegacySchema) { - // this screen needs rewriting for the new backend + @BlocksSchemaUpgrade("this screen needs rewriting for the new backend") AlertDialog.Builder(this).setTitle("Not yet supported on new backend").show() return } diff --git a/AnkiDroid/src/main/java/com/ichi2/utils/KotlinCleanup.kt b/AnkiDroid/src/main/java/com/ichi2/utils/KotlinCleanup.kt index 07213b89f4c7..c6f1b8691421 100644 --- a/AnkiDroid/src/main/java/com/ichi2/utils/KotlinCleanup.kt +++ b/AnkiDroid/src/main/java/com/ichi2/utils/KotlinCleanup.kt @@ -27,3 +27,16 @@ package com.ichi2.utils @Repeatable @MustBeDocumented annotation class KotlinCleanup(val value: String) + +/** This must be fixed/implemented before AnkiDroid can switch to using the new backend code + * by default. + */ +@Target( + AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, + AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION, + AnnotationTarget.FIELD, AnnotationTarget.PROPERTY, AnnotationTarget.LOCAL_VARIABLE +) +@Retention(AnnotationRetention.SOURCE) +@Repeatable +@MustBeDocumented +annotation class BlocksSchemaUpgrade(val value: String)