2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 import QtQuick.Layouts 1.1
31 application: 'home@0.1'
36 application: 'mediaplayer@0.1'
41 application: 'hvac@0.1'
46 application: 'navigation@0.1'
50 function languageChanged(lang) {
52 applicationModel.setProperty(0, "label", 'ACCEUIL')
54 applicationModel.setProperty(2, "label", 'MULTIMÉDIA')
55 applicationModel.setProperty(2, "name", 'Multimedia')
56 applicationModel.setProperty(2, "application", 'mediaplayer@0.1')
58 applicationModel.setProperty(3, "label", 'CLIMATISATION')
59 applicationModel.setProperty(3, "name", 'HVAC')
60 applicationModel.setProperty(3, "application", 'hvac@0.1')
62 applicationModel.setProperty(1, "label", 'NAVIGATION')
63 applicationModel.setProperty(1, "name", 'Navigation')
64 applicationModel.setProperty(1, "application", 'navigation@0.1')
66 applicationModel.setProperty(0, "label", 'HOME')
68 applicationModel.setProperty(1, "label", 'MULTIMEDIA')
69 applicationModel.setProperty(1, "name", 'Multimedia')
70 applicationModel.setProperty(1, "application", 'mediaplayer@0.1')
72 applicationModel.setProperty(2, "label", 'HVAC')
73 applicationModel.setProperty(2, "name", 'HVAC')
74 applicationModel.setProperty(2, "application", 'hvac@0.1')
76 applicationModel.setProperty(3, "label", 'NAVIGATION')
77 applicationModel.setProperty(3, "name", 'Navigation')
78 applicationModel.setProperty(3, "application", 'navigation@0.1')
81 property int currentIndex: -1 // TODO: to be moved to whereever right
88 model: applicationModel
89 delegate: ShortcutIcon {
90 Layout.fillWidth: true
91 Layout.fillHeight: true
93 active: model.index === root.currentIndex
95 root.currentIndex = active ? -1 : model.index
96 if (0 === model.index) {
97 appLauncherAreaLauncher.visible = true
98 applicationArea.visible = false
99 layoutHandler.hideAppLayer()
102 pid = launcher.launch(model.application)
104 applicationArea.visible = true
105 appLauncherAreaLauncher.visible = false
106 layoutHandler.makeMeVisible(pid)
107 layoutHandler.showAppLayer(pid)
110 console.warn("app cannot be launched!")
117 Component.onCompleted: {
118 root.currentIndex = 0
119 appLauncherAreaLauncher.visible = true
120 applicationArea.visible = false
121 layoutHandler.hideAppLayer()