Added reading default network settings

This commit is contained in:
Yury Shuvakin
2022-11-25 05:39:37 +03:00
parent c231735900
commit eb89c386a3
9 changed files with 128 additions and 78 deletions

View File

@@ -167,21 +167,30 @@ ColumnLayout {
Layout.fillWidth: true
}
Controls.Button {
text: qsTr("Apply")
onClicked: {
if (!BmsInterface.isPortConnected())
return
RowLayout {
spacing: 20
var settings = [
firstUrlField.text,
secondUrlField.text,
apnField.text,
userField.text,
passwordField.text,
]
Controls.OutlineButton {
text: qsTr("Default")
onClicked: BmsInterface.commands().getNetDefaultSettings()
}
BmsInterface.commands().setNetSettings(settings)
Controls.Button {
text: qsTr("Apply")
onClicked: {
if (!BmsInterface.isPortConnected())
return
var settings = [
firstUrlField.text,
secondUrlField.text,
apnField.text,
userField.text,
passwordField.text,
]
BmsInterface.commands().setNetSettings(settings)
}
}
}

View File

@@ -212,6 +212,7 @@ ColumnLayout {
const localTimestamp = (Math.round(date / 1000) - date.getTimezoneOffset() * 60).toString(16)
BmsInterface.commands().sendTerminalCmd("setUnixTime " + localTimestamp)
Qt.callLater(BmsInterface.emitStatusMessage, qsTr("Time settings applied successfully"), true)
}
}
}