2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 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
27 property date now: new Date
29 interval: 100; running: true; repeat: true;
30 onTriggered: root.now = new Date
38 onTriggered: notificationItem.visible = false
47 if (condition.indexOf("clouds") !== -1) {
48 icon = "WeatherIcons_Cloudy-01.png"
49 } else if (condition.indexOf("thunderstorm") !== -1) {
50 icon = "WeatherIcons_Thunderstorm-01.png"
51 } else if (condition.indexOf("snow") !== -1) {
52 icon = "WeatherIcons_Snow-01.png"
53 } else if (condition.indexOf("rain") !== -1) {
54 icon = "WeatherIcons_Rain-01.png"
57 condition_item.source = icon ? './images/Weather/' + icon : ''
60 onTemperatureChanged: {
61 temperature_item.text = temperature.split(".")[0] + '°F'
70 Layout.fillWidth: true
71 Layout.fillHeight: true
72 Layout.preferredWidth: 120
77 Layout.preferredWidth: 50
78 Layout.preferredHeight: 50
79 source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png'
80 fillMode: Image.PreserveAspectFit
81 property string deviceName: "none"
82 property bool connStatus: false
86 console.log("onConnectionEvent", data.Status)
87 if (data.Status === "connected") {
88 bt_icon.connStatus = true
89 } else if (data.Status === "disconnected") {
90 bt_icon.connStatus = false
93 onDeviceUpdateEvent: {
94 console.log("onConnectionEvent", data.Paired)
95 if (data.Paired === "True" && data.Connected === "True") {
96 bt_icon.deviceName = data.name
97 bt_icon.connStatus = true
99 if(bt_icon.deviceName === data.Name)
101 bt_icon.connStatus = false
109 model: StatusBarModel { objectName: "statusBar" }
111 Layout.preferredWidth: 50
112 Layout.preferredHeight: 50
113 source: model.modelData
114 fillMode: Image.PreserveAspectFit
119 anchors.left: icons.right
120 Layout.fillHeight: true
127 Layout.fillWidth: true
128 Layout.fillHeight: true
129 text: Qt.formatDate(now, 'dddd').toUpperCase()
130 font.family: 'Roboto'
133 horizontalAlignment: Text.AlignHCenter
134 verticalAlignment: Text.AlignVCenter
137 Layout.fillWidth: true
138 Layout.fillHeight: true
139 text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
140 font.family: 'Roboto'
143 horizontalAlignment: Text.AlignHCenter
144 verticalAlignment: Text.AlignVCenter
149 Layout.fillWidth: true
150 Layout.fillHeight: true
151 Layout.preferredHeight: 20
155 source: './images/Weather/WeatherIcons_Rain-01.png'
161 font.family: 'Helvetica'
179 height: parent.height
186 anchors.left: parent.left
187 anchors.leftMargin: 20
188 anchors.verticalCenter: parent.verticalCenter
195 anchors.left: notificationIcon.right
196 anchors.leftMargin: 5
197 anchors.verticalCenter: parent.verticalCenter
205 target: homescreenHandler
207 notificationIcon.source = './images/Shortcut/%1.svg'.arg(id)
208 notificationtext.text = text
209 notificationItem.visible = true
210 notificationTimer.restart()