Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -71,6 +72,7 @@ abstract class AbstractOsmQuestForm<T> : 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<FeatureDictionary> by inject(named("FeatureDictionaryLazy"))
private val mapDataWithEditsSource: MapDataWithEditsSource by inject()
private val surveyChecker: SurveyChecker by inject()
Expand Down Expand Up @@ -219,8 +221,9 @@ abstract class AbstractOsmQuestForm<T> : AbstractQuestForm(), IsShowingQuestDeta
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() }
.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()
}
}
Expand All @@ -247,6 +250,19 @@ abstract class AbstractOsmQuestForm<T> : 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()
Comment thread
VeryUsual marked this conversation as resolved.
Outdated
}
.show()
}
}

protected fun applyAnswer(answer: T) {
viewLifecycleScope.launch {
solve(UpdateElementTagsAction(element, createQuestChanges(answer)))
Expand Down
6 changes: 6 additions & 0 deletions app/src/androidMain/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="quest_generic_answer_notApplicable">Can’t say…</string>

<string name="quest_generic_answer_does_not_exist">It does not exist…</string>
<string name="quest_generic_answer_disable_this_quest_type">Disable</string>
<string name="quest_cant_say_hide_quest">Hide this quest</string>
<string name="osm_element_gone_description">Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead.</string>
<string name="osm_element_gone_confirmation">It does not exist</string>
<string name="leave_note">Leave note</string>
Expand Down Expand Up @@ -265,6 +267,10 @@ Additionally, some overlays allow you to add new data at the position of a displ
<string name="quest_disable_message_not_working">StreetMeasure didn’t return a measurement.</string>
<string name="quest_disable_message_tape_measure">You could use a tape measure instead, but that might be a little awkward, after all.</string>

<string name="quest_disable_quest_type_title">Disable this quest type?</string>
<string name="quest_disable_quest_type_message">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.</string>
<string name="quest_disable_quest_type_yes">Disable</string>

<!-- Notifications -->

<string name="unread_messages_message">You have %1$d unread messages in your inbox</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="quest_generic_answer_notApplicable">Can’t say…</string>

<string name="quest_generic_answer_does_not_exist">It does not exist…</string>
<string name="quest_generic_answer_disable_this_quest_type">Disable</string>
<string name="quest_cant_say_hide_quest">Hide this quest</string>
<string name="osm_element_gone_description">Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead.</string>
<string name="osm_element_gone_confirmation">It does not exist</string>
<string name="leave_note">Leave note</string>
Expand Down Expand Up @@ -265,6 +267,10 @@ Additionally, some overlays allow you to add new data at the position of a displ
<string name="quest_disable_message_not_working">StreetMeasure didn’t return a measurement.</string>
<string name="quest_disable_message_tape_measure">You could use a tape measure instead, but that might be a little awkward, after all.</string>

<string name="quest_disable_quest_type_title">Disable this quest type?</string>
<string name="quest_disable_quest_type_message">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.</string>
<string name="quest_disable_quest_type_yes">Disable</string>

<!-- Notifications -->

<string name="unread_messages_message">You have %1$d unread messages in your inbox</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/commonMain/composeResources/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="quest_generic_answer_notApplicable">Can’t say…</string>

<string name="quest_generic_answer_does_not_exist">It does not exist…</string>
<string name="quest_generic_answer_disable_this_quest_type">Disable</string>
<string name="quest_cant_say_hide_quest">Hide this quest</string>
<string name="osm_element_gone_description">Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead.</string>
<string name="osm_element_gone_confirmation">It does not exist</string>
<string name="leave_note">Leave note</string>
Expand Down Expand Up @@ -265,6 +267,10 @@ Additionally, some overlays allow you to add new data at the position of a displ
<string name="quest_disable_message_not_working">StreetMeasure didn’t return a measurement.</string>
<string name="quest_disable_message_tape_measure">You could use a tape measure instead, but that might be a little awkward, after all.</string>

<string name="quest_disable_quest_type_title">Disable this quest type?</string>
<string name="quest_disable_quest_type_message">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.</string>
<string name="quest_disable_quest_type_yes">Disable</string>

<!-- Notifications -->

<string name="unread_messages_message">You have %1$d unread messages in your inbox</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="quest_generic_answer_notApplicable">Can’t say…</string>

<string name="quest_generic_answer_does_not_exist">It does not exist…</string>
<string name="quest_generic_answer_disable_this_quest_type">Disable</string>
Comment thread
VeryUsual marked this conversation as resolved.
Outdated
<string name="quest_cant_say_hide_quest">Hide this quest</string>
<string name="osm_element_gone_description">Are you sure that it does not exist, not even at a slightly different location? If you’re not sure, leave a note instead.</string>
<string name="osm_element_gone_confirmation">It does not exist</string>
<string name="leave_note">Leave note</string>
Expand Down Expand Up @@ -265,6 +267,10 @@ Additionally, some overlays allow you to add new data at the position of a displ
<string name="quest_disable_message_not_working">StreetMeasure didn’t return a measurement.</string>
<string name="quest_disable_message_tape_measure">You could use a tape measure instead, but that might be a little awkward, after all.</string>

<string name="quest_disable_quest_type_title">Disable this quest type?</string>
<string name="quest_disable_quest_type_message">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.</string>
<string name="quest_disable_quest_type_yes">Disable</string>

<!-- Notifications -->

<string name="unread_messages_message">You have %1$d unread messages in your inbox</string>
Expand Down