Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -216,12 +218,18 @@ abstract class AbstractOsmQuestForm<T> : 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()
}
}

Expand All @@ -247,6 +255,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()
}
.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
7 changes: 7 additions & 0 deletions app/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the

<string name="quest_leave_new_note_title">Leave a note instead?</string>
<string name="quest_leave_new_note_description">You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only</string>
<string name="quest_leave_new_note_disable_info">Alternatively, you can disable all quests of this type. This can be changed again in the settings.</string>
<string name="quest_leave_new_note_yes">Leave note</string>
<string name="quest_leave_new_note_no">Hide</string>
<string name="quest_leave_new_note_as_answer">In this case, you need to leave a note in which you explain the situation.</string>
Expand All @@ -163,6 +164,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 +268,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
7 changes: 7 additions & 0 deletions app/src/commonMain/composeResources/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the

<string name="quest_leave_new_note_title">Leave a note instead?</string>
<string name="quest_leave_new_note_description">You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only</string>
<string name="quest_leave_new_note_disable_info">Alternatively, you can disable all quests of this type. This can be changed again in the settings.</string>
<string name="quest_leave_new_note_yes">Leave note</string>
<string name="quest_leave_new_note_no">Hide</string>
<string name="quest_leave_new_note_as_answer">In this case, you need to leave a note in which you explain the situation.</string>
Expand All @@ -163,6 +164,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 +268,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
7 changes: 7 additions & 0 deletions app/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the

<string name="quest_leave_new_note_title">Leave a note instead?</string>
<string name="quest_leave_new_note_description">You can leave a public note for other mappers to resolve at this location, or hide this quest for yourself only</string>
<string name="quest_leave_new_note_disable_info">Alternatively, you can disable all quests of this type. This can be changed again in the settings.</string>
<string name="quest_leave_new_note_yes">Leave note</string>
<string name="quest_leave_new_note_no">Hide</string>
<string name="quest_leave_new_note_as_answer">In this case, you need to leave a note in which you explain the situation.</string>
Expand All @@ -163,6 +164,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 +268,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