aboutsummaryrefslogtreecommitdiffstats
path: root/HomeScreen/qml/Home.qml
diff options
context:
space:
mode:
authorPhilippe Lelong <lelong.ph@meltemus.com>2016-12-20 14:40:06 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-12-20 16:02:47 +0100
commit8f71f12c3622466f813ea12b64ee34e8b4102341 (patch)
tree33243aec0f49393989b6512a2272536db72eb8d8 /HomeScreen/qml/Home.qml
parent3b90fc6e1d569d568d4158aae700b077e2ad824b (diff)
Add user autorisations information
Signed-off-by: Philippe Lelong <lelong.ph@meltemus.com>
Diffstat (limited to 'HomeScreen/qml/Home.qml')
-rw-r--r--HomeScreen/qml/Home.qml63
1 files changed, 63 insertions, 0 deletions
diff --git a/HomeScreen/qml/Home.qml b/HomeScreen/qml/Home.qml
index ed0d949..c44919d 100644
--- a/HomeScreen/qml/Home.qml
+++ b/HomeScreen/qml/Home.qml
@@ -18,6 +18,8 @@
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.0
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import Home 1.0
Item {
@@ -128,6 +130,19 @@ Item {
function changeFlag(flagImage) {
flagLanguage.source = flagImage
}
+ function setUser(type, auts) {
+ if(type === '') {
+ authorisations.visible = false
+ } else {
+ authorisations.visible = true
+ labelUserType.text = type
+ myModel.clear()
+ for (var i=0; i<auts.length; i++) {
+ if(auts[i] !== '')
+ myModel.append({"name": auts[i]})
+ }
+ }
+ }
GridView {
anchors.centerIn: parent
@@ -179,6 +194,54 @@ Item {
}
}
}
+ ListModel {
+ id: myModel
+ ListElement {
+ name: 'Install App'
+ }
+ ListElement {
+ name: 'Open Trunk'
+ }
+ ListElement {
+ name: 'Update Software'
+ }
+ ListElement {
+ name: 'View Online'
+ }
+ }
+ Item {
+ id: authorisations
+ anchors.fill: parent
+ visible: false
+ GridLayout {
+ id: gridAut
+ columns: 2
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.bottomMargin: 50
+ anchors.leftMargin: 20
+ Repeater {
+ model: myModel
+ Image {
+ source: './images/' + model.name + '.png'
+ width: sourceSize.width
+ height: sourceSize.height
+ visible: true
+ }
+ }
+ }
+ Label {
+ id: labelUserType
+ anchors.bottom: gridAut.top
+ anchors.bottomMargin: 10
+ anchors.left: gridAut.left
+ color: "white"
+ text: "Owner"
+ font.pixelSize: 30
+ font.family: "Roboto"
+ }
+ }
+
Image {
id: logout
width: sourceSize.width