Merge lp:~tiagosh/messaging-app/checkmarks into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Merged
Merged at revision: 498
Proposed branch: lp:~tiagosh/messaging-app/checkmarks
Merge into: lp:messaging-app
Prerequisite: lp:~tiagosh/messaging-app/add-fallback-account-to-filter
Diff against target: 243 lines (+109/-2)
9 files modified
src/qml/DeliveryStatus.qml (+37/-0)
src/qml/MMS/MMSAudio.qml (+12/-1)
src/qml/MMS/MMSBase.qml (+1/-0)
src/qml/MMS/MMSContact.qml (+13/-0)
src/qml/MMS/MMSImage.qml (+13/-0)
src/qml/MMS/MMSVideo.qml (+14/-0)
src/qml/MMSMessageBubble.qml (+1/-0)
src/qml/MessageBubble.qml (+17/-1)
src/qml/SMSDelegate.qml (+1/-0)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/checkmarks
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+279964@code.launchpad.net

Commit message

Add delivery status indication on bubbles.

Description of the change

Add delivery status indication on bubbles.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'src/qml/DeliveryStatus.qml'
2--- src/qml/DeliveryStatus.qml 1970-01-01 00:00:00 +0000
3+++ src/qml/DeliveryStatus.qml 2015-12-09 00:45:26 +0000
4@@ -0,0 +1,37 @@
5+/*
6+ * Copyright 2015 Canonical Ltd.
7+ *
8+ * This file is part of messaging-app.
9+ *
10+ * messaging-app is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * messaging-app is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+import QtQuick 2.2
23+import Ubuntu.History 0.1
24+
25+Image {
26+ property int status: -1
27+ property bool enabled: true
28+ height: enabled ? units.gu(1) : 0
29+ fillMode: Image.PreserveAspectFit
30+ source: {
31+ if (!enabled) {
32+ return ""
33+ }
34+ if (status == HistoryThreadModel.MessageStatusDelivered) {
35+ return Qt.resolvedUrl("./assets/check_single_white.png")
36+ } else if (status == HistoryThreadModel.MessageStatusRead) {
37+ return Qt.resolvedUrl("./assets/check_double_white.png")
38+ }
39+ return ""
40+ }
41+}
42
43=== modified file 'src/qml/MMS/MMSAudio.qml'
44--- src/qml/MMS/MMSAudio.qml 2015-12-09 00:45:25 +0000
45+++ src/qml/MMS/MMSAudio.qml 2015-12-09 00:45:26 +0000
46@@ -124,7 +124,7 @@
47 function formatValue(v) { return DateUtils.formattedTime(v/1000) }
48 anchors {
49 left: playButton.right
50- right: parent.right
51+ right: deliveryStatus.left
52 leftMargin: units.gu(1)
53 rightMargin: units.gu(2)
54 verticalCenter: shape.verticalCenter
55@@ -155,4 +155,15 @@
56 }
57 }
58 }
59+
60+ DeliveryStatus {
61+ id: deliveryStatus
62+ status: textMessageStatus
63+ enabled: showDeliveryStatus
64+ anchors {
65+ right: parent.right
66+ rightMargin: units.gu(0.5)
67+ verticalCenter: slider.verticalCenter
68+ }
69+ }
70 }
71
72=== modified file 'src/qml/MMS/MMSBase.qml'
73--- src/qml/MMS/MMSBase.qml 2015-12-09 00:45:25 +0000
74+++ src/qml/MMS/MMSBase.qml 2015-12-09 00:45:26 +0000
75@@ -24,4 +24,5 @@
76 property string previewer
77 property bool lastItem: false
78 property bool swipeLocked: false
79+ property bool showDeliveryStatus: true
80 }
81
82=== modified file 'src/qml/MMS/MMSContact.qml'
83--- src/qml/MMS/MMSContact.qml 2015-11-19 13:37:36 +0000
84+++ src/qml/MMS/MMSContact.qml 2015-12-09 00:45:26 +0000
85@@ -20,6 +20,7 @@
86 import Ubuntu.Components 1.3
87 import Ubuntu.Contacts 0.1
88 import Ubuntu.History 0.1
89+import ".."
90
91 MMSBase {
92 id: vcardDelegate
93@@ -132,4 +133,16 @@
94
95 vCardUrl: attachment ? Qt.resolvedUrl(attachment.filePath) : ""
96 }
97+
98+ DeliveryStatus {
99+ id: deliveryStatus
100+ status: textMessageStatus
101+ enabled: showDeliveryStatus
102+ anchors {
103+ right: parent.right
104+ rightMargin: units.gu(0.5)
105+ bottom: parent.bottom
106+ bottomMargin: units.gu(0.5)
107+ }
108+ }
109 }
110
111=== modified file 'src/qml/MMS/MMSImage.qml'
112--- src/qml/MMS/MMSImage.qml 2015-12-09 00:45:25 +0000
113+++ src/qml/MMS/MMSImage.qml 2015-12-09 00:45:26 +0000
114@@ -18,6 +18,7 @@
115
116 import QtQuick 2.2
117 import Ubuntu.Components 1.3
118+import ".."
119
120 MMSBase {
121 id: imageDelegate
122@@ -84,4 +85,16 @@
123 }
124 }
125 }
126+
127+ DeliveryStatus {
128+ id: deliveryStatus
129+ status: textMessageStatus
130+ enabled: showDeliveryStatus
131+ anchors {
132+ right: parent.right
133+ rightMargin: units.gu(0.5)
134+ bottom: parent.bottom
135+ bottomMargin: units.gu(0.5)
136+ }
137+ }
138 }
139
140=== modified file 'src/qml/MMS/MMSVideo.qml'
141--- src/qml/MMS/MMSVideo.qml 2015-12-09 00:45:25 +0000
142+++ src/qml/MMS/MMSVideo.qml 2015-12-09 00:45:26 +0000
143@@ -19,6 +19,7 @@
144 import QtQuick 2.2
145 import Ubuntu.Components 1.3
146 import Ubuntu.Thumbnailer 0.1
147+import ".."
148
149 MMSBase {
150 id: videoDelegate
151@@ -95,4 +96,17 @@
152 }
153 }
154 }
155+
156+ DeliveryStatus {
157+ id: deliveryStatus
158+ status: textMessageStatus
159+ enabled: showDeliveryStatus
160+ anchors {
161+ right: parent.right
162+ rightMargin: units.gu(0.5)
163+ bottom: parent.bottom
164+ bottomMargin: units.gu(0.5)
165+ }
166+ }
167+
168 }
169
170=== modified file 'src/qml/MMSMessageBubble.qml'
171--- src/qml/MMSMessageBubble.qml 2014-08-27 16:05:37 +0000
172+++ src/qml/MMSMessageBubble.qml 2015-12-09 00:45:26 +0000
173@@ -25,6 +25,7 @@
174 messageStatus: messageData.textMessageStatus
175 messageIncoming: incoming
176 accountName: accountLabel
177+ showDeliveryStatus: true
178
179 states: [
180 State {
181
182=== modified file 'src/qml/MessageBubble.qml'
183--- src/qml/MessageBubble.qml 2015-10-22 15:31:05 +0000
184+++ src/qml/MessageBubble.qml 2015-12-09 00:45:26 +0000
185@@ -34,10 +34,15 @@
186 property var messageTimeStamp
187 property int maxDelegateWidth: units.gu(27)
188 property string accountName
189+ // FIXME for now we just display the delivery status if it's greater than Accepted
190+ property bool showDeliveryStatus: false
191+ property bool deliveryStatusAvailable: showDeliveryStatus && (statusDelivered || statusRead)
192
193 readonly property bool error: (messageStatus === HistoryThreadModel.MessageStatusPermanentlyFailed)
194 readonly property bool sending: (messageStatus === HistoryThreadModel.MessageStatusUnknown ||
195 messageStatus === HistoryThreadModel.MessageStatusTemporarilyFailed) && !messageIncoming
196+ readonly property bool statusDelivered: (messageStatus === HistoryThreadModel.MessageStatusDelivered)
197+ readonly property bool statusRead: (messageStatus === HistoryThreadModel.MessageStatusRead)
198
199 // XXXX: should be hoisted
200 function getCountryCode() {
201@@ -85,7 +90,7 @@
202 radius: units.gu(1)
203 height: senderName.height + senderName.anchors.topMargin + textLabel.height + textTimestamp.height + units.gu(1)
204 width: Math.min(units.gu(27),
205- Math.max(textLabel.contentWidth, textTimestamp.contentWidth, senderName.contentWidth))
206+ Math.max(textLabel.contentWidth, textTimestamp.contentWidth + deliveryStatus.width, senderName.contentWidth))
207 + units.gu(3)
208 anchors{
209 leftMargin: units.gu(1)
210@@ -157,6 +162,17 @@
211 }
212 }
213
214+ DeliveryStatus {
215+ id: deliveryStatus
216+ status: messageStatus
217+ enabled: deliveryStatusAvailable
218+ anchors {
219+ right: parent.right
220+ rightMargin: units.gu(0.5)
221+ verticalCenter: textTimestamp.verticalCenter
222+ }
223+ }
224+
225 ColoredImage {
226 id: bubbleArrow
227
228
229=== modified file 'src/qml/SMSDelegate.qml'
230--- src/qml/SMSDelegate.qml 2015-10-23 20:41:36 +0000
231+++ src/qml/SMSDelegate.qml 2015-12-09 00:45:26 +0000
232@@ -73,5 +73,6 @@
233 messageTimeStamp: root.messageData.timestamp
234 accountName: root.accountLabel
235 messageStatus: root.messageData.textMessageStatus
236+ showDeliveryStatus: true
237 }
238 }
239
240=== added file 'src/qml/assets/check_double_white.png'
241Binary files src/qml/assets/check_double_white.png 1970-01-01 00:00:00 +0000 and src/qml/assets/check_double_white.png 2015-12-09 00:45:26 +0000 differ
242=== added file 'src/qml/assets/check_single_white.png'
243Binary files src/qml/assets/check_single_white.png 1970-01-01 00:00:00 +0000 and src/qml/assets/check_single_white.png 2015-12-09 00:45:26 +0000 differ

Subscribers

People subscribed via source and target branches