@@ -31,123 +31,7 @@ Item {
32 width: notificationsRect.width + interactiveControls.width
32 width: notificationsRect.width + interactiveControls.width
33 height: notificationsRect.height
33 height: notificationsRect.height
34−
34+ property int index: 0
35− property list<Notification> mockList: [
39− type: Notification.PlaceHolder
44− rawActions: ["reply_id", "Dummy"]
45− Component.onCompleted: {
46− n0.completed.connect(mockModel.onCompleted)
52− type: Notification.SnapDecision
53− hints: {"x-canonical-private-affirmative-tint": "true"}
54− summary: "Theatre at Ferria Stadium"
55− body: "at Ferria Stadium in Bilbao, Spain\n07578545317"
58− rawActions: ["ok_id", "Ok",
59− "snooze_id", "Snooze",
61− Component.onCompleted: {
62− n1.completed.connect(mockModel.onCompleted)
68− type: Notification.Ephemeral
70− body: "I did not expect it to be that late."
71− icon: "../graphics/avatars/amanda.png"
72− secondaryIcon: "../graphics/applicationIcons/facebook.png"
73− rawActions: ["reply_id", "Dummy"]
74− Component.onCompleted: {
75− n2.completed.connect(mockModel.onCompleted)
81− type: Notification.Ephemeral
82− hints: {"x-canonical-non-shaped-icon": "true"}
84− body: "Synchronised contacts-database with cloud-storage."
85− icon: "../graphics/applicationIcons/contacts-app.png"
87− rawActions: ["reply_id", "Dummy"]
88− Component.onCompleted: {
89− n3.completed.connect(mockModel.onCompleted)
95− type: Notification.Ephemeral
96− hints: {"x-canonical-non-shaped-icon": "false"}
97− summary: "Photo upload completed"
99− icon: "../graphics/applicationIcons/facebook.png"
101− rawActions: ["reply_id", "Dummy"]
102− Component.onCompleted: {
103− n4.completed.connect(mockModel.onCompleted)
109− type: Notification.Interactive
110− summary: "Interactive notification"
111− body: "This is a notification that can be clicked"
112− icon: "../graphics/avatars/anna_olsson.png"
114− rawActions: ["reply_id", "Dummy"]
115− Component.onCompleted: {
116− n5.completed.connect(mockModel.onCompleted)
122− type: Notification.Confirmation
123− hints: {"x-canonical-non-shaped-icon": "true"}
124− summary: "Confirmation notification"
126− icon: "image://theme/audio-volume-medium"
129− rawActions: ["reply_id", "Dummy"]
130− Component.onCompleted: {
131− n6.completed.connect(mockModel.onCompleted)
137− type: Notification.Confirmation
138− hints: {"x-canonical-non-shaped-icon": "true",
139− "x-canonical-value-bar-tint": "true"}
140− summary: "Confirmation notification"
142− icon: "image://theme/audio-volume-high"
145− rawActions: ["reply_id", "Dummy"]
146− Component.onCompleted: {
147− n7.completed.connect(mockModel.onCompleted)
153 id: rootRow
37 id: rootRow
@@ -159,47 +43,132 @@ Item {
160 // add the default/PlaceHolder notification to the model
44 // add the default/PlaceHolder notification to the model
161 Component.onCompleted: {
45 Component.onCompleted: {
162− append(mockList[0])
46+ var component = Qt.createComponent("Notification.qml")
47+ var n = component.createObject("notification", {"nid": index++,
48+ "type": Notification.PlaceHolder,
55+ n.completed.connect(mockModel.onCompleted)
166 function add2over1SnapDecisionNotification() {
60 function add2over1SnapDecisionNotification() {
167− mockModel.append(mockList[1])
61+ var component = Qt.createComponent("Notification.qml")
62+ var n = component.createObject("notification", {"nid": index++,
63+ "type": Notification.SnapDecision,
64+ "hints": {"x-canonical-private-affirmative-tint": "true"},
65+ "summary": "Theatre at Ferria Stadium",
66+ "body": "at Ferria Stadium in Bilbao, Spain\n07578545317",
69+ "rawActions": ["ok_id", "Ok",
70+ "snooze_id", "Snooze",
72+ n.completed.connect(mockModel.onCompleted)
170 function addEphemeralNotification() {
76 function addEphemeralNotification() {
171− mockModel.append(mockList[2])
77+ var component = Qt.createComponent("Notification.qml")
78+ var n = component.createObject("notification", {"nid": index++,
79+ "type": Notification.Ephemeral,
81+ "summary": "Cole Raby",
82+ "body": "I did not expect it to be that late.",
83+ "icon": "../graphics/avatars/amanda.png",
84+ "secondaryIcon": "../graphics/applicationIcons/facebook.png",
85+ "rawActions": ["reply_id", "Dummy"]})
86+ n.completed.connect(mockModel.onCompleted)
174 function addEphemeralNonShapedIconNotification() {
90 function addEphemeralNonShapedIconNotification() {
175− mockModel.append(mockList[3])
91+ var component = Qt.createComponent("Notification.qml")
92+ var n = component.createObject("notification", {"nid": index++,
93+ "type": Notification.Ephemeral,
94+ "hints": {"x-canonical-non-shaped-icon": "true"},
95+ "summary": "Contacts",
96+ "body": "Synchronised contacts-database with cloud-storage.",
97+ "icon": "../graphics/applicationIcons/contacts-app.png",
99+ "rawActions": ["reply_id", "Dummy"]})
100+ n.completed.connect(mockModel.onCompleted)
178 function addEphemeralIconSummaryNotification() {
104 function addEphemeralIconSummaryNotification() {
179− mockModel.append(mockList[4])
105+ var component = Qt.createComponent("Notification.qml")
106+ var n = component.createObject("notification", {"nid": index++,
107+ "type": Notification.Ephemeral,
108+ "hints": {"x-canonical-non-shaped-icon": "false"},
109+ "summary": "Photo upload completed",
111+ "icon": "../graphics/applicationIcons/facebook.png",
112+ "secondaryIcon": "",
113+ "rawActions": ["reply_id", "Dummy"]})
114+ n.completed.connect(mockModel.onCompleted)
182 function addInteractiveNotification() {
118 function addInteractiveNotification() {
183− mockModel.append(mockList[5])
119+ var component = Qt.createComponent("Notification.qml")
120+ var n = component.createObject("notification", {"nid": index++,
121+ "type": Notification.Interactive,
123+ "summary": "Interactive notification",
124+ "body": "This is a notification that can be clicked",
125+ "icon": "../graphics/avatars/anna_olsson.png",
126+ "secondaryIcon": "",
127+ "rawActions": ["reply_id", "Dummy"]})
128+ n.completed.connect(mockModel.onCompleted)
186 function addConfirmationNotification() {
132 function addConfirmationNotification() {
187− mockModel.append(mockList[6])
133+ var component = Qt.createComponent("Notification.qml")
134+ var n = component.createObject("notification", {"nid": index++,
135+ "type": Notification.Confirmation,
136+ "hints": {"x-canonical-non-shaped-icon": "true"},
137+ "summary": "Confirmation notification",
139+ "icon": "image://theme/audio-volume-medium",
140+ "secondaryIcon": "",
142+ "rawActions": ["reply_id", "Dummy"]})
143+ n.completed.connect(mockModel.onCompleted)
190 function add2ndConfirmationNotification() {
147 function add2ndConfirmationNotification() {
191− mockModel.append(mockList[7])
148+ var component = Qt.createComponent("Notification.qml")
149+ var n = component.createObject("notification", {"nid": index++,
150+ "type": Notification.Confirmation,
151+ "hints": {"x-canonical-non-shaped-icon": "true",
152+ "x-canonical-value-bar-tint": "true"},
153+ "summary": "Confirmation notification",
154+ "body": "High Volume",
155+ "icon": "image://theme/audio-volume-high",
156+ "secondaryIcon": "",
158+ "rawActions": ["reply_id", "Dummy"]})
159+ n.completed.connect(mockModel.onCompleted)
194 function clearNotifications() {
163 function clearNotifications() {
195 while(mockModel.count > 1) {
164 while(mockModel.count > 1) {
196− //remove1stNotification()
165+ remove1stNotification()
200 function remove1stNotification() {
169 function remove1stNotification() {
201 if (mockModel.count > 1) {
170 if (mockModel.count > 1) {
202− //mockModel.remove(1)
171+ mockModel.removeSecond()