Improve warning message

Improve wording and add channel name to the default psk warning

Co-authored-by: Andre K <andrekir@pm.me>
pull/467/head
Tom 2022-08-23 10:44:34 +00:00 zatwierdzone przez GitHub
rodzic 7c940d209a
commit f8cec34862
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 10 dodań i 8 usunięć

Wyświetl plik

@ -338,16 +338,18 @@ class ChannelFragment : ScreenFragment("Channel"), Logging {
.setRegion(model.region)
.setModemPreset(newModemPreset)
val humanName = Channel(newSettings.build(), newLoRaConfig.build()).humanName
binding.channelNameEdit.setText(humanName)
val message = buildString {
append(getString(R.string.are_you_sure_channel))
if (!shouldUseRandomKey)
append("\n\n" + getString(R.string.warning_default_psk).format(humanName))
}
MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.change_channel)
.setMessage(buildString {
append(getString(R.string.are_you_sure_channel))
if (!shouldUseRandomKey) {
append("\n\n")
append(getString(R.string.warning_default_channel))
}
})
.setMessage(message)
.setNeutralButton(R.string.cancel) { _, _ ->
setGUIfromModel()
}

Wyświetl plik

@ -155,5 +155,5 @@
<string name="message">Message</string>
<string name="mode_append">Append to message</string>
<string name="mode_instant">Instantly send</string>
<string name="warning_default_channel">As you have not changed the channel name you are using the default encryption key (any Meshtastic user can read your messages).</string>
<string name="warning_default_psk">Empty channel names use the default encryption key (any device on %s can read your messages).</string>
</resources>