Added a button to update the list of ports. Changed the colors of the lines on the charts. Added translations for qt libraries

This commit is contained in:
Yury Shuvakin
2022-08-28 20:01:40 +03:00
parent 545977a4b7
commit e31c509341
23 changed files with 155 additions and 13 deletions

View File

@@ -32,15 +32,31 @@ Dialog {
Layout.fillHeight: true
}
Label {
Controls.SubtitleLabel {
text: qsTr("Select serial port")
maximumLineCount: 2
wrapMode: Text.Wrap
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
}
Controls.ComboBox {
id: serialBox
model: BmsInterface.serialPortNames()
RowLayout {
spacing: 15
Controls.ComboBox {
id: serialBox
model: BmsInterface.serialPortNames()
Layout.fillWidth: true
}
Controls.OutlineImageButton {
id: refreshButton
icon.source: "qrc:/Icons/refresh.svg"
icon.width: 30
icon.height: 30
onClicked: serialBox.model = BmsInterface.serialPortNames()
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
}
@@ -81,6 +97,7 @@ Dialog {
onPortConnectedChanged: {
connectButton.text = Qt.binding(function() { return BmsInterface.isPortConnected() ? qsTr("Disconnect") : qsTr("Connect") })
serialBox.enabled = !BmsInterface.isPortConnected()
refreshButton.enabled = !BmsInterface.isPortConnected()
}
}
}