kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
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
rodzic
7c940d209a
commit
f8cec34862
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Ładowanie…
Reference in New Issue