mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Feat/node notes (#3014)
This commit is contained in:
parent
363764c5ce
commit
f2680d37ad
9 changed files with 889 additions and 107 deletions
|
|
@ -52,6 +52,7 @@ data class Node(
|
|||
val powerMetrics: PowerMetrics = PowerMetrics.getDefaultInstance(),
|
||||
val paxcounter: PaxcountProtos.Paxcount = PaxcountProtos.Paxcount.getDefaultInstance(),
|
||||
val publicKey: ByteString? = null,
|
||||
val notes: String = "",
|
||||
) {
|
||||
val colors: Pair<Int, Int>
|
||||
get() { // returns foreground and background @ColorInt for each 'num'
|
||||
|
|
|
|||
|
|
@ -762,6 +762,16 @@ constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun setNodeNotes(nodeNum: Int, notes: String) = viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
nodeDB.setNodeNotes(nodeNum, notes)
|
||||
} catch (ex: java.io.IOException) {
|
||||
errormsg("Set node notes IO error: ${ex.message}")
|
||||
} catch (ex: java.sql.SQLException) {
|
||||
errormsg("Set node notes SQL error: ${ex.message}")
|
||||
}
|
||||
}
|
||||
|
||||
// managed mode disables all access to configuration
|
||||
val isManaged: Boolean
|
||||
get() = config.device.isManaged || config.security.isManaged
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue