diff --git a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt index ee15067575..657fadefab 100644 --- a/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt +++ b/app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/AbstractOsmQuestForm.kt @@ -39,6 +39,7 @@ import de.westnordost.streetcomplete.data.osmnotes.edits.NoteEditsController import de.westnordost.streetcomplete.data.quest.QuestKey import de.westnordost.streetcomplete.data.visiblequests.HideQuestController import de.westnordost.streetcomplete.data.visiblequests.QuestsHiddenController +import de.westnordost.streetcomplete.data.visiblequests.VisibleEditTypeController import de.westnordost.streetcomplete.osm.applyReplacePlaceTo import de.westnordost.streetcomplete.osm.isPlace import de.westnordost.streetcomplete.osm.isPlaceOrDisusedPlace @@ -71,6 +72,7 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta private val elementEditsController: ElementEditsController by inject() private val noteEditsController: NoteEditsController by inject() private val hiddenQuestsController: QuestsHiddenController by inject() + private val visibleEditTypeController: VisibleEditTypeController by inject() private val featureDictionaryLazy: Lazy by inject(named("FeatureDictionaryLazy")) private val mapDataWithEditsSource: MapDataWithEditsSource by inject() private val surveyChecker: SurveyChecker by inject() @@ -216,12 +218,18 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta } protected fun onClickCantSay() { - context?.let { AlertDialog.Builder(it) - .setTitle(R.string.quest_leave_new_note_title) - .setMessage(R.string.quest_leave_new_note_description) - .setNegativeButton(R.string.quest_leave_new_note_no) { _, _ -> hideQuest() } - .setPositiveButton(R.string.quest_leave_new_note_yes) { _, _ -> composeNote() } - .show() + context?.let { ctx -> + AlertDialog.Builder(ctx) + .setTitle(R.string.quest_leave_new_note_title) + .setMessage( + ctx.getString(R.string.quest_leave_new_note_description) + + "\n\n" + + ctx.getString(R.string.quest_leave_new_note_disable_info) + ) + .setNegativeButton(R.string.quest_cant_say_hide_quest) { _, _ -> hideQuest() } + .setPositiveButton(R.string.leave_note) { _, _ -> composeNote() } + .setNeutralButton(R.string.quest_generic_answer_disable_this_quest_type) { _, _ -> onClickDisableQuestType() } + .show() } } @@ -247,6 +255,19 @@ abstract class AbstractOsmQuestForm : AbstractQuestForm(), IsShowingQuestDeta } } + private fun onClickDisableQuestType() { + context?.let { AlertDialog.Builder(it) + .setTitle(R.string.quest_disable_quest_type_title) + .setMessage(R.string.quest_disable_quest_type_message) + .setNegativeButton(android.R.string.cancel, null) + .setPositiveButton(R.string.quest_disable_quest_type_yes) { _, _ -> + visibleEditTypeController.setVisibility(questType, false) + hideQuest() + } + .show() + } + } + protected fun applyAnswer(answer: T) { viewLifecycleScope.launch { solve(UpdateElementTagsAction(element, createQuestChanges(answer))) diff --git a/app/src/androidMain/res/values-en/strings.xml b/app/src/androidMain/res/values-en/strings.xml index ae6c346405..ab94a635f7 100644 --- a/app/src/androidMain/res/values-en/strings.xml +++ b/app/src/androidMain/res/values-en/strings.xml @@ -163,6 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +267,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/androidMain/res/values/strings.xml b/app/src/androidMain/res/values/strings.xml index ae6c346405..e3b654e145 100644 --- a/app/src/androidMain/res/values/strings.xml +++ b/app/src/androidMain/res/values/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation. @@ -163,6 +164,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +268,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/commonMain/composeResources/values-en/strings.xml b/app/src/commonMain/composeResources/values-en/strings.xml index ae6c346405..e3b654e145 100644 --- a/app/src/commonMain/composeResources/values-en/strings.xml +++ b/app/src/commonMain/composeResources/values-en/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation. @@ -163,6 +164,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +268,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox diff --git a/app/src/commonMain/composeResources/values/strings.xml b/app/src/commonMain/composeResources/values/strings.xml index ae6c346405..e3b654e145 100644 --- a/app/src/commonMain/composeResources/values/strings.xml +++ b/app/src/commonMain/composeResources/values/strings.xml @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Leave a note instead? You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only + Alternatively, you can disable all quests of this type. This can be changed again in the settings. Leave note Hide In this case, you need to leave a note in which you explain the situation. @@ -163,6 +164,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the Can’t say… It does not exist… + Disable + Hide this quest Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead. It does not exist Leave note @@ -265,6 +268,10 @@ Additionally, some overlays allow you to add new data at the position of a displ StreetMeasure didn’t return a measurement. You could use a tape measure instead, but that might be a little awkward, after all. + Disable this quest type? + This will disable this quest type for the current preset. You won't see quests of this type anymore, but you can re-enable it in the settings. + Disable + You have %1$d unread messages in your inbox