Merge lp:~tiagosh/messaging-app/mms-send-fixes into lp:messaging-app
- mms-send-fixes
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Bill Filler |
Approved revision: | 134 |
Merged at revision: | 161 |
Proposed branch: | lp:~tiagosh/messaging-app/mms-send-fixes |
Merge into: | lp:messaging-app |
Diff against target: |
392 lines (+188/-132) 4 files modified
src/qml/MainPage.qml (+2/-0) src/qml/MessageDelegate.qml (+3/-2) src/qml/Messages.qml (+148/-129) src/qml/ThreadDelegate.qml (+35/-1) |
To merge this branch: | bzr merge lp:~tiagosh/messaging-app/mms-send-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bill Filler (community) | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+227954@code.launchpad.net |
Commit message
- Ignore x-smil content-type
- Enable spinner for mms
Description of the change
- Ignore x-smil content-type
- Enable spinner for mms
--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes
Did you successfully run all tests found in your component's Test Plan (https:/
Yes
If you changed the UI, was the change specified/approved by design?
N/A
If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A
PS Jenkins bot (ps-jenkins) wrote : | # |
- 132. By Tiago Salem Herrmann
-
improve performance
set thread labels correctly for mms - 133. By Tiago Salem Herrmann
-
remove debug
- 134. By Tiago Salem Herrmann
-
remove commented code
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:134
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/qml/MainPage.qml' | |||
2 | --- src/qml/MainPage.qml 2014-07-15 15:23:21 +0000 | |||
3 | +++ src/qml/MainPage.qml 2014-07-25 16:28:41 +0000 | |||
4 | @@ -146,6 +146,8 @@ | |||
5 | 146 | sortField: "lastEventTimestamp" | 146 | sortField: "lastEventTimestamp" |
6 | 147 | sortOrder: HistorySort.DescendingOrder | 147 | sortOrder: HistorySort.DescendingOrder |
7 | 148 | } | 148 | } |
8 | 149 | filter: HistoryFilter { | ||
9 | 150 | } | ||
10 | 149 | } | 151 | } |
11 | 150 | 152 | ||
12 | 151 | Component { | 153 | Component { |
13 | 152 | 154 | ||
14 | === modified file 'src/qml/MessageDelegate.qml' | |||
15 | --- src/qml/MessageDelegate.qml 2014-07-14 15:47:34 +0000 | |||
16 | +++ src/qml/MessageDelegate.qml 2014-07-25 16:28:41 +0000 | |||
17 | @@ -103,7 +103,8 @@ | |||
18 | 103 | return "MMS/MMSImage.qml" | 103 | return "MMS/MMSImage.qml" |
19 | 104 | } else if (startsWith(modelData.contentType, "video/")) { | 104 | } else if (startsWith(modelData.contentType, "video/")) { |
20 | 105 | return "MMS/MMSVideo.qml" | 105 | return "MMS/MMSVideo.qml" |
22 | 106 | } else if (modelData.contentType === "application/smil" ) { | 106 | } else if (startsWith(modelData.contentType, "application/smil") || |
23 | 107 | startsWith(modelData.contentType, "application/x-smil")) { | ||
24 | 107 | console.log("Ignoring SMIL file") | 108 | console.log("Ignoring SMIL file") |
25 | 108 | return "" | 109 | return "" |
26 | 109 | } else if (startsWith(modelData.contentType, "text/plain") ) { | 110 | } else if (startsWith(modelData.contentType, "text/plain") ) { |
27 | @@ -260,7 +261,7 @@ | |||
28 | 260 | visible: running && !selectionMode | 261 | visible: running && !selectionMode |
29 | 261 | // if temporarily failed or unknown status, then show the spinner | 262 | // if temporarily failed or unknown status, then show the spinner |
30 | 262 | running: (textMessageStatus == HistoryThreadModel.MessageStatusUnknown || | 263 | running: (textMessageStatus == HistoryThreadModel.MessageStatusUnknown || |
32 | 263 | textMessageStatus == HistoryThreadModel.MessageStatusTemporarilyFailed) && !incoming && mmsText === "" | 264 | textMessageStatus == HistoryThreadModel.MessageStatusTemporarilyFailed) && !incoming |
33 | 264 | } | 265 | } |
34 | 265 | 266 | ||
35 | 266 | Label { | 267 | Label { |
36 | 267 | 268 | ||
37 | === modified file 'src/qml/Messages.qml' | |||
38 | --- src/qml/Messages.qml 2014-07-23 16:40:57 +0000 | |||
39 | +++ src/qml/Messages.qml 2014-07-25 16:28:41 +0000 | |||
40 | @@ -58,8 +58,13 @@ | |||
41 | 58 | } | 58 | } |
42 | 59 | var filePath = String(transfer.items[i].url).replace('file://', '') | 59 | var filePath = String(transfer.items[i].url).replace('file://', '') |
43 | 60 | // get only the basename | 60 | // get only the basename |
44 | 61 | attachment["name"] = filePath.split('/').reverse()[0] | ||
45 | 62 | attachment["contentType"] = application.fileMimeType(filePath) | 61 | attachment["contentType"] = application.fileMimeType(filePath) |
46 | 62 | if (startsWith(attachment["contentType"], "text/vcard") || | ||
47 | 63 | startsWith(attachment["contentType"], "text/x-vcard")) { | ||
48 | 64 | attachment["name"] = "contact.vcf" | ||
49 | 65 | } else { | ||
50 | 66 | attachment["name"] = filePath.split('/').reverse()[0] | ||
51 | 67 | } | ||
52 | 63 | attachment["filePath"] = filePath | 68 | attachment["filePath"] = filePath |
53 | 64 | attachments.append(attachment) | 69 | attachments.append(attachment) |
54 | 65 | } | 70 | } |
55 | @@ -345,30 +350,147 @@ | |||
56 | 345 | } | 350 | } |
57 | 346 | } | 351 | } |
58 | 347 | 352 | ||
83 | 348 | ContactListView { | 353 | Component { |
84 | 349 | id: contactSearch | 354 | id: contactSearchComponent |
85 | 350 | 355 | ||
86 | 351 | property bool searchEnabled: multiRecipient.searchString !== "" && multiRecipient.focus | 356 | ContactListView { |
87 | 352 | 357 | id: contactSearch | |
88 | 353 | visible: searchEnabled | 358 | |
89 | 354 | detailToPick: ContactDetail.PhoneNumber | 359 | detailToPick: ContactDetail.PhoneNumber |
90 | 355 | clip: true | 360 | clip: true |
91 | 356 | z: 1 | 361 | z: 1 |
92 | 357 | autoUpdate: false | 362 | autoUpdate: false |
93 | 358 | filterTerm: multiRecipient.searchString | 363 | filterTerm: multiRecipient.searchString |
94 | 359 | showSections: false | 364 | showSections: false |
95 | 360 | 365 | ||
96 | 361 | states: [ | 366 | states: [ |
97 | 362 | State { | 367 | State { |
98 | 363 | name: "empty" | 368 | name: "empty" |
99 | 364 | when: contactSearch.count === 0 | 369 | when: contactSearch.count === 0 |
100 | 365 | PropertyChanges { | 370 | PropertyChanges { |
101 | 366 | target: contactSearch | 371 | target: contactSearch |
102 | 367 | height: 0 | 372 | height: 0 |
103 | 368 | } | 373 | } |
104 | 369 | } | 374 | } |
105 | 370 | ] | 375 | ] |
106 | 371 | 376 | ||
107 | 377 | anchors { | ||
108 | 378 | top: accountList.bottom | ||
109 | 379 | topMargin: units.gu(1) | ||
110 | 380 | left: parent.left | ||
111 | 381 | right: parent.right | ||
112 | 382 | bottom: bottomPanel.top | ||
113 | 383 | } | ||
114 | 384 | |||
115 | 385 | Behavior on height { | ||
116 | 386 | UbuntuNumberAnimation { } | ||
117 | 387 | } | ||
118 | 388 | |||
119 | 389 | InvalidFilter { | ||
120 | 390 | id: invalidFilter | ||
121 | 391 | } | ||
122 | 392 | |||
123 | 393 | // clear list if it is invisible to save some memory | ||
124 | 394 | onVisibleChanged: { | ||
125 | 395 | if (visible && (filter != null)) { | ||
126 | 396 | changeFilter(null) | ||
127 | 397 | update() | ||
128 | 398 | } else if (!visible && filter != invalidFilter) { | ||
129 | 399 | changeFilter(invalidFilter) | ||
130 | 400 | update() | ||
131 | 401 | } | ||
132 | 402 | } | ||
133 | 403 | |||
134 | 404 | ContactDetailPhoneNumberTypeModel { | ||
135 | 405 | id: phoneTypeModel | ||
136 | 406 | } | ||
137 | 407 | |||
138 | 408 | listDelegate: Item { | ||
139 | 409 | anchors { | ||
140 | 410 | left: parent.left | ||
141 | 411 | right: parent.right | ||
142 | 412 | margins: units.gu(2) | ||
143 | 413 | } | ||
144 | 414 | height: phoneRepeater.count * units.gu(6) | ||
145 | 415 | Column { | ||
146 | 416 | anchors.fill: parent | ||
147 | 417 | spacing: units.gu(1) | ||
148 | 418 | |||
149 | 419 | Repeater { | ||
150 | 420 | id: phoneRepeater | ||
151 | 421 | |||
152 | 422 | model: contact.phoneNumbers.length | ||
153 | 423 | |||
154 | 424 | delegate: MouseArea { | ||
155 | 425 | anchors { | ||
156 | 426 | left: parent.left | ||
157 | 427 | right: parent.right | ||
158 | 428 | } | ||
159 | 429 | height: units.gu(5) | ||
160 | 430 | |||
161 | 431 | onClicked: { | ||
162 | 432 | multiRecipient.addRecipient(contact.phoneNumbers[index].number) | ||
163 | 433 | multiRecipient.clearSearch() | ||
164 | 434 | multiRecipient.forceActiveFocus() | ||
165 | 435 | } | ||
166 | 436 | |||
167 | 437 | Column { | ||
168 | 438 | anchors.fill: parent | ||
169 | 439 | |||
170 | 440 | Label { | ||
171 | 441 | anchors { | ||
172 | 442 | left: parent.left | ||
173 | 443 | right: parent.right | ||
174 | 444 | } | ||
175 | 445 | height: units.gu(2) | ||
176 | 446 | text: { | ||
177 | 447 | // this is necessary to keep the string in the original format | ||
178 | 448 | var originalText = contact.displayLabel.label | ||
179 | 449 | var lowerSearchText = multiRecipient.searchString.toLowerCase() | ||
180 | 450 | var lowerText = originalText.toLowerCase() | ||
181 | 451 | var searchIndex = lowerText.indexOf(lowerSearchText) | ||
182 | 452 | if (searchIndex !== -1) { | ||
183 | 453 | var piece = originalText.substr(searchIndex, lowerSearchText.length) | ||
184 | 454 | return originalText.replace(piece, "<b>" + piece + "</b>") | ||
185 | 455 | } else { | ||
186 | 456 | return originalText | ||
187 | 457 | } | ||
188 | 458 | } | ||
189 | 459 | fontSize: "medium" | ||
190 | 460 | color: UbuntuColors.lightAubergine | ||
191 | 461 | } | ||
192 | 462 | Label { | ||
193 | 463 | anchors { | ||
194 | 464 | left: parent.left | ||
195 | 465 | right: parent.right | ||
196 | 466 | } | ||
197 | 467 | height: units.gu(2) | ||
198 | 468 | text: { | ||
199 | 469 | var phoneDetail = contact.phoneNumbers[index] | ||
200 | 470 | return ("%1 %2").arg(phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)).label) | ||
201 | 471 | .arg(phoneDetail.number) | ||
202 | 472 | } | ||
203 | 473 | } | ||
204 | 474 | Item { | ||
205 | 475 | anchors { | ||
206 | 476 | left: parent.left | ||
207 | 477 | right: parent.right | ||
208 | 478 | } | ||
209 | 479 | height: units.gu(1) | ||
210 | 480 | } | ||
211 | 481 | |||
212 | 482 | ListItem.ThinDivider {} | ||
213 | 483 | } | ||
214 | 484 | } | ||
215 | 485 | } | ||
216 | 486 | } | ||
217 | 487 | } | ||
218 | 488 | } | ||
219 | 489 | } | ||
220 | 490 | |||
221 | 491 | Loader { | ||
222 | 492 | active: multiRecipient.searchString !== "" && multiRecipient.focus | ||
223 | 493 | sourceComponent: contactSearchComponent | ||
224 | 372 | anchors { | 494 | anchors { |
225 | 373 | top: accountList.bottom | 495 | top: accountList.bottom |
226 | 374 | topMargin: units.gu(1) | 496 | topMargin: units.gu(1) |
227 | @@ -376,110 +498,7 @@ | |||
228 | 376 | right: parent.right | 498 | right: parent.right |
229 | 377 | bottom: bottomPanel.top | 499 | bottom: bottomPanel.top |
230 | 378 | } | 500 | } |
335 | 379 | 501 | z: 1 | |
232 | 380 | Behavior on height { | ||
233 | 381 | UbuntuNumberAnimation { } | ||
234 | 382 | } | ||
235 | 383 | |||
236 | 384 | InvalidFilter { | ||
237 | 385 | id: invalidFilter | ||
238 | 386 | } | ||
239 | 387 | |||
240 | 388 | // clear list if it is invisible to save some memory | ||
241 | 389 | onVisibleChanged: { | ||
242 | 390 | if (visible && (filter != null)) { | ||
243 | 391 | changeFilter(null) | ||
244 | 392 | update() | ||
245 | 393 | } else if (!visible && filter != invalidFilter) { | ||
246 | 394 | changeFilter(invalidFilter) | ||
247 | 395 | update() | ||
248 | 396 | } | ||
249 | 397 | } | ||
250 | 398 | |||
251 | 399 | ContactDetailPhoneNumberTypeModel { | ||
252 | 400 | id: phoneTypeModel | ||
253 | 401 | } | ||
254 | 402 | |||
255 | 403 | listDelegate: Item { | ||
256 | 404 | anchors { | ||
257 | 405 | left: parent.left | ||
258 | 406 | right: parent.right | ||
259 | 407 | margins: units.gu(2) | ||
260 | 408 | } | ||
261 | 409 | height: phoneRepeater.count * units.gu(6) | ||
262 | 410 | Column { | ||
263 | 411 | anchors.fill: parent | ||
264 | 412 | spacing: units.gu(1) | ||
265 | 413 | |||
266 | 414 | Repeater { | ||
267 | 415 | id: phoneRepeater | ||
268 | 416 | |||
269 | 417 | model: contact.phoneNumbers.length | ||
270 | 418 | |||
271 | 419 | delegate: MouseArea { | ||
272 | 420 | anchors { | ||
273 | 421 | left: parent.left | ||
274 | 422 | right: parent.right | ||
275 | 423 | } | ||
276 | 424 | height: units.gu(5) | ||
277 | 425 | |||
278 | 426 | onClicked: { | ||
279 | 427 | multiRecipient.addRecipient(contact.phoneNumbers[index].number) | ||
280 | 428 | multiRecipient.clearSearch() | ||
281 | 429 | multiRecipient.forceActiveFocus() | ||
282 | 430 | } | ||
283 | 431 | |||
284 | 432 | Column { | ||
285 | 433 | anchors.fill: parent | ||
286 | 434 | |||
287 | 435 | Label { | ||
288 | 436 | anchors { | ||
289 | 437 | left: parent.left | ||
290 | 438 | right: parent.right | ||
291 | 439 | } | ||
292 | 440 | height: units.gu(2) | ||
293 | 441 | text: { | ||
294 | 442 | // this is necessary to keep the string in the original format | ||
295 | 443 | var originalText = contact.displayLabel.label | ||
296 | 444 | var lowerSearchText = multiRecipient.searchString.toLowerCase() | ||
297 | 445 | var lowerText = originalText.toLowerCase() | ||
298 | 446 | var searchIndex = lowerText.indexOf(lowerSearchText) | ||
299 | 447 | if (searchIndex !== -1) { | ||
300 | 448 | var piece = originalText.substr(searchIndex, lowerSearchText.length) | ||
301 | 449 | return originalText.replace(piece, "<b>" + piece + "</b>") | ||
302 | 450 | } else { | ||
303 | 451 | return originalText | ||
304 | 452 | } | ||
305 | 453 | } | ||
306 | 454 | fontSize: "medium" | ||
307 | 455 | color: UbuntuColors.lightAubergine | ||
308 | 456 | } | ||
309 | 457 | Label { | ||
310 | 458 | anchors { | ||
311 | 459 | left: parent.left | ||
312 | 460 | right: parent.right | ||
313 | 461 | } | ||
314 | 462 | height: units.gu(2) | ||
315 | 463 | text: { | ||
316 | 464 | var phoneDetail = contact.phoneNumbers[index] | ||
317 | 465 | return ("%1 %2").arg(phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)).label) | ||
318 | 466 | .arg(phoneDetail.number) | ||
319 | 467 | } | ||
320 | 468 | } | ||
321 | 469 | Item { | ||
322 | 470 | anchors { | ||
323 | 471 | left: parent.left | ||
324 | 472 | right: parent.right | ||
325 | 473 | } | ||
326 | 474 | height: units.gu(1) | ||
327 | 475 | } | ||
328 | 476 | |||
329 | 477 | ListItem.ThinDivider {} | ||
330 | 478 | } | ||
331 | 479 | } | ||
332 | 480 | } | ||
333 | 481 | } | ||
334 | 482 | } | ||
336 | 483 | } | 502 | } |
337 | 484 | 503 | ||
338 | 485 | ContactWatcher { | 504 | ContactWatcher { |
339 | 486 | 505 | ||
340 | === modified file 'src/qml/ThreadDelegate.qml' | |||
341 | --- src/qml/ThreadDelegate.qml 2014-07-15 15:23:21 +0000 | |||
342 | +++ src/qml/ThreadDelegate.qml 2014-07-25 16:28:41 +0000 | |||
343 | @@ -44,6 +44,40 @@ | |||
344 | 44 | property bool unknownContact: delegateHelper.isUnknown | 44 | property bool unknownContact: delegateHelper.isUnknown |
345 | 45 | property bool selectionMode: false | 45 | property bool selectionMode: false |
346 | 46 | property string threadId: model.threadId | 46 | property string threadId: model.threadId |
347 | 47 | property string textMessage: { | ||
348 | 48 | // check if this is an mms, if so, search for the actual text | ||
349 | 49 | var imageCount = 0 | ||
350 | 50 | var videoCount = 0 | ||
351 | 51 | var contactCount = 0 | ||
352 | 52 | var attachmentCount = 0 | ||
353 | 53 | for (var i = 0; i < eventTextAttachments.length; i++) { | ||
354 | 54 | if (startsWith(eventTextAttachments[i].contentType, "text/plain")) { | ||
355 | 55 | return application.readTextFile(eventTextAttachments[i].filePath) | ||
356 | 56 | } else if (startsWith(eventTextAttachments[i].contentType, "image/")) { | ||
357 | 57 | imageCount++ | ||
358 | 58 | } else if (startsWith(eventTextAttachments[i].contentType, "video/")) { | ||
359 | 59 | videoCount++ | ||
360 | 60 | } else if (startsWith(eventTextAttachments[i].contentType, "text/vcard") || | ||
361 | 61 | startsWith(eventTextAttachments[i].contentType, "text/x-vcard")) { | ||
362 | 62 | contactCount++ | ||
363 | 63 | } | ||
364 | 64 | } | ||
365 | 65 | attachmentCount = imageCount + videoCount + contactCount | ||
366 | 66 | |||
367 | 67 | if (imageCount > 0 && attachmentCount == imageCount) { | ||
368 | 68 | return i18n.tr("Attachment: %1 image", "Attachments: %s images").arg(imageCount) | ||
369 | 69 | } | ||
370 | 70 | if (videoCount > 0 && attachmentCount == videoCount) { | ||
371 | 71 | return i18n.tr("Attachment: %1 video", "Attachments: %s videos").arg(videoCount) | ||
372 | 72 | } | ||
373 | 73 | if (contactCount > 0 && attachmentCount == contactCount) { | ||
374 | 74 | return i18n.tr("Attachment: %1 contact", "Attachments: %s contacts").arg(contactCount) | ||
375 | 75 | } | ||
376 | 76 | if (attachmentCount > 0) { | ||
377 | 77 | return i18n.tr("Attachment: %1 file", "Attachments: %s files").arg(attachmentCount) | ||
378 | 78 | } | ||
379 | 79 | return eventTextMessage | ||
380 | 80 | } | ||
381 | 47 | anchors.left: parent.left | 81 | anchors.left: parent.left |
382 | 48 | anchors.right: parent.right | 82 | anchors.right: parent.right |
383 | 49 | height: units.gu(10) | 83 | height: units.gu(10) |
384 | @@ -176,7 +210,7 @@ | |||
385 | 176 | maximumLineCount: 2 | 210 | maximumLineCount: 2 |
386 | 177 | fontSize: "x-small" | 211 | fontSize: "x-small" |
387 | 178 | wrapMode: Text.WordWrap | 212 | wrapMode: Text.WordWrap |
389 | 179 | text: eventTextMessage == undefined ? "" : eventTextMessage | 213 | text: textMessage |
390 | 180 | font.weight: Font.Light | 214 | font.weight: Font.Light |
391 | 181 | } | 215 | } |
392 | 182 | onItemRemoved: { | 216 | onItemRemoved: { |
FAILED: Continuous integration, rev:131 jenkins. qa.ubuntu. com/job/ messaging- app-ci/ 301/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2391 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 1952 jenkins. qa.ubuntu. com/job/ messaging- app-utopic- amd64-ci/ 95 jenkins. qa.ubuntu. com/job/ messaging- app-utopic- armhf-ci/ 95 jenkins. qa.ubuntu. com/job/ messaging- app-utopic- armhf-ci/ 95/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ messaging- app-utopic- i386-ci/ 95 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/2560 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3614 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3614/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 10295 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 1634 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2197 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/2197/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/messaging- app-ci/ 301/rebuild
http://