Merge lp:~tiagosh/messaging-app/unknown-attachments-delegate into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Superseded
Proposed branch: lp:~tiagosh/messaging-app/unknown-attachments-delegate
Merge into: lp:messaging-app
Diff against target: 504 lines (+246/-54)
4 files modified
po/messaging-app.pot (+36/-29)
src/qml/MMS/MMSDefault.qml (+39/-18)
src/qml/MMSDelegate.qml (+6/-7)
src/qml/assets/transfer-unsupported01.svg (+165/-0)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/unknown-attachments-delegate
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+251015@code.launchpad.net

This proposal has been superseded by a proposal from 2015-02-28.

Commit message

Enable MMSDefault for unknown attachment types

Description of the change

Enable MMSDefault for unknown attachment types

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

Change label according to the mime type.
update pot file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/messaging-app.pot'
2--- po/messaging-app.pot 2015-01-27 19:03:46 +0000
3+++ po/messaging-app.pot 2015-02-27 21:42:15 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: PACKAGE VERSION\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2015-01-16 15:26-0200\n"
9+"POT-Creation-Date: 2015-02-27 18:40-0300\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -19,7 +19,7 @@
14 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
15
16 #. TRANSLATORS: %1 is the first recipient the message is sent to, %2 is the count of remaining recipients
17-#: ../src/qml/ThreadDelegate.qml:45
18+#: ../src/qml/ThreadDelegate.qml:51
19 #, qt-format
20 msgid "%1 + %2"
21 msgstr ""
22@@ -49,16 +49,11 @@
23 msgid "+"
24 msgstr ""
25
26-#. TRANSLATORS: this refers to creating a new contact
27-#: ../src/qml/NewRecipientPage.qml:179
28-msgid "+ Create New"
29-msgstr ""
30-
31 #: ../src/qml/MessageInfoDialog.qml:60
32 msgid "Accepted"
33 msgstr ""
34
35-#: ../src/qml/Messages.qml:470
36+#: ../src/qml/Messages.qml:563
37 msgid "Add"
38 msgstr ""
39
40@@ -70,39 +65,43 @@
41 msgid "All"
42 msgstr ""
43
44-#: ../src/qml/ThreadDelegate.qml:77
45+#: ../src/qml/ThreadDelegate.qml:83
46 #, qt-format
47 msgid "Attachment: %1 contact"
48 msgid_plural "Attachments: %1 contacts"
49 msgstr[0] ""
50 msgstr[1] ""
51
52-#: ../src/qml/ThreadDelegate.qml:80
53+#: ../src/qml/ThreadDelegate.qml:86
54 #, qt-format
55 msgid "Attachment: %1 file"
56 msgid_plural "Attachments: %1 files"
57 msgstr[0] ""
58 msgstr[1] ""
59
60-#: ../src/qml/ThreadDelegate.qml:71
61+#: ../src/qml/ThreadDelegate.qml:77
62 #, qt-format
63 msgid "Attachment: %1 image"
64 msgid_plural "Attachments: %1 images"
65 msgstr[0] ""
66 msgstr[1] ""
67
68-#: ../src/qml/ThreadDelegate.qml:74
69+#: ../src/qml/ThreadDelegate.qml:80
70 #, qt-format
71 msgid "Attachment: %1 video"
72 msgid_plural "Attachments: %1 videos"
73 msgstr[0] ""
74 msgstr[1] ""
75
76-#: ../src/qml/Messages.qml:460 ../src/qml/Messages.qml:514
77+#: ../src/qml/MMS/MMSDefault.qml:28
78+msgid "Audio attachment not supported"
79+msgstr ""
80+
81+#: ../src/qml/Messages.qml:553 ../src/qml/Messages.qml:607
82 msgid "Call"
83 msgstr ""
84
85-#: ../src/qml/MainPage.qml:84 ../src/qml/NewRecipientPage.qml:83
86+#: ../src/qml/MainPage.qml:85 ../src/qml/NewRecipientPage.qml:83
87 msgid "Cancel"
88 msgstr ""
89
90@@ -113,15 +112,15 @@
91 msgstr ""
92
93 #: ../src/qml/Dialogs/NoSIMCardSelectedDialog.qml:30
94-#: ../src/qml/MessageInfoDialog.qml:137 ../src/qml/Messages.qml:266
95+#: ../src/qml/MessageInfoDialog.qml:137 ../src/qml/Messages.qml:359
96 msgid "Close"
97 msgstr ""
98
99-#: ../src/qml/MainPage.qml:140
100+#: ../src/qml/MainPage.qml:141
101 msgid "Compose a new message by swiping up from the bottom of the screen."
102 msgstr ""
103
104-#: ../src/qml/Messages.qml:524
105+#: ../src/qml/Messages.qml:617
106 msgid "Contact"
107 msgstr ""
108
109@@ -129,7 +128,7 @@
110 msgid "Copy"
111 msgstr ""
112
113-#: ../src/qml/MessageDelegateFactory.qml:42 ../src/qml/ThreadDelegate.qml:105
114+#: ../src/qml/MessageDelegateFactory.qml:42 ../src/qml/ThreadDelegate.qml:96
115 msgid "Delete"
116 msgstr ""
117
118@@ -157,6 +156,10 @@
119 msgid "Favorites"
120 msgstr ""
121
122+#: ../src/qml/MMS/MMSDefault.qml:33
123+msgid "File type not supported"
124+msgstr ""
125+
126 #: ../src/qml/MessageInfoDialog.qml:101
127 msgid "From"
128 msgstr ""
129@@ -166,7 +169,7 @@
130 msgstr ""
131
132 #. TRANSLATORS: %1 refers to the number of participants in a group chat
133-#: ../src/qml/Messages.qml:154
134+#: ../src/qml/Messages.qml:247
135 #, qt-format
136 msgid "Group (%1)"
137 msgstr ""
138@@ -211,7 +214,7 @@
139 msgid "Messaging application"
140 msgstr ""
141
142-#: ../src/qml/MMSDelegate.qml:215
143+#: ../src/qml/MMSDelegate.qml:210
144 msgid "Missing message data"
145 msgstr ""
146
147@@ -219,7 +222,7 @@
148 msgid "Myself"
149 msgstr ""
150
151-#: ../src/qml/Messages.qml:157
152+#: ../src/qml/Messages.qml:250
153 msgid "New Message"
154 msgstr ""
155
156@@ -232,7 +235,7 @@
157 msgid "No SIM card selected"
158 msgstr ""
159
160-#: ../src/qml/Messages.qml:262
161+#: ../src/qml/Messages.qml:355
162 msgid "No network"
163 msgstr ""
164
165@@ -259,7 +262,7 @@
166 msgid "Received"
167 msgstr ""
168
169-#: ../src/qml/Messages.qml:216
170+#: ../src/qml/Messages.qml:309
171 msgid "Remove"
172 msgstr ""
173
174@@ -283,7 +286,7 @@
175 msgid "Search"
176 msgstr ""
177
178-#: ../src/qml/MainPage.qml:53 ../src/qml/NewRecipientPage.qml:45
179+#: ../src/qml/MainPage.qml:54 ../src/qml/NewRecipientPage.qml:45
180 msgid "Search..."
181 msgstr ""
182
183@@ -293,7 +296,7 @@
184 "choice in <a href=\"system_settings\">System Settings</a>."
185 msgstr ""
186
187-#: ../src/qml/Messages.qml:846
188+#: ../src/qml/Messages.qml:974
189 msgid "Send"
190 msgstr ""
191
192@@ -317,12 +320,12 @@
193 msgid "Temporarily Failed"
194 msgstr ""
195
196-#: ../src/qml/Messages.qml:263
197+#: ../src/qml/Messages.qml:356
198 #, qt-format
199 msgid "There is currently no network on %1"
200 msgstr ""
201
202-#: ../src/qml/Messages.qml:263
203+#: ../src/qml/Messages.qml:356
204 msgid "There is currently no network."
205 msgstr ""
206
207@@ -347,7 +350,7 @@
208 msgstr ""
209
210 #: ../src/qml/MMS/MMSContact.qml:83 ../src/qml/MMS/PreviewerContact.qml:27
211-#: ../src/qml/Messages.qml:716
212+#: ../src/qml/Messages.qml:844
213 msgid "Unknown contact"
214 msgstr ""
215
216@@ -355,7 +358,11 @@
217 msgid "Video Preview"
218 msgstr ""
219
220-#: ../src/qml/Messages.qml:816
221+#: ../src/qml/MMS/MMSDefault.qml:31
222+msgid "Video attachment not supported"
223+msgstr ""
224+
225+#: ../src/qml/Messages.qml:944
226 msgid "Write a message..."
227 msgstr ""
228
229
230=== modified file 'src/qml/MMS/MMSDefault.qml'
231--- src/qml/MMS/MMSDefault.qml 2014-08-11 22:59:14 +0000
232+++ src/qml/MMS/MMSDefault.qml 2015-02-27 21:42:15 +0000
233@@ -23,24 +23,45 @@
234 MMSBase {
235 id: defaultDelegate
236
237- anchors.left: parent.left
238- anchors.right: parent.right
239- height: bubble.height + units.gu(1)
240- Item {
241- id: bubble
242+ property string unknownLabel: {
243+ if (startsWith(attachment.contentType, "audio/") ) {
244+ return i18n.tr("Audio attachment not supported")
245+ root.textAttachements.push(attachment)
246+ } else if (startsWith(attachment.contentType, "video/")) {
247+ return i18n.tr("Video attachment not supported")
248+ }
249+ return i18n.tr("File type not supported")
250+ }
251+ height: units.gu(15)
252+ width: Math.max(unknownAttachmentLabel.paintedWidth+units.gu(2), units.gu(27))
253+
254+ Image {
255+ id: unknownAttachmentImage
256+ fillMode: Image.PreserveAspectFit
257+ anchors.centerIn: shape
258+ anchors.verticalCenterOffset: -unknownAttachmentLabel.height/2
259+ smooth: true
260+ source: Qt.resolvedUrl("../assets/transfer-unsupported01.svg")
261+ asynchronous: false
262+ height: Math.min(implicitHeight, units.gu(8))
263+ width: Math.min(implicitWidth, units.gu(27))
264+ cache: false
265+ }
266+
267+ Label {
268+ id: unknownAttachmentLabel
269+ color: "gray"
270+ text: unknownLabel
271+ anchors.horizontalCenter: unknownAttachmentImage.horizontalCenter
272+ anchors.top: unknownAttachmentImage.bottom
273+ }
274+
275+ UbuntuShape {
276+ id: shape
277 anchors.top: parent.top
278- width: label.width + units.gu(4)
279- height: label.height + units.gu(2)
280-
281- Label {
282- id: label
283- text: attachment.attachmentId
284- anchors.centerIn: parent
285- anchors.horizontalCenterOffset: incoming ? units.gu(0.5) : -units.gu(0.5)
286- fontSize: "medium"
287- height: paintedHeight
288- color: textColor
289- opacity: incoming ? 1 : 0.9
290- }
291+ width: parent.width
292+ height: parent.height
293+ color: "gray"
294+ opacity: 0.2
295 }
296 }
297
298=== modified file 'src/qml/MMSDelegate.qml'
299--- src/qml/MMSDelegate.qml 2015-02-09 20:35:33 +0000
300+++ src/qml/MMSDelegate.qml 2015-02-27 21:42:15 +0000
301@@ -80,7 +80,7 @@
302 "data": attachment,
303 "delegateSource": "MMS/MMSImage.qml",
304 })
305- } else if (startsWith(attachment.contentType, "video/")) {
306+ //} else if (startsWith(attachment.contentType, "video/")) {
307 // TODO: implement proper video attachment support
308 // dataAttachments.push({type: "video",
309 // data: attachment,
310@@ -88,11 +88,7 @@
311 // })
312 } else if (startsWith(attachment.contentType, "application/smil") ||
313 startsWith(attachment.contentType, "application/x-smil")) {
314- // TODO: implement support for this kind of attachment
315- // dataAttachments.push({type: "application",
316- // data: attachment,
317- // delegateSource: "",
318- // })
319+ // smil files will always be ignored here
320 } else if (startsWith(attachment.contentType, "text/vcard") ||
321 startsWith(attachment.contentType, "text/x-vcard")) {
322 root.dataAttachments.push({"type": "vcard",
323@@ -100,7 +96,10 @@
324 "delegateSource": "MMS/MMSContact.qml"
325 })
326 } else {
327- console.log("No MMS render for " + attachment.contentType)
328+ root.dataAttachments.push({"type": "default",
329+ "data": attachment,
330+ "delegateSource": "MMS/MMSDefault.qml"
331+ })
332 }
333 }
334 attachmentsRepeater.model = root.dataAttachments
335
336=== added file 'src/qml/assets/transfer-unsupported01.svg'
337--- src/qml/assets/transfer-unsupported01.svg 1970-01-01 00:00:00 +0000
338+++ src/qml/assets/transfer-unsupported01.svg 2015-02-27 21:42:15 +0000
339@@ -0,0 +1,165 @@
340+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
341+<!-- Created with Inkscape (http://www.inkscape.org/) -->
342+
343+<svg
344+ xmlns:dc="http://purl.org/dc/elements/1.1/"
345+ xmlns:cc="http://creativecommons.org/ns#"
346+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
347+ xmlns:svg="http://www.w3.org/2000/svg"
348+ xmlns="http://www.w3.org/2000/svg"
349+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
350+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
351+ width="90"
352+ height="90"
353+ id="svg4874"
354+ version="1.1"
355+ inkscape:version="0.91+devel r"
356+ viewBox="0 0 90 90.000001"
357+ sodipodi:docname="file-transfer-disabled.svg">
358+ <defs
359+ id="defs4876" />
360+ <sodipodi:namedview
361+ id="base"
362+ pagecolor="#ffffff"
363+ bordercolor="#666666"
364+ borderopacity="1.0"
365+ inkscape:pageopacity="0.0"
366+ inkscape:pageshadow="2"
367+ inkscape:zoom="4.0745362"
368+ inkscape:cx="23.683672"
369+ inkscape:cy="38.262018"
370+ inkscape:document-units="px"
371+ inkscape:current-layer="g4480"
372+ showgrid="true"
373+ showborder="true"
374+ fit-margin-top="0"
375+ fit-margin-left="0"
376+ fit-margin-right="0"
377+ fit-margin-bottom="0"
378+ inkscape:snap-bbox="true"
379+ inkscape:bbox-paths="true"
380+ inkscape:bbox-nodes="true"
381+ inkscape:snap-bbox-edge-midpoints="true"
382+ inkscape:snap-bbox-midpoints="true"
383+ inkscape:object-paths="true"
384+ inkscape:snap-intersection-paths="true"
385+ inkscape:object-nodes="true"
386+ inkscape:snap-smooth-nodes="true"
387+ inkscape:snap-midpoints="true"
388+ inkscape:snap-object-midpoints="true"
389+ inkscape:snap-center="true"
390+ showguides="true"
391+ inkscape:guide-bbox="true">
392+ <inkscape:grid
393+ type="xygrid"
394+ id="grid5451"
395+ empspacing="6" />
396+ <sodipodi:guide
397+ orientation="1,0"
398+ position="6,77"
399+ id="guide4063" />
400+ <sodipodi:guide
401+ orientation="1,0"
402+ position="3,78"
403+ id="guide4065" />
404+ <sodipodi:guide
405+ orientation="0,1"
406+ position="55,84"
407+ id="guide4067" />
408+ <sodipodi:guide
409+ orientation="0,1"
410+ position="53,87"
411+ id="guide4069" />
412+ <sodipodi:guide
413+ orientation="0,1"
414+ position="20,3"
415+ id="guide4071" />
416+ <sodipodi:guide
417+ orientation="0,1"
418+ position="20,6"
419+ id="guide4073" />
420+ <sodipodi:guide
421+ orientation="1,0"
422+ position="87,7"
423+ id="guide4075" />
424+ <sodipodi:guide
425+ orientation="1,0"
426+ position="84,7"
427+ id="guide4077" />
428+ <sodipodi:guide
429+ orientation="0,1"
430+ position="58,81"
431+ id="guide4074" />
432+ <sodipodi:guide
433+ orientation="1,0"
434+ position="9,74"
435+ id="guide4076" />
436+ <sodipodi:guide
437+ orientation="0,1"
438+ position="21,9"
439+ id="guide4078" />
440+ <sodipodi:guide
441+ orientation="1,0"
442+ position="81,4"
443+ id="guide4080" />
444+ </sodipodi:namedview>
445+ <metadata
446+ id="metadata4879">
447+ <rdf:RDF>
448+ <cc:Work
449+ rdf:about="">
450+ <dc:format>image/svg+xml</dc:format>
451+ <dc:type
452+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
453+ <dc:title></dc:title>
454+ </cc:Work>
455+ </rdf:RDF>
456+ </metadata>
457+ <g
458+ inkscape:label="Layer 1"
459+ inkscape:groupmode="layer"
460+ id="layer1"
461+ transform="translate(67.857146,-84.50504)">
462+ <g
463+ transform="matrix(0,-1,-1,0,373.50506,516.50504)"
464+ id="g4845"
465+ style="display:inline">
466+ <g
467+ transform="matrix(0,-1,-1,0,-173.6378,899.36221)"
468+ id="g4480">
469+ <rect
470+ style="fill:none;stroke:none"
471+ id="rect4512"
472+ width="90"
473+ height="90"
474+ x="458"
475+ y="-605.63782" />
476+ <path
477+ inkscape:connector-curvature="0"
478+ id="path4527"
479+ d="m 512,-589.6378 c -4.41826,0 -7.99998,3.58171 -7.99998,8.00001 0,4.41826 3.58172,7.99999 7.99998,7.99999 4.41827,0 8,-3.58173 8,-7.99999 0,-4.4183 -3.58173,-8.00001 -8,-8.00001 z"
480+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6;marker:none;enable-background:accumulate" />
481+ <path
482+ inkscape:connector-curvature="0"
483+ id="path4518"
484+ d="M 488.66666,-580.74888 474,-552.6378 l 13.76342,0 21.681,0 -10.84065,-20.77774 -3.05556,5.85657 -6.88155,-13.18991 z"
485+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6;marker:none;enable-background:accumulate" />
486+ <path
487+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
488+ d="M 6 6 L 6 72 L 45.480469 72 A 22.499983 22.499983 0 0 1 45 67.5 A 22.499983 22.499983 0 0 1 47.615234 57 L 12 57 L 12 12 L 66 12 L 66 45.052734 A 22.499983 22.499983 0 0 1 67.5 45 A 22.499983 22.499983 0 0 1 72 45.457031 L 72 6 L 6 6 z "
489+ transform="translate(458,-605.6378)"
490+ id="path4105" />
491+ <path
492+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#df382c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
493+ d="M 67.5 51 A 16.499996 16.499996 0 0 0 51 67.5 A 16.499996 16.499996 0 0 0 67.5 84 A 16.499996 16.499996 0 0 0 84 67.5 A 16.499996 16.499996 0 0 0 67.5 51 z M 67.5 56 A 11.499993 11.499993 0 0 1 79 67.5 A 11.499993 11.499993 0 0 1 67.5 79 A 11.499993 11.499993 0 0 1 56 67.5 A 11.499993 11.499993 0 0 1 67.5 56 z "
494+ transform="translate(458,-605.6378)"
495+ id="path4200" />
496+ <path
497+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#df382c;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
498+ d="m 515,-527.6378 21,-21"
499+ id="path4192"
500+ inkscape:connector-curvature="0" />
501+ </g>
502+ </g>
503+ </g>
504+</svg>

Subscribers

People subscribed via source and target branches