Code Review
/
apps
/
hvac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
update translation on language changed
[apps/hvac.git]
/
app
/
HVAC.qml
diff --git
a/app/HVAC.qml
b/app/HVAC.qml
index
f5cd76b
..
b1925dd
100644
(file)
--- a/
app/HVAC.qml
+++ b/
app/HVAC.qml
@@
-18,15
+18,22
@@
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import AGL.Demo.Controls 1.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import AGL.Demo.Controls 1.0
+import Translator 1.0
import 'api' as API
ApplicationWindow {
id: root
import 'api' as API
ApplicationWindow {
id: root
+ Translator {
+ id: translator
+ language: binding.language
+ }
+
API.Binding {
id: binding
url: bindingAddress
onFanSpeedChanged: fanSpeedSlider.value = fanSpeed
API.Binding {
id: binding
url: bindingAddress
onFanSpeedChanged: fanSpeedSlider.value = fanSpeed
+ onLanguageChanged: translator.language = language
}
ColumnLayout {
}
ColumnLayout {
@@
-46,6
+53,9
@@
ApplicationWindow {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
+ from: 0.0
+ to: 255.0
+ stepSize: 1.0
onValueChanged: {
binding.fanSpeed = value
}
onValueChanged: {
binding.fanSpeed = value
}
@@
-54,7
+64,7
@@
ApplicationWindow {
anchors.left: fanSpeedSlider.left
anchors.top: fanSpeedSlider.bottom
font.pixelSize: 32
anchors.left: fanSpeedSlider.left
anchors.top: fanSpeedSlider.bottom
font.pixelSize: 32
- text:
'FAN SPEED'
+ text:
translator.translate(qsTr('FAN SPEED'), translator.language)
}
}
}
}
}
}
@@
-71,7
+81,10
@@
ApplicationWindow {
side: 'Left'
}
HeatDegree {
side: 'Left'
}
HeatDegree {
- enabled: leftSeat.headLevel > 0
+ onCurrentItemChanged: {
+ console.log("Left Temp changed",degree)
+ binding.leftTemperature = degree
+ }
}
}
ColumnLayout {
}
}
ColumnLayout {
@@
-82,8
+95,8
@@
ApplicationWindow {
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
- color: parent.checked ? '#
66FF99
' : '#848286'
- text:
'A/C'
+ color: parent.checked ? '#
00ADDC
' : '#848286'
+ text:
translator.translate(qsTr('A/C'), translator.language)
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
@@
-95,8
+108,8
@@
ApplicationWindow {
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
- color: parent.checked ? '#
66FF99
' : '#848286'
- text:
'AUTO'
+ color: parent.checked ? '#
00ADDC
' : '#848286'
+ text:
translator.translate(qsTr('AUTO'), translator.language)
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
@@
-120,7
+133,10
@@
ApplicationWindow {
side: 'Right'
}
HeatDegree {
side: 'Right'
}
HeatDegree {
- enabled: rightSeat.headLevel > 0
+ onCurrentItemChanged: {
+ console.log("Right Temp changed",degree)
+ binding.rightTemperature = degree
+ }
}
}
}
}
}
}