on xenial help sign in
Merged trunk.
commit164304c83cb9a7faf3f4345c6b38780b959d79fe authorMichał Karnicki <michal.karnicki@canonical.com> dateTue 28 Jan 2014, 18:45 (13 years ago) parentde29d17be2d485
7 files changed+71−44
po/fr.po+29−29 qml/Components/ResponsiveGridView.qml+1−1 qml/Dash/Card.qml+1 qml/Dash/CardHeader.qml+5−1 tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1 tests/qmltests/Dash/tst_Card.qml+21−4 tests/qmltests/Dash/tst_CardHeader.qml+13−8
po/fr.po+29−29
@@ -8,23 +8,23 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-06-27 03:21+0000\n"
12−"Last-Translator: Michał Sawicz <michal.sawicz@canonical.com>\n"
11+"PO-Revision-Date: 2014-01-28 00:34+0000\n"
12+"Last-Translator: Pierre <Unknown>\n"
1313"Language-Team: French <fr@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n > 1;\n"
18−"X-Launchpad-Export-Date: 2013-12-29 06:04+0000\n"
19−"X-Generator: Launchpad (build 16877)\n"
18+"X-Launchpad-Export-Date: 2014-01-28 07:06+0000\n"
19+"X-Generator: Launchpad (build 16914)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
23−msgstr ""
23+msgstr "Passer l'intro"
2424
2525#: Components/EdgeDemo.qml:112
2626msgid "Right edge"
27−msgstr ""
27+msgstr "Bord droit"
2828
2929#: Components/EdgeDemo.qml:113
3030msgid "Try swiping from the right edge to unlock the phone"
@@ -32,7 +32,7 @@ msgstr ""
3232
3333#: Components/EdgeDemo.qml:144
3434msgid "Top edge"
35−msgstr ""
35+msgstr "Bord supérieur"
3636
3737#: Components/EdgeDemo.qml:145
3838msgid "Try swiping from the top edge to access the indicators"
@@ -40,7 +40,7 @@ msgstr ""
4040
4141#: Components/EdgeDemo.qml:170
4242msgid "Close"
43−msgstr ""
43+msgstr "Fermer"
4444
4545#: Components/EdgeDemo.qml:171
4646msgid "Swipe up again to close the settings screen"
@@ -48,7 +48,7 @@ msgstr ""
4848
4949#: Components/EdgeDemo.qml:198
5050msgid "Left edge"
51−msgstr ""
51+msgstr "Bord gauche"
5252
5353#: Components/EdgeDemo.qml:199
5454msgid "Swipe from the left to reveal the launcher for quick access to apps"
@@ -66,70 +66,70 @@ msgstr ""
6666
6767#: Components/PageHeader.qml:364
6868msgid "Recent searches"
69−msgstr ""
69+msgstr "Recherches récentes"
7070
7171#: Dash/Apps/AppPreview.qml:135
7272msgid "Rate this"
73−msgstr ""
73+msgstr "Evaluez ceci"
7474
7575#. TRANSLATORS: Number of persons who rated this app/video/whatever
7676#: Dash/Previews/Header.qml:93
7777#, qt-format
7878msgid "(%1)"
79−msgstr ""
79+msgstr "(%1)"
8080
8181#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
8282#: Dash/Previews/Header.qml:105
8383#, qt-format
8484msgid "%1 review"
8585msgid_plural "%1 reviews"
86−msgstr[0] ""
87−msgstr[1] ""
86+msgstr[0] "%1 avis"
87+msgstr[1] "%1 avis"
8888
8989#: Dash/Previews/Reviews.qml:74
9090msgid "Add a review"
91−msgstr ""
91+msgstr "Ajouter un avis"
9292
9393#: Dash/Previews/Reviews.qml:86
9494msgid "Review"
95−msgstr ""
95+msgstr "Avis"
9696
9797#: Dash/Previews/Reviews.qml:121
9898msgid "Send"
99−msgstr ""
99+msgstr "Envoyer"
100100
101101#: Dash/Previews/Reviews.qml:139
102102msgid "Comments:"
103−msgstr ""
103+msgstr "Commentaires :"
104104
105105#: Greeter/Lockscreen.qml:149
106106msgid "Emergency Call"
107−msgstr ""
107+msgstr "Appel d'urgence"
108108
109109#: Greeter/PassphraseLockscreen.qml:59
110110#, qt-format
111111msgid "Hello %1"
112−msgstr ""
112+msgstr "Bonjour %1"
113113
114114#: Greeter/PassphraseLockscreen.qml:59
115115msgid "Hello"
116−msgstr ""
116+msgstr "Bonjour"
117117
118118#: Hud/HudParametrizedActionsPage.qml:132
119119msgid "Confirm"
120−msgstr ""
120+msgstr "Confirmez"
121121
122122#: Hud/Hud.qml:61 Hud/Hud.qml:99 Hud/Hud.qml:372
123123msgid "Type or say a command"
124−msgstr ""
124+msgstr "Rédigez ou dictez une commande"
125125
126126#: Hud/Hud.qml:84
127127msgid "Loading. Please Wait..."
128−msgstr ""
128+msgstr "Chargement. Veuillez patienter…"
129129
130130#: Hud/Hud.qml:89
131131msgid "Speak Now..."
132−msgstr ""
132+msgstr "Parlez maintenant…"
133133
134134#: Hud/Hud.qml:94
135135msgid "Speaking..."
@@ -137,16 +137,16 @@ msgstr ""
137137
138138#: Notifications/NotificationMenuItemFactory.qml:89
139139msgid "Show password"
140−msgstr ""
140+msgstr "Afficher le mot de passe"
141141
142142#: Panel/SearchIndicator.qml:27
143143msgid "Search"
144−msgstr ""
144+msgstr "Rechercher"
145145
146146#: plugins/Unity/Launcher/launcheritem.cpp:43
147147#: plugins/Unity/Launcher/launcheritem.cpp:73
148148msgid "Lock to Launcher"
149−msgstr ""
149+msgstr "Conserver dans le lanceur"
150150
151151#: plugins/Unity/Launcher/launcheritem.cpp:73
152152msgid "Unlock from Launcher"
@@ -155,4 +155,4 @@ msgstr ""
155155#: Shell.qml:439
156156#, qt-format
157157msgid "Please enter %1"
158−msgstr ""
158+msgstr "Veuillez saisir %1"
qml/Components/ResponsiveGridView.qml+1−1
@@ -72,7 +72,7 @@ Item {
7272
7373 function columnsForSpacing(spacing) {
7474 // minimum margin is half of the spacing
75− return Math.max(1, Math.floor((parent.width - spacing/2) / (delegateWidth + spacing)));
75+ return Math.max(1, Math.floor(parent.width / (delegateWidth + spacing)));
7676 }
7777
7878 property real allocatableHorizontalSpace: parent.width - columns * delegateWidth
qml/Dash/Card.qml+1
@@ -79,5 +79,6 @@ Item {
7979 maximumLineCount: 5
8080 elide: Text.ElideRight
8181 text: cardData && cardData["summary"] || ""
82+ height: text ? implicitHeight : 0
8283 }
8384}
qml/Dash/CardHeader.qml+5−1
@@ -56,9 +56,9 @@ Item {
5656
5757 Label {
5858 id: titleLabel
59+ objectName: "titleLabel"
5960 anchors { left: parent.left; right: parent.right }
6061 elide: Text.ElideRight
61− objectName: "titleLabel"
6262 font.weight: Font.DemiBold
6363 wrapMode: Text.Wrap
6464 maximumLineCount: 2
@@ -66,6 +66,7 @@ Item {
6666
6767 Label {
6868 id: subtitleLabel
69+ objectName: "subtitleLabel"
6970 anchors { left: parent.left; right: parent.right }
7071 elide: Text.ElideRight
7172 visible: titleLabel.text && text
@@ -90,6 +91,7 @@ Item {
9091 elide: Text.ElideRight
9192 font.weight: Font.DemiBold
9293 color: Theme.palette.selected.foreground
94+ visible: text
9395 }
9496
9597 Label {
@@ -98,6 +100,7 @@ Item {
98100 width: parent.labelWidth
99101 elide: Text.ElideRight
100102 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
103+ visible: text
101104 }
102105
103106 Label {
@@ -105,6 +108,7 @@ Item {
105108 width: parent.labelWidth
106109 elide: Text.ElideRight
107110 horizontalAlignment: Text.AlignRight
111+ visible: text
108112 }
109113 }
110114 }
tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1
@@ -152,7 +152,7 @@ Item {
152152 var data = new Array()
153153
154154 data.push({selectedIndex: 0, minHSpacing:0, columnCount: 13})
155− data.push({selectedIndex: 1, minHSpacing:units.gu(2), columnCount: 9})
155+ data.push({selectedIndex: 1, minHSpacing:units.gu(2), columnCount: 10})
156156 data.push({selectedIndex: 2, minHSpacing:units.gu(8), columnCount: 5})
157157 data.push({selectedIndex: 3, minHSpacing:units.gu(25), columnCount: 2})
158158
tests/qmltests/Dash/tst_Card.qml+21−4
@@ -106,6 +106,10 @@ Rectangle {
106106 "layout": { "template": { "card-layout": "horizontal" },
107107 "components": JSON.parse(fullMapping) }
108108 },
109+ {
110+ "name": "Art, header - vertical",
111+ "layout": { "components": Helpers.update(JSON.parse(root.fullMapping), { "summary": undefined }) }
112+ },
109113 ]
110114
111115 Card {
@@ -189,7 +193,10 @@ Rectangle {
189193 property Item summary: findChild(card, "summaryLabel")
190194
191195 function initTestCase() {
192− verify(testCase.header !== undefined, "Couldn't find header object.");
196+ verify(typeof testCase.header === "object", "Couldn't find header object.");
197+ verify(typeof testCase.art === "object", "Couldn't find art object.");
198+ verify(typeof testCase.artImage === "object", "Couldn't find artImage object.");
199+ verify(typeof testCase.summary === "object", "Couldn't find summary object.");
193200 }
194201
195202 function cleanup() {
@@ -237,6 +244,9 @@ Rectangle {
237244 { tag: "Large", width: units.gu(38), size: "large", index: 0 },
238245 { tag: "Wide", width: units.gu(18.5), aspect: 0.5, index: 0 },
239246 { tag: "Horizontal", width: units.gu(38), index: 5 },
247+ // Make sure card ends with header when there's no summary
248+ { tag: "NoSummary", height: function() { return header.y + header.height }, index: 6 },
249+ { tag: "HorizontalNoSummary", height: function() { return header.height }, card_layout: "horizontal", index: 6 },
240250 ]
241251 }
242252
@@ -248,6 +258,11 @@ Rectangle {
248258 card.templateChanged();
249259 }
250260
261+ if (data.hasOwnProperty("card_layout")) {
262+ card.template['card-layout'] = data.card_layout;
263+ card.templateChanged();
264+ }
265+
251266 if (data.hasOwnProperty("aspect")) {
252267 card.components['art']['aspect-ratio'] = data.aspect;
253268 card.componentsChanged();
@@ -257,7 +272,9 @@ Rectangle {
257272 tryCompare(card, "width", data.width);
258273 }
259274
260− if (data.hasOwnProperty("height")) {
275+ if (typeof data.height === "function") {
276+ tryCompareFunction(function() { return card.height === data.height() }, true);
277+ } else if (data.hasOwnProperty("height")) {
261278 tryCompare(card, "height", data.height);
262279 }
263280 }
@@ -308,7 +325,7 @@ Rectangle {
308325 function test_art_layout_data() {
309326 return [
310327 { tag: "Vertical", left: function() { return 0 }, index: 0},
311− { tag: "Horizontal", left: function() { return art.width }, index: 5 }
328+ { tag: "Horizontal", left: function() { return art.width }, index: 5 },
312329 ];
313330 }
314331
@@ -323,7 +340,7 @@ Rectangle {
323340 { tag: "Vertical", top: function() { return art.y + art.height },
324341 left: function() { return art.x }, index: 0 },
325342 { tag: "Horizontal", top: function() { return art.y },
326− left: function() { return art.x + art.width }, index: 5 }
343+ left: function() { return art.x + art.width }, index: 5 },
327344 ]
328345 }
329346
tests/qmltests/Dash/tst_CardHeader.qml+13−8
@@ -52,11 +52,11 @@ Rectangle {
5252 property Item column: findChild(cardHeader, "column")
5353
5454 function initTestCase() {
55− verify(testCase.mascot !== undefined, "Couldn't find mascot object.");
56− verify(testCase.titleLabel !== undefined, "Couldn't find titleLabel object.");
57− verify(testCase.subtitleLabel !== undefined, "Couldn't find subtitleLabel object.");
58− verify(testCase.prices !== undefined, "Couldn't find prices object.");
59− verify(testCase.oldPriceLabel !== undefined, "Couldn't find oldPriceLabel object.");
55+ verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");
56+ verify(typeof testCase.titleLabel === "object", "Couldn't find titleLabel object.");
57+ verify(typeof testCase.subtitleLabel === "object", "Couldn't find subtitleLabel object.");
58+ verify(typeof testCase.prices === "object", "Couldn't find prices object.");
59+ verify(typeof testCase.oldPriceLabel === "object", "Couldn't find oldPriceLabel object.");
6060 }
6161
6262 function cleanup() {
@@ -86,7 +86,7 @@ Rectangle {
8686 { tag: "Empty", visible: false },
8787 { tag: "Title only", title: "Foo", visible: true },
8888 { tag: "Subtitle only", subtitle: "Bar", visible: false },
89− { tag: "Both", title: "Foo", subtitle: "Bar", visible: true }
89+ { tag: "Both", title: "Foo", subtitle: "Bar", visible: true },
9090 ]
9191 }
9292
@@ -104,7 +104,7 @@ Rectangle {
104104 { tag: "Main and Alt", main: "$1.25", alt: "€1.00", visible: true },
105105 { tag: "Main and Old", main: "$1.25", old: "$2.00", visible: true, oldAlign: Text.AlignRight },
106106 { tag: "Alt and Old", alt: "€1.00", old: "$2.00", visible: false },
107− { tag: "All", main: "$1.25", alt: "€1.00", old: "$2.00", visible: true, oldAlign: Text.AlignHCenter }
107+ { tag: "All", main: "$1.25", alt: "€1.00", old: "$2.00", visible: true, oldAlign: Text.AlignHCenter },
108108 ]
109109 }
110110
@@ -121,7 +121,8 @@ Rectangle {
121121 function test_dimensions_data() {
122122 return [
123123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
124− { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" }
124+ { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
125+ { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } },
125126 ]
126127 }
127128
@@ -133,6 +134,10 @@ Rectangle {
133134 if (data.hasOwnProperty("width")) {
134135 tryCompare(data.object, "width", data.width);
135136 }
137+
138+ if (data.hasOwnProperty("height")) {
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
140+ }
136141 }
137142 }
138143}