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

Proposed by Bill Filler
Status: Merged
Approved by: Bill Filler
Approved revision: 327
Merged at revision: 326
Proposed branch: lp:~bfiller/messaging-app/unknown-attachments-delegate
Merge into: lp:messaging-app
Diff against target: 275 lines (+210/-25)
3 files modified
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:~bfiller/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+251352@code.launchpad.net

This proposal supersedes a proposal from 2015-02-25.

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 : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
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=== modified file 'src/qml/MMS/MMSDefault.qml'
2--- src/qml/MMS/MMSDefault.qml 2014-08-11 22:59:14 +0000
3+++ src/qml/MMS/MMSDefault.qml 2015-02-28 04:04:59 +0000
4@@ -23,24 +23,45 @@
5 MMSBase {
6 id: defaultDelegate
7
8- anchors.left: parent.left
9- anchors.right: parent.right
10- height: bubble.height + units.gu(1)
11- Item {
12- id: bubble
13+ property string unknownLabel: {
14+ if (startsWith(attachment.contentType, "audio/") ) {
15+ return i18n.tr("Audio attachment not supported")
16+ root.textAttachements.push(attachment)
17+ } else if (startsWith(attachment.contentType, "video/")) {
18+ return i18n.tr("Video attachment not supported")
19+ }
20+ return i18n.tr("File type not supported")
21+ }
22+ height: units.gu(15)
23+ width: Math.max(unknownAttachmentLabel.paintedWidth+units.gu(2), units.gu(27))
24+
25+ Image {
26+ id: unknownAttachmentImage
27+ fillMode: Image.PreserveAspectFit
28+ anchors.centerIn: shape
29+ anchors.verticalCenterOffset: -unknownAttachmentLabel.height/2
30+ smooth: true
31+ source: Qt.resolvedUrl("../assets/transfer-unsupported01.svg")
32+ asynchronous: false
33+ height: Math.min(implicitHeight, units.gu(8))
34+ width: Math.min(implicitWidth, units.gu(27))
35+ cache: false
36+ }
37+
38+ Label {
39+ id: unknownAttachmentLabel
40+ color: "gray"
41+ text: unknownLabel
42+ anchors.horizontalCenter: unknownAttachmentImage.horizontalCenter
43+ anchors.top: unknownAttachmentImage.bottom
44+ }
45+
46+ UbuntuShape {
47+ id: shape
48 anchors.top: parent.top
49- width: label.width + units.gu(4)
50- height: label.height + units.gu(2)
51-
52- Label {
53- id: label
54- text: attachment.attachmentId
55- anchors.centerIn: parent
56- anchors.horizontalCenterOffset: incoming ? units.gu(0.5) : -units.gu(0.5)
57- fontSize: "medium"
58- height: paintedHeight
59- color: textColor
60- opacity: incoming ? 1 : 0.9
61- }
62+ width: parent.width
63+ height: parent.height
64+ color: "gray"
65+ opacity: 0.2
66 }
67 }
68
69=== modified file 'src/qml/MMSDelegate.qml'
70--- src/qml/MMSDelegate.qml 2015-02-09 20:35:33 +0000
71+++ src/qml/MMSDelegate.qml 2015-02-28 04:04:59 +0000
72@@ -80,7 +80,7 @@
73 "data": attachment,
74 "delegateSource": "MMS/MMSImage.qml",
75 })
76- } else if (startsWith(attachment.contentType, "video/")) {
77+ //} else if (startsWith(attachment.contentType, "video/")) {
78 // TODO: implement proper video attachment support
79 // dataAttachments.push({type: "video",
80 // data: attachment,
81@@ -88,11 +88,7 @@
82 // })
83 } else if (startsWith(attachment.contentType, "application/smil") ||
84 startsWith(attachment.contentType, "application/x-smil")) {
85- // TODO: implement support for this kind of attachment
86- // dataAttachments.push({type: "application",
87- // data: attachment,
88- // delegateSource: "",
89- // })
90+ // smil files will always be ignored here
91 } else if (startsWith(attachment.contentType, "text/vcard") ||
92 startsWith(attachment.contentType, "text/x-vcard")) {
93 root.dataAttachments.push({"type": "vcard",
94@@ -100,7 +96,10 @@
95 "delegateSource": "MMS/MMSContact.qml"
96 })
97 } else {
98- console.log("No MMS render for " + attachment.contentType)
99+ root.dataAttachments.push({"type": "default",
100+ "data": attachment,
101+ "delegateSource": "MMS/MMSDefault.qml"
102+ })
103 }
104 }
105 attachmentsRepeater.model = root.dataAttachments
106
107=== added file 'src/qml/assets/transfer-unsupported01.svg'
108--- src/qml/assets/transfer-unsupported01.svg 1970-01-01 00:00:00 +0000
109+++ src/qml/assets/transfer-unsupported01.svg 2015-02-28 04:04:59 +0000
110@@ -0,0 +1,165 @@
111+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
112+<!-- Created with Inkscape (http://www.inkscape.org/) -->
113+
114+<svg
115+ xmlns:dc="http://purl.org/dc/elements/1.1/"
116+ xmlns:cc="http://creativecommons.org/ns#"
117+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
118+ xmlns:svg="http://www.w3.org/2000/svg"
119+ xmlns="http://www.w3.org/2000/svg"
120+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
121+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
122+ width="90"
123+ height="90"
124+ id="svg4874"
125+ version="1.1"
126+ inkscape:version="0.91+devel r"
127+ viewBox="0 0 90 90.000001"
128+ sodipodi:docname="file-transfer-disabled.svg">
129+ <defs
130+ id="defs4876" />
131+ <sodipodi:namedview
132+ id="base"
133+ pagecolor="#ffffff"
134+ bordercolor="#666666"
135+ borderopacity="1.0"
136+ inkscape:pageopacity="0.0"
137+ inkscape:pageshadow="2"
138+ inkscape:zoom="4.0745362"
139+ inkscape:cx="23.683672"
140+ inkscape:cy="38.262018"
141+ inkscape:document-units="px"
142+ inkscape:current-layer="g4480"
143+ showgrid="true"
144+ showborder="true"
145+ fit-margin-top="0"
146+ fit-margin-left="0"
147+ fit-margin-right="0"
148+ fit-margin-bottom="0"
149+ inkscape:snap-bbox="true"
150+ inkscape:bbox-paths="true"
151+ inkscape:bbox-nodes="true"
152+ inkscape:snap-bbox-edge-midpoints="true"
153+ inkscape:snap-bbox-midpoints="true"
154+ inkscape:object-paths="true"
155+ inkscape:snap-intersection-paths="true"
156+ inkscape:object-nodes="true"
157+ inkscape:snap-smooth-nodes="true"
158+ inkscape:snap-midpoints="true"
159+ inkscape:snap-object-midpoints="true"
160+ inkscape:snap-center="true"
161+ showguides="true"
162+ inkscape:guide-bbox="true">
163+ <inkscape:grid
164+ type="xygrid"
165+ id="grid5451"
166+ empspacing="6" />
167+ <sodipodi:guide
168+ orientation="1,0"
169+ position="6,77"
170+ id="guide4063" />
171+ <sodipodi:guide
172+ orientation="1,0"
173+ position="3,78"
174+ id="guide4065" />
175+ <sodipodi:guide
176+ orientation="0,1"
177+ position="55,84"
178+ id="guide4067" />
179+ <sodipodi:guide
180+ orientation="0,1"
181+ position="53,87"
182+ id="guide4069" />
183+ <sodipodi:guide
184+ orientation="0,1"
185+ position="20,3"
186+ id="guide4071" />
187+ <sodipodi:guide
188+ orientation="0,1"
189+ position="20,6"
190+ id="guide4073" />
191+ <sodipodi:guide
192+ orientation="1,0"
193+ position="87,7"
194+ id="guide4075" />
195+ <sodipodi:guide
196+ orientation="1,0"
197+ position="84,7"
198+ id="guide4077" />
199+ <sodipodi:guide
200+ orientation="0,1"
201+ position="58,81"
202+ id="guide4074" />
203+ <sodipodi:guide
204+ orientation="1,0"
205+ position="9,74"
206+ id="guide4076" />
207+ <sodipodi:guide
208+ orientation="0,1"
209+ position="21,9"
210+ id="guide4078" />
211+ <sodipodi:guide
212+ orientation="1,0"
213+ position="81,4"
214+ id="guide4080" />
215+ </sodipodi:namedview>
216+ <metadata
217+ id="metadata4879">
218+ <rdf:RDF>
219+ <cc:Work
220+ rdf:about="">
221+ <dc:format>image/svg+xml</dc:format>
222+ <dc:type
223+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
224+ <dc:title></dc:title>
225+ </cc:Work>
226+ </rdf:RDF>
227+ </metadata>
228+ <g
229+ inkscape:label="Layer 1"
230+ inkscape:groupmode="layer"
231+ id="layer1"
232+ transform="translate(67.857146,-84.50504)">
233+ <g
234+ transform="matrix(0,-1,-1,0,373.50506,516.50504)"
235+ id="g4845"
236+ style="display:inline">
237+ <g
238+ transform="matrix(0,-1,-1,0,-173.6378,899.36221)"
239+ id="g4480">
240+ <rect
241+ style="fill:none;stroke:none"
242+ id="rect4512"
243+ width="90"
244+ height="90"
245+ x="458"
246+ y="-605.63782" />
247+ <path
248+ inkscape:connector-curvature="0"
249+ id="path4527"
250+ 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"
251+ 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" />
252+ <path
253+ inkscape:connector-curvature="0"
254+ id="path4518"
255+ 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"
256+ 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" />
257+ <path
258+ 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"
259+ 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 "
260+ transform="translate(458,-605.6378)"
261+ id="path4105" />
262+ <path
263+ 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"
264+ 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 "
265+ transform="translate(458,-605.6378)"
266+ id="path4200" />
267+ <path
268+ 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"
269+ d="m 515,-527.6378 21,-21"
270+ id="path4192"
271+ inkscape:connector-curvature="0" />
272+ </g>
273+ </g>
274+ </g>
275+</svg>

Subscribers

People subscribed via source and target branches