@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Notification 0.1
1920
2021UbuntuShape {
2122 id: notification
@@ -26,6 +27,9 @@ UbuntuShape {
2627 property alias summary: summaryLabel.text
2728 property alias body: bodyLabel.text
2829 property var actions
30+ property var notificationId
31+ property var type
32+ property var notification
2933
3034 signal actionInvoked(string buttonId)
3135
@@ -36,10 +40,15 @@ UbuntuShape {
3640 MouseArea {
3741 id: interactiveArea
3842
43+ Repeater {
44+ id: actionRepeater
45+ model: actions
46+ }
47+
3948 anchors.fill: contentColumn
4049 objectName: "interactiveArea"
41− enabled: notification.type == "Notifications.Type.Interactive"
42− onClicked: notification.actionInvoked(actions.get(0).id)
50+ enabled: notification.type == Notification.Interactive
51+ onClicked: notificationRenderer.model.triggerAction(notificationId, actionRepeater.model.actionId(0))
4352 }
4453
4554 Column {
@@ -130,7 +139,7 @@ UbuntuShape {
130139 objectName: "buttonRow"
131140 spacing: contentColumn.spacing
132141 layoutDirection: Qt.RightToLeft
133− visible: notification.type == "Notifications.Type.SnapDecision"
142+ visible: notification.type == Notification.SnapDecision
134143 anchors {
135144 left: parent.left
136145 right: parent.right
@@ -145,7 +154,7 @@ UbuntuShape {
145154 width: (buttonRow.width - buttonRow.spacing) / 2
146155 height: units.gu(4)
147156 text: label
148− onClicked: notification.actionInvoked(id)
157+ onClicked: notificationRenderer.model.triggerAction(notificationId, id)
149158 }
150159 }
151160 }