Merge branch 'meshtastic:master' into feature/osmand-migration

This commit is contained in:
PWRxPSYCHO 2022-08-25 20:16:31 +00:00 committed by GitHub
commit 684bd82772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 51 additions and 33 deletions

View file

@ -115,6 +115,7 @@ class AdvancedSettingsFragment : ScreenFragment("Advanced Settings"), Logging {
.setNeutralButton(R.string.cancel) { _, _ ->
}
.setPositiveButton(getString(R.string.okay)) { _, _ ->
debug("User clicked requestShutdown")
model.requestShutdown()
}
.show()
@ -126,6 +127,7 @@ class AdvancedSettingsFragment : ScreenFragment("Advanced Settings"), Logging {
.setNeutralButton(R.string.cancel) { _, _ ->
}
.setPositiveButton(getString(R.string.okay)) { _, _ ->
debug("User clicked requestReboot")
model.requestReboot()
}
.show()

View file

@ -281,7 +281,17 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
}
model.localConfig.observe(viewLifecycleOwner) {
updateNodeInfo()
if (!model.isConnected()) {
val configCount = it.allFields.size
binding.scanStatusText.text = "Device config ($configCount / 7)"
} else updateNodeInfo()
}
model.channels.observe(viewLifecycleOwner) {
if (!model.isConnected()) {
val channelCount = it?.protobuf?.settingsCount ?: 0
binding.scanStatusText.text = "Channels ($channelCount / 8)"
}
}
// Also watch myNodeInfo because it might change later