diff options
author | Bramastyo Harimukti <bramastyo.harimukti.santoso@pelagicore.com> | 2017-10-06 18:59:17 +0200 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2017-10-06 17:36:51 +0000 |
commit | 11dc1097830d8b122da62d2756c82bea1e2cfb8b (patch) | |
tree | 90852c3e958f14907d69e97d6c342edeb3a58c86 | |
parent | 6f5766d4626492e55f06b72de88948e1cf21cc6a (diff) | |
download | neptune-ui-11dc1097830d8b122da62d2756c82bea1e2cfb8b.tar.gz |
Add Notification simulation to Function page
Change-Id: Ib005dcefe6ba85772e60153ba815ad3526d2ff0b
Reviewed-by: Vladimir Minenko <vladimir.minenko@pelagicore.com>
-rw-r--r-- | imports/system/models/application/ApplicationManagerModel.qml | 2 | ||||
-rw-r--r-- | imports/system/models/notification/NotificationModel.qml | 2 | ||||
-rw-r--r-- | imports/system/models/popup/PopupModel.qml | 4 | ||||
-rw-r--r-- | sysui/display/Display.qml | 2 | ||||
-rw-r--r-- | sysui/display/FunctionsPage.qml | 39 | ||||
-rw-r--r-- | sysui/notification/NotificationCenter.qml | 1 | ||||
-rw-r--r-- | sysui/notification/NotificationCenterItem.qml | 2 |
7 files changed, 42 insertions, 10 deletions
diff --git a/imports/system/models/application/ApplicationManagerModel.qml b/imports/system/models/application/ApplicationManagerModel.qml index e45a5d1..2bd262d 100644 --- a/imports/system/models/application/ApplicationManagerModel.qml +++ b/imports/system/models/application/ApplicationManagerModel.qml @@ -53,7 +53,7 @@ QtObject { // Cluster signals signal clusterWidgetReady(string category, Item item) - property var logggingCategory: LoggingCategory { + property var loggingCategory: LoggingCategory { id: logCategory name: "neptune.applicationmanagermodel" } diff --git a/imports/system/models/notification/NotificationModel.qml b/imports/system/models/notification/NotificationModel.qml index b8cba5c..783d476 100644 --- a/imports/system/models/notification/NotificationModel.qml +++ b/imports/system/models/notification/NotificationModel.qml @@ -51,7 +51,7 @@ QtObject { property var notificationQueue:[] property var buttonModel: [] - property var logggingCategory: LoggingCategory { + property var loggingCategory: LoggingCategory { id: logCategory name: "neptune.notificationmodel" } diff --git a/imports/system/models/popup/PopupModel.qml b/imports/system/models/popup/PopupModel.qml index 35e2045..3f3c7fd 100644 --- a/imports/system/models/popup/PopupModel.qml +++ b/imports/system/models/popup/PopupModel.qml @@ -53,7 +53,7 @@ QtObject { property var popupContentData property var popupButtonData - property var logggingCategory: LoggingCategory { + property var loggingCategory: LoggingCategory { id: logCategory name: "neptune.popupmodel" } @@ -139,7 +139,7 @@ QtObject { } function buttonPressed(buttonIndex) { - NotificationManager.triggerNotificationAction(root.popupIndex, root.buttonModel[buttonIndex]); + NotificationManager.triggerNotificationAction(root.popupIndex, buttonIndex); NotificationManager.dismissNotification(root.popupIndex); root.hideCurrentPopup(); if (root.popupQueue.length > 0) { diff --git a/sysui/display/Display.qml b/sysui/display/Display.qml index b3b8d11..a1c1ccd 100644 --- a/sysui/display/Display.qml +++ b/sysui/display/Display.qml @@ -147,7 +147,7 @@ Item { StageLoader { id: notificationCenterLoader - width: Style.isPotrait ? Style.hspan(Style.notificationCenterSpan + 5) : Style.hspan(Style.notificationCenterSpan) + width: Style.isPotrait ? Style.hspan(Style.notificationCenterSpan + 5) : Style.hspan(12) height: Style.screenHeight - Style.statusBarHeight anchors.top: statusBar.bottom active: StagedStartupModel.loadBackgroundElements diff --git a/sysui/display/FunctionsPage.qml b/sysui/display/FunctionsPage.qml index 0df4b7c..eff2438 100644 --- a/sysui/display/FunctionsPage.qml +++ b/sysui/display/FunctionsPage.qml @@ -36,14 +36,42 @@ import utils 1.0 import controls 1.0 import models.settings 1.0 import service.popup 1.0 +import service.notification 1.0 UIPage { id: root PopupInterface { id: popupInterface - actions: [ { text: "OK" } ] + actions: [ { text: "OK" }, { text: "Cancel" } ] title: "Car Settings" + + property bool currentState: false + property url functionIcon + property string functionName + property int functionIndex: -1 + + onActionTriggered: { + if (actionId === "0" && !currentState) { + SettingsModel.functions.setProperty(functionIndex, "active", true) + notificationInterface.icon = functionIcon + notificationInterface.body = functionName + " activated" + notificationInterface.show() + } else if (actionId === "0" && currentState) { + SettingsModel.functions.setProperty(functionIndex, "active", false) + notificationInterface.icon = functionIcon + notificationInterface.body = functionName + " deactivated" + notificationInterface.show() + } + currentState = false + functionName = "" + functionIndex = -1 + } + } + + NotificationInterface { + id: notificationInterface + summary: "Vehicle Functions" } header: AppInfoPanel { @@ -74,9 +102,12 @@ UIPage { highlighted: model.active onClicked: { - model.active = !model.active - popupInterface.summary = model.description + (model.active ? " activated" : " deactivated"); - popupInterface.show(); + popupInterface.functionIcon = icon + popupInterface.currentState = model.active + popupInterface.functionIndex = index + popupInterface.functionName = qsTrId(model.description) + popupInterface.summary = !model.active ? "Activate " + popupInterface.functionName + " ?" : "Deactivate " + popupInterface.functionName + " ?" + popupInterface.show() } } } diff --git a/sysui/notification/NotificationCenter.qml b/sysui/notification/NotificationCenter.qml index e745507..e534e1f 100644 --- a/sysui/notification/NotificationCenter.qml +++ b/sysui/notification/NotificationCenter.qml @@ -82,6 +82,7 @@ Control { Column { anchors.top: notificationCenterTitle.bottom + anchors.topMargin: Style.hspan(0.3) Repeater { id: notificationRepeater model: NotificationModel.model diff --git a/sysui/notification/NotificationCenterItem.qml b/sysui/notification/NotificationCenterItem.qml index baeaca0..62bdf64 100644 --- a/sysui/notification/NotificationCenterItem.qml +++ b/sysui/notification/NotificationCenterItem.qml @@ -37,7 +37,7 @@ import controls 1.0 Control { id: root - width: Style.isPotrait ? Style.hspan(Style.notificationCenterSpan + 5) : Style.hspan(Style.notificationCenterSpan) + width: Style.isPotrait ? Style.hspan(Style.notificationCenterSpan + 5) : Style.hspan(12) height: Style.vspan(2) property string iconSource |