@@ -16,6 +16,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import Notification 0.1
20UbuntuShape {
21UbuntuShape {
21 id: notification
22 id: notification
@@ -26,6 +27,9 @@ UbuntuShape {
26 property alias summary: summaryLabel.text
27 property alias summary: summaryLabel.text
27 property alias body: bodyLabel.text
28 property alias body: bodyLabel.text
28 property var actions
29 property var actions
30+ property var notificationId
32+ property var notification
30 signal actionInvoked(string buttonId)
34 signal actionInvoked(string buttonId)
@@ -36,10 +40,15 @@ UbuntuShape {
36 MouseArea {
40 MouseArea {
37 id: interactiveArea
41 id: interactiveArea
39 anchors.fill: contentColumn
48 anchors.fill: contentColumn
40 objectName: "interactiveArea"
49 objectName: "interactiveArea"
41− enabled: notification.type == "Notifications.Type.Interactive"
50+ enabled: notification.type == Notification.Interactive
42− onClicked: notification.actionInvoked(actions.get(0).id)
51+ onClicked: notificationRenderer.model.triggerAction(notificationId, actionRepeater.model.actionId(0))
@@ -130,7 +139,7 @@ UbuntuShape {
130 objectName: "buttonRow"
139 objectName: "buttonRow"
131 spacing: contentColumn.spacing
140 spacing: contentColumn.spacing
132 layoutDirection: Qt.RightToLeft
141 layoutDirection: Qt.RightToLeft
133− visible: notification.type == "Notifications.Type.SnapDecision"
142+ visible: notification.type == Notification.SnapDecision
134 anchors {
143 anchors {
135 left: parent.left
144 left: parent.left
136 right: parent.right
145 right: parent.right
@@ -145,7 +154,7 @@ UbuntuShape {
145 width: (buttonRow.width - buttonRow.spacing) / 2
154 width: (buttonRow.width - buttonRow.spacing) / 2
146 height: units.gu(4)
155 height: units.gu(4)
147 text: label
156 text: label
148− onClicked: notification.actionInvoked(id)
157+ onClicked: notificationRenderer.model.triggerAction(notificationId, id)