aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Lelong <lelong.ph@meltemus.com>2016-12-14 11:58:20 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-12-16 09:08:31 +0100
commitdd7bb40b885efbde6ca7121194403857ef263208 (patch)
tree137b2ef02b0775090fa81b7ca426299f6be6bfae
parenta8414c772521b330d950dedc7f5b25f8ebff6e23 (diff)
Home screen translation changes
Signed-off-by: Philippe Lelong <lelong.ph@meltemus.com>
-rw-r--r--HomeScreen/HomeScreen.pro6
-rw-r--r--HomeScreen/qml/Home.qml70
-rw-r--r--HomeScreen/qml/ShortcutArea.qml18
-rw-r--r--HomeScreen/qml/ShortcutIcon.qml11
-rw-r--r--HomeScreen/qml/StatusArea.qml62
-rw-r--r--HomeScreen/qml/TopArea.qml2
-rwxr-xr-xHomeScreen/qml/images/Home/B14-90.pngbin0 -> 32719 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Active-01.pngbin34136 -> 29960 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Inactive-01.pngbin26878 -> 24092 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Active-01.pngbin32014 -> 27843 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Inactive-01.pngbin25298 -> 22518 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Active-01.pngbin31650 -> 28618 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Inactive-01.pngbin24398 -> 22444 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Active-01.pngbin29605 -> 25868 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Inactive-01.pngbin23307 -> 20765 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Active-01.pngbin38244 -> 34333 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Inactive-01.pngbin33027 -> 29913 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Active-01.pngbin33356 -> 28719 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Inactive-01.pngbin26924 -> 23904 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Active-01.pngbin30830 -> 27829 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Inactive-01.pngbin23978 -> 22063 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Active-01.pngbin29028 -> 25877 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Inactive-01.pngbin21186 -> 19474 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Active-01.pngbin33558 -> 29989 bytes
-rw-r--r--HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Inactive-01.pngbin26571 -> 24202 bytes
-rw-r--r--HomeScreen/qml/images/Home/home.qrc1
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.pngbin4108 -> 3501 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.pngbin5908 -> 4861 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.pngbin3435 -> 2757 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.pngbin4924 -> 3875 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.pngbin4114 -> 3263 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.pngbin5973 -> 4306 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.pngbin7122 -> 6105 bytes
-rw-r--r--HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.pngbin9799 -> 7804 bytes
-rw-r--r--HomeScreen/qml/main.qml3
-rw-r--r--HomeScreen/src/main.cpp8
-rw-r--r--HomeScreen/src2/appinfo.cpp4
-rw-r--r--HomeScreen/src2/appinfo.h1
-rw-r--r--HomeScreen/src2/applicationmodel.cpp25
-rw-r--r--HomeScreen/src2/applicationmodel.h2
-rw-r--r--HomeScreen/src2/usermanagement.cpp34
-rw-r--r--HomeScreen/src2/usermanagement.h26
42 files changed, 264 insertions, 9 deletions
diff --git a/HomeScreen/HomeScreen.pro b/HomeScreen/HomeScreen.pro
index b2afdd3..ac4f2d2 100644
--- a/HomeScreen/HomeScreen.pro
+++ b/HomeScreen/HomeScreen.pro
@@ -23,11 +23,13 @@ include(../ivi_layermanagement_api.pri)
SOURCES += \
src/main.cpp \
src/homescreencontrolinterface.cpp \
- src/layouthandler.cpp
+ src/layouthandler.cpp \
+ src2/usermanagement.cpp
HEADERS += \
src/homescreencontrolinterface.h \
- src/layouthandler.h
+ src/layouthandler.h \
+ src2/usermanagement.h
OTHER_FILES += \
README.md
diff --git a/HomeScreen/qml/Home.qml b/HomeScreen/qml/Home.qml
index 301fdbd..c4951fe 100644
--- a/HomeScreen/qml/Home.qml
+++ b/HomeScreen/qml/Home.qml
@@ -22,6 +22,8 @@ import Home 1.0
Item {
id: root
+ property int pid: -1
+ signal languageChanged
Image {
anchors.fill: parent
@@ -29,8 +31,58 @@ Item {
anchors.bottomMargin: -215
source: './images/AGL_HMI_Background_Car-01.png'
}
+ Image {
+ id: sign90
+ width: 200
+ height: 200
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 20
+ source: './images/B14-90.png'
+ visible: false
+ }
+ Item {
+ id: hello
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 40
+ visible: false
+ Text {
+ id: helloText
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello José!"
+ font.pixelSize: 40
+ font.family: "Roboto"
+ SequentialAnimation on font.letterSpacing {
+ id: animation1
+ loops: 1;
+ NumberAnimation { from: 0; to: 50; easing.type: Easing.InQuad; duration: 3000 }
+ onRunningChanged: {
+ if(running)
+ hello.visible = true
+ else
+ hello.visible = false
+ }
+ }
- property int pid: -1
+ SequentialAnimation on opacity {
+ id: animation2
+ loops: 1;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+ function showHello(helloString) {
+ helloText.text = helloString
+ animation1.running = true;
+ animation2.running = true;
+ }
+
+ function showSign90(show) {
+ sign90.visible = show
+ }
GridView {
anchors.centerIn: parent
@@ -46,6 +98,22 @@ Item {
Image {
anchors.fill: parent
source: './images/HMI_AppLauncher_%1_%2-01.png'.arg(model.icon).arg(pressed ? 'Active' : 'Inactive')
+ Label {
+ id: labelName
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ y: 257
+ font.pixelSize: 32
+ font.family: "Roboto"
+ color: "white"
+ text: '%1'.arg(model.name)
+ function myChangeLanguage() {
+ text = '%1'.arg(model.name)
+ }
+ Component.onCompleted: {
+ root.languageChanged.connect(myChangeLanguage)
+ }
+ }
}
onClicked: {
console.log("app is ", model.id)
diff --git a/HomeScreen/qml/ShortcutArea.qml b/HomeScreen/qml/ShortcutArea.qml
index 9e71a94..6684982 100644
--- a/HomeScreen/qml/ShortcutArea.qml
+++ b/HomeScreen/qml/ShortcutArea.qml
@@ -29,21 +29,37 @@ Item {
ListElement {
name: 'Home'
application: 'home@0.1'
+ label: 'HOME'
}
ListElement {
name: 'Multimedia'
application: 'mediaplayer@0.1'
+ label: 'MULTIMEDIA'
}
ListElement {
name: 'HVAC'
application: 'hvac@0.1'
+ label: 'HVAC'
}
ListElement {
name: 'Navigation'
application: 'navigation@0.1'
+ label: 'NAVIGATION'
+ }
+ }
+ function languageChanged(lang) {
+ if(lang === "fr") {
+ applicationModel.setProperty(0, "label", 'ACCEUIL')
+ applicationModel.setProperty(1, "label", 'MULTIMÉDIA')
+ applicationModel.setProperty(2, "label", 'CLIMATISATION')
+ applicationModel.setProperty(3, "label", 'NAVIGATION')
+ } else {
+ applicationModel.setProperty(0, "label", 'HOME')
+ applicationModel.setProperty(1, "label", 'MULTIMEDIA')
+ applicationModel.setProperty(2, "label", 'HVAC')
+ applicationModel.setProperty(3, "label", 'NAVIGATION')
}
}
-
property int currentIndex: -1 // TODO: to be moved to whereever right
property int pid: -1
diff --git a/HomeScreen/qml/ShortcutIcon.qml b/HomeScreen/qml/ShortcutIcon.qml
index 299f6a8..34ade01 100644
--- a/HomeScreen/qml/ShortcutIcon.qml
+++ b/HomeScreen/qml/ShortcutIcon.qml
@@ -16,6 +16,7 @@
*/
import QtQuick 2.2
+import QtQuick.Controls 1.0
MouseArea {
id: root
@@ -33,6 +34,16 @@ MouseArea {
source: './images/Shortcut/HMI_Shortcut_%1_Active-01.png'.arg(root.name)
opacity: 1.0 - icon.opacity
}
+ Label {
+ id: labelName
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ y: 155
+ font.pixelSize: 20
+ font.family: "Roboto"
+ color: "white"
+ text: '%1'.arg(model.label)
+ }
states: [
State {
when: root.active
diff --git a/HomeScreen/qml/StatusArea.qml b/HomeScreen/qml/StatusArea.qml
index 4ed969d..25c66d7 100644
--- a/HomeScreen/qml/StatusArea.qml
+++ b/HomeScreen/qml/StatusArea.qml
@@ -24,6 +24,62 @@ Item {
id: root
width: 295
height: 218
+ function languageChanged(lang) {
+ if(lang === "fr") {
+ labelTime.text = Qt.formatTime(now, 'HH:mm').toUpperCase()
+ labelTemperature.text = '18°C'
+ switch(now.getDay()) {
+ case 1:
+ labelDay.text = 'LUNDI'
+ break
+ case 2:
+ labelDay.text = 'MARDI'
+ break
+ case 3:
+ labelDay.text = 'MERCREDI'
+ break
+ case 4:
+ labelDay.text = 'JEUDI'
+ break
+ case 5:
+ labelDay.text = 'VENDREDI'
+ break
+ case 6:
+ labelDay.text = 'SAMEDI'
+ break
+ case 7:
+ labelDay.text = 'DIMANCHE'
+ break
+ }
+
+ } else {
+ labelTime.text = Qt.formatTime(now, 'h:mm ap').toUpperCase()
+ labelTemperature.text = '64°F'
+ switch(now.getDay()) {
+ case 1:
+ labelDay.text = 'MONDAY'
+ break
+ case 2:
+ labelDay.text = 'TUESDAY'
+ break
+ case 3:
+ labelDay.text = 'WEDNESDAY'
+ break
+ case 4:
+ labelDay.text = 'THURSDAY'
+ break
+ case 5:
+ labelDay.text = 'FRIDAY'
+ break
+ case 6:
+ labelDay.text = 'SATURDAY'
+ break
+ case 7:
+ labelDay.text = 'SUNDAY'
+ break
+ }
+ }
+ }
property date now: new Date
Timer {
@@ -43,11 +99,13 @@ Item {
anchors.margins: 40
spacing: 0
Label {
+ id: labelDay
Layout.fillWidth: true
Layout.fillHeight: true
text: Qt.formatDate(now, 'dddd').toUpperCase()
font.family: 'Roboto'
- font.pixelSize: 13
+// font.pixelSize: 13
+ font.pixelSize: 18
color: 'white'
verticalAlignment: Text.AlignVCenter
// Rectangle {
@@ -60,6 +118,7 @@ Item {
// }
}
Label {
+ id: labelTime
Layout.fillWidth: true
Layout.fillHeight: true
text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
@@ -77,6 +136,7 @@ Item {
source: './images/Weather/WeatherIcons_Rain-01.png'
}
Label {
+ id: labelTemperature
text: '64°F'
color: 'white'
font.family: 'Helvetica'
diff --git a/HomeScreen/qml/TopArea.qml b/HomeScreen/qml/TopArea.qml
index fdf5a13..76430e2 100644
--- a/HomeScreen/qml/TopArea.qml
+++ b/HomeScreen/qml/TopArea.qml
@@ -29,12 +29,14 @@ Image {
spacing: 0
ShortcutArea {
id: shortcutArea
+ objectName: "ShortcutArea"
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredWidth: 785
}
StatusArea {
id: statusArea
+ objectName: "StatusArea"
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredWidth: 295
diff --git a/HomeScreen/qml/images/Home/B14-90.png b/HomeScreen/qml/images/Home/B14-90.png
new file mode 100755
index 0000000..702f8c6
--- /dev/null
+++ b/HomeScreen/qml/images/Home/B14-90.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Active-01.png
index 888d0bd..b37a2d9 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Inactive-01.png
index ab83b0e..c4b12a9 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Connectivity_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Active-01.png
index 11d39e5..d1fba09 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Inactive-01.png
index 6c0b914..138ebf7 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Dashboard_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Active-01.png
index efc11e9..deeb402 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Inactive-01.png
index b528376..92cd8a8 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_HVAC_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Active-01.png
index 1c99ac4..c1af827 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Inactive-01.png
index 0bed61d..9a9c96a 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Multimedia_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Active-01.png
index e7ad085..e5bae8b 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Inactive-01.png
index dd40750..cc9cb1a 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Navigation_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Active-01.png
index 2df01d3..c52d5bb 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Inactive-01.png
index ec62b87..d55e5fb 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_POI_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Active-01.png
index 2150581..7a079e2 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Inactive-01.png
index 61dcedc..0de908b 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Phone_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Active-01.png
index 1aa5a01..8503ae2 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Inactive-01.png
index 616983e..f8693c9 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Radio_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Active-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Active-01.png
index 1d13fd6..ff030ef 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Active-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Inactive-01.png b/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Inactive-01.png
index 027f1fe..15bdeb8 100644
--- a/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Inactive-01.png
+++ b/HomeScreen/qml/images/Home/HMI_AppLauncher_Settings_Inactive-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Home/home.qrc b/HomeScreen/qml/images/Home/home.qrc
index 7dde212..4a112ce 100644
--- a/HomeScreen/qml/images/Home/home.qrc
+++ b/HomeScreen/qml/images/Home/home.qrc
@@ -19,5 +19,6 @@
<file>HMI_AppLauncher_Radio_Inactive-01.png</file>
<file>HMI_AppLauncher_Settings_Active-01.png</file>
<file>HMI_AppLauncher_Settings_Inactive-01.png</file>
+ <file>B14-90.png</file>
</qresource>
</RCC>
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png
index f5188f5..221fe60 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png
index abe92d2..cbd625a 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png
index 9aca151..3685d4a 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png
index 696168f..4c64670 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png
index 229860c..797d893 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png
index b0a023c..3d831bf 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png
index 34b0671..a58534c 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png
Binary files differ
diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png
index 98e6146..99fbc23 100644
--- a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png
+++ b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png
Binary files differ
diff --git a/HomeScreen/qml/main.qml b/HomeScreen/qml/main.qml
index 6a515fc..c97702d 100644
--- a/HomeScreen/qml/main.qml
+++ b/HomeScreen/qml/main.qml
@@ -36,7 +36,7 @@ Window {
anchors.centerIn: parent
width: 1080
height: 1920
- scale: 1.0
+ scale: 1
source: './images/AGL_HMI_Background_NoCar-01.png'
ColumnLayout {
@@ -59,6 +59,7 @@ Window {
Home {
id: appLauncherAreaLauncher
+ objectName: "Home"
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 1920 - 218 - 215
diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp
index dcad4c6..4d21394 100644
--- a/HomeScreen/src/main.cpp
+++ b/HomeScreen/src/main.cpp
@@ -25,6 +25,7 @@
#include "../src2/applicationlauncher.h"
#include "../src2/statusbarmodel.h"
#include "../src2/applicationmodel.h"
+#include "../src2/usermanagement.h"
int main(int argc, char *argv[])
{
@@ -46,7 +47,6 @@ int main(int argc, char *argv[])
qmlRegisterType<StatusBarModel>("HomeScreen", 1, 0, "StatusBarModel");
QQmlApplicationEngine engine;
-
LayoutHandler* layoutHandler = new LayoutHandler();
HomeScreenControlInterface* hsci = new HomeScreenControlInterface();
@@ -59,6 +59,10 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("layoutHandler", layoutHandler);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
-
+ QObject *home = engine.rootObjects().first()->findChild<QObject *>("Home");
+ QObject *shortcutArea = engine.rootObjects().first()->findChild<QObject *>("ShortcutArea");
+ QObject *statusArea = engine.rootObjects().first()->findChild<QObject *>("StatusArea");
+ UserManagement userManagement(home, shortcutArea, statusArea);
+ Q_UNUSED(userManagement);
return a.exec();
}
diff --git a/HomeScreen/src2/appinfo.cpp b/HomeScreen/src2/appinfo.cpp
index 6b61632..4792b52 100644
--- a/HomeScreen/src2/appinfo.cpp
+++ b/HomeScreen/src2/appinfo.cpp
@@ -108,6 +108,10 @@ QString AppInfo::name() const
{
return d->name;
}
+void AppInfo::setName(const QString &name)
+{
+ d->name = name;
+}
QString AppInfo::description() const
{
diff --git a/HomeScreen/src2/appinfo.h b/HomeScreen/src2/appinfo.h
index a800a80..a108d85 100644
--- a/HomeScreen/src2/appinfo.h
+++ b/HomeScreen/src2/appinfo.h
@@ -56,6 +56,7 @@ public:
friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo);
friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo);
+ void setName(const QString &name);
private:
class Private;
QSharedDataPointer<Private> d;
diff --git a/HomeScreen/src2/applicationmodel.cpp b/HomeScreen/src2/applicationmodel.cpp
index 2a16ace..136161a 100644
--- a/HomeScreen/src2/applicationmodel.cpp
+++ b/HomeScreen/src2/applicationmodel.cpp
@@ -52,11 +52,36 @@ ApplicationModel::Private::Private(ApplicationModel *parent)
data.append(AppInfo(QStringLiteral("POI"), QStringLiteral("POINT OF\nINTEREST"), QStringLiteral("poi@0.1")));
}
}
+void ApplicationModel::changeLanguage(const QString &lang)
+{ //todo: use QT translator instead of hardcoded strings.
+ if(lang == "fr") {
+ d->data[0].setName("CLIMATISATION");
+ d->data[1].setName("NAVIGATION");
+ d->data[2].setName("TÉLÉPHONE");
+ d->data[3].setName("RADIO");
+ d->data[4].setName("MULTIMÉDIA");
+ d->data[5].setName("CONNEXIONS");
+ d->data[6].setName("TABLEAU DE\nBORD");
+ d->data[7].setName("PARAMÈTRES");
+ d->data[8].setName("POINT D'INTÉRÊT");
+ } else {
+ d->data[0].setName("HVAC");
+ d->data[1].setName("NAVIGATION");
+ d->data[2].setName("PHONE");
+ d->data[3].setName("RADIO");
+ d->data[4].setName("MULTIMEDIA");
+ d->data[5].setName("CONNECTIVITY");
+ d->data[6].setName("DASHBOARD");
+ d->data[7].setName("SETTINGS");
+ d->data[8].setName("POINT OF\nINTEREST");
+ }
+}
ApplicationModel::ApplicationModel(QObject *parent)
: QAbstractListModel(parent)
, d(new Private(this))
{
+ setObjectName("ApplicationModel");
}
ApplicationModel::~ApplicationModel()
diff --git a/HomeScreen/src2/applicationmodel.h b/HomeScreen/src2/applicationmodel.h
index bffc4c9..40741bd 100644
--- a/HomeScreen/src2/applicationmodel.h
+++ b/HomeScreen/src2/applicationmodel.h
@@ -30,7 +30,7 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
-
+ void changeLanguage(const QString &lang);
private:
class Private;
Private *d;
diff --git a/HomeScreen/src2/usermanagement.cpp b/HomeScreen/src2/usermanagement.cpp
new file mode 100644
index 0000000..bbbbac1
--- /dev/null
+++ b/HomeScreen/src2/usermanagement.cpp
@@ -0,0 +1,34 @@
+#include "usermanagement.h"
+#include <QApplication>
+#include <QDebug>
+UserManagement::UserManagement(QObject *home, QObject *shortcutArea, QObject *statusArea) : QObject()
+{
+ this->home = home;
+ this->appModel = home->findChild<ApplicationModel *>("ApplicationModel");
+ this->shortcutArea = shortcutArea;
+ this->statusArea = statusArea;
+ this->currentLanguage = "en";
+ connect(&timerTest, SIGNAL(timeout()), this, SLOT(slot_timerTest()));
+ timerTest.setSingleShot(false);
+ timerTest.start(5000);
+}
+void UserManagement::slot_timerTest()
+{
+ if(currentLanguage == "fr")
+ currentLanguage = "en";
+ else
+ currentLanguage = "fr";
+ appModel->changeLanguage(currentLanguage);
+ QMetaObject::invokeMethod(home, "languageChanged");
+ QMetaObject::invokeMethod(shortcutArea, "languageChanged", Q_ARG(QVariant, currentLanguage));
+ QMetaObject::invokeMethod(statusArea, "languageChanged", Q_ARG(QVariant, currentLanguage));
+ if(currentLanguage == "fr") {
+ QLocale::setDefault(QLocale("fr_FR"));
+ QMetaObject::invokeMethod(home, "showSign90", Q_ARG(QVariant, true));
+ QMetaObject::invokeMethod(home, "showHello", Q_ARG(QVariant, "Bonjour José!"));
+ } else {
+ QLocale::setDefault(QLocale("en_US"));
+ QMetaObject::invokeMethod(home, "showSign90", Q_ARG(QVariant, false));
+ QMetaObject::invokeMethod(home, "showHello", Q_ARG(QVariant, "Hello José!"));
+ }
+}
diff --git a/HomeScreen/src2/usermanagement.h b/HomeScreen/src2/usermanagement.h
new file mode 100644
index 0000000..804df22
--- /dev/null
+++ b/HomeScreen/src2/usermanagement.h
@@ -0,0 +1,26 @@
+#ifndef USERMANAGEMENT_H
+#define USERMANAGEMENT_H
+
+#include <QObject>
+#include "applicationmodel.h"
+#include <QTimer>
+class UserManagement : public QObject
+{
+ Q_OBJECT
+public:
+ explicit UserManagement(QObject *home, QObject *shortcutArea, QObject *statusArea);
+
+signals:
+
+public slots:
+ void slot_timerTest();
+private:
+ QObject *home;
+ QObject *shortcutArea;
+ QObject *statusArea;
+ ApplicationModel *appModel;
+ QTimer timerTest;
+ QString currentLanguage;
+};
+
+#endif // USERMANAGEMENT_H