kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix proto name change
rodzic
942469bbc9
commit
5a6b5a7202
|
@ -18,6 +18,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import com.geeksville.mesh.ConfigProtos
|
import com.geeksville.mesh.ConfigProtos
|
||||||
|
import com.geeksville.mesh.ConfigProtos.Config.NetworkConfig
|
||||||
import com.geeksville.mesh.R
|
import com.geeksville.mesh.R
|
||||||
import com.geeksville.mesh.copy
|
import com.geeksville.mesh.copy
|
||||||
import com.geeksville.mesh.model.UIViewModel
|
import com.geeksville.mesh.model.UIViewModel
|
||||||
|
@ -466,11 +467,11 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
item {
|
item {
|
||||||
DropDownPreference(title = "Ethernet mode",
|
DropDownPreference(title = "Ethernet mode",
|
||||||
enabled = connected,
|
enabled = connected,
|
||||||
items = ConfigProtos.Config.NetworkConfig.EthMode.values()
|
items = NetworkConfig.AddressMode.values()
|
||||||
.filter { it != ConfigProtos.Config.NetworkConfig.EthMode.UNRECOGNIZED }
|
.filter { it != NetworkConfig.AddressMode.UNRECOGNIZED }
|
||||||
.map { it to it.name },
|
.map { it to it.name },
|
||||||
selectedItem = networkInput.ethMode,
|
selectedItem = networkInput.addressMode,
|
||||||
onItemSelected = { networkInput = networkInput.copy { ethMode = it } })
|
onItemSelected = { networkInput = networkInput.copy { addressMode = it } })
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
|
@ -479,7 +480,7 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "IP",
|
EditTextPreference(title = "IP",
|
||||||
value = networkInput.ipv4Config.ip,
|
value = networkInput.ipv4Config.ip,
|
||||||
enabled = connected && networkInput.ethMode == ConfigProtos.Config.NetworkConfig.EthMode.STATIC,
|
enabled = connected && networkInput.addressMode == NetworkConfig.AddressMode.STATIC,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = {
|
onValueChanged = {
|
||||||
val ipv4 = networkInput.ipv4Config.copy { ip = it }
|
val ipv4 = networkInput.ipv4Config.copy { ip = it }
|
||||||
|
@ -490,7 +491,7 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "Gateway",
|
EditTextPreference(title = "Gateway",
|
||||||
value = networkInput.ipv4Config.gateway,
|
value = networkInput.ipv4Config.gateway,
|
||||||
enabled = connected && networkInput.ethMode == ConfigProtos.Config.NetworkConfig.EthMode.STATIC,
|
enabled = connected && networkInput.addressMode == NetworkConfig.AddressMode.STATIC,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = {
|
onValueChanged = {
|
||||||
val ipv4 = networkInput.ipv4Config.copy { gateway = it }
|
val ipv4 = networkInput.ipv4Config.copy { gateway = it }
|
||||||
|
@ -501,7 +502,7 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "Subnet",
|
EditTextPreference(title = "Subnet",
|
||||||
value = networkInput.ipv4Config.subnet,
|
value = networkInput.ipv4Config.subnet,
|
||||||
enabled = connected && networkInput.ethMode == ConfigProtos.Config.NetworkConfig.EthMode.STATIC,
|
enabled = connected && networkInput.addressMode == NetworkConfig.AddressMode.STATIC,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = {
|
onValueChanged = {
|
||||||
val ipv4 = networkInput.ipv4Config.copy { subnet = it }
|
val ipv4 = networkInput.ipv4Config.copy { subnet = it }
|
||||||
|
@ -512,7 +513,7 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "DNS",
|
EditTextPreference(title = "DNS",
|
||||||
value = networkInput.ipv4Config.dns,
|
value = networkInput.ipv4Config.dns,
|
||||||
enabled = connected && networkInput.ethMode == ConfigProtos.Config.NetworkConfig.EthMode.STATIC,
|
enabled = connected && networkInput.addressMode == NetworkConfig.AddressMode.STATIC,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = {
|
onValueChanged = {
|
||||||
val ipv4 = networkInput.ipv4Config.copy { dns = it }
|
val ipv4 = networkInput.ipv4Config.copy { dns = it }
|
||||||
|
|
Ładowanie…
Reference in New Issue