on xenial help sign in
reverted file changes
commit19075dd049d630fb26b514c660e5fc00255b04a8 authorNick Dedekind <nick.dedekind@canonical.com> dateThu 9 Jul 2015, 17:03 (11 years ago) parente017f91
8 files changed+302−142
po/unity8.pot+45−61 qml/Components/MediaServices/VideoPlayerControls.qml+2−2 qml/Dash/Previews/PreviewInlineVideo.qml+89 qml/Dash/Previews/PreviewVideoPlayback.qml+41−15 qml/Dash/Previews/PreviewWidgetFactory.qml+1−1 tests/qmltests/CMakeLists.txt+1−1 tests/qmltests/Dash/Previews/tst_PreviewInlineVideo.qml+106 tests/qmltests/Dash/Previews/tst_PreviewVideoPlayback.qml+17−62
po/unity8.pot+45−61
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2015-07-08 10:55+0100\n"
11+"POT-Creation-Date: 2015-06-22 12:00+0200\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -223,22 +223,6 @@ msgstr ""
223223msgid "OK"
224224msgstr ""
225225
226−#. Translators: this refers to a duration/remaining time of the video in hours, minutes and seconds,
227−#. of which you can change the order.
228−#. %1 refers to hours, %2 refers to minutes and %3 refers to seconds.
229−#: qml/Components/MediaServices/VideoPlayerControls.qml:44
230−#, qt-format
231−msgid "%1:%2:%3"
232−msgstr ""
233−
234−#. Translators: this refers to a duration/remaining time of the video in minutes and seconds,
235−#. of which you can change the order.
236−#. %1 refers to minutes and %2 refers to seconds.
237−#: qml/Components/MediaServices/VideoPlayerControls.qml:49
238−#, qt-format
239−msgid "%1:%2"
240−msgstr ""
241−
242226#: qml/Dash/GenericScopeView.qml:532 qml/Dash/GenericScopeView.qml:690
243227msgid "See less"
244228msgstr ""
@@ -331,57 +315,57 @@ msgstr ""
331315msgid "Tap to unlock"
332316msgstr ""
333317
334−#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:53
318+#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
335319msgid "Sorry, incorrect passphrase."
336320msgstr ""
337321
338−#: qml/Greeter/NarrowView.qml:55 qml/Wizard/Pages/passwd-confirm.qml:54
322+#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:54
339323msgid "Sorry, incorrect passcode."
340324msgstr ""
341325
342−#: qml/Greeter/NarrowView.qml:56
326+#: qml/Greeter/NarrowView.qml:55
343327msgid "This will be your last attempt."
344328msgstr ""
345329
346−#: qml/Greeter/NarrowView.qml:58
330+#: qml/Greeter/NarrowView.qml:57
347331msgid ""
348332"If passphrase is entered incorrectly, your phone will conduct a factory "
349333"reset and all personal data will be deleted."
350334msgstr ""
351335
352−#: qml/Greeter/NarrowView.qml:59
336+#: qml/Greeter/NarrowView.qml:58
353337msgid ""
354338"If passcode is entered incorrectly, your phone will conduct a factory reset "
355339"and all personal data will be deleted."
356340msgstr ""
357341
358−#: qml/Greeter/NarrowView.qml:116
342+#: qml/Greeter/NarrowView.qml:115
359343#, qt-format
360344msgid "Enter %1"
361345msgstr ""
362346
363−#: qml/Greeter/NarrowView.qml:117 qml/Wizard/Pages/passwd-set.qml:60
347+#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
364348msgid "Enter passphrase"
365349msgstr ""
366350
367−#: qml/Greeter/NarrowView.qml:118
351+#: qml/Greeter/NarrowView.qml:117
368352msgid "Enter passcode"
369353msgstr ""
370354
371−#: qml/Greeter/NarrowView.qml:119
355+#: qml/Greeter/NarrowView.qml:118
372356#, qt-format
373357msgid "Sorry, incorrect %1"
374358msgstr ""
375359
376−#: qml/Greeter/NarrowView.qml:120
360+#: qml/Greeter/NarrowView.qml:119
377361msgid "Sorry, incorrect passphrase"
378362msgstr ""
379363
380−#: qml/Greeter/NarrowView.qml:121
364+#: qml/Greeter/NarrowView.qml:120
381365msgid "Please re-enter"
382366msgstr ""
383367
384−#: qml/Greeter/NarrowView.qml:122
368+#: qml/Greeter/NarrowView.qml:121
385369msgid "Sorry, incorrect passcode"
386370msgstr ""
387371
@@ -531,6 +515,38 @@ msgctxt "Button: Go back one page in the Wizard"
531515msgid "Back"
532516msgstr ""
533517
518+#: qml/Wizard/Pages/here-terms.qml:27
519+msgid "Terms & Conditions"
520+msgstr ""
521+
522+#: qml/Wizard/Pages/passwd-confirm.qml:49
523+msgid "Confirm passphrase"
524+msgstr ""
525+
526+#: qml/Wizard/Pages/passwd-confirm.qml:50
527+msgid "Confirm passcode"
528+msgstr ""
529+
530+#: qml/Wizard/Pages/passwd-confirm.qml:53
531+#: qml/Wizard/Pages/passwd-confirm.qml:54
532+msgid "Please try again."
533+msgstr ""
534+
535+#: qml/Wizard/Pages/passwd-confirm.qml:82 qml/Wizard/Pages/passwd-set.qml:90
536+#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
537+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
538+#: qml/Wizard/Pages/60-reporting.qml:50
539+msgid "Continue"
540+msgstr ""
541+
542+#: qml/Wizard/Pages/passwd-set.qml:61
543+msgid "Choose your passcode"
544+msgstr ""
545+
546+#: qml/Wizard/Pages/passwd-set.qml:68
547+msgid "Passphrase must be 4 characters long"
548+msgstr ""
549+
534550#: qml/Wizard/Pages/10-welcome.qml:27
535551msgid "Hi!"
536552msgstr ""
@@ -543,13 +559,6 @@ msgstr ""
543559msgid "Let’s get started."
544560msgstr ""
545561
546−#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
547−#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
548−#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
549−#: qml/Wizard/Pages/passwd-set.qml:90
550−msgid "Continue"
551−msgstr ""
552−
553562#: qml/Wizard/Pages/20-sim.qml:25
554563msgid "Add a SIM card and restart your device"
555564msgstr ""
@@ -675,31 +684,6 @@ msgstr ""
675684msgid "Finish"
676685msgstr ""
677686
678−#: qml/Wizard/Pages/here-terms.qml:27
679−msgid "Terms & Conditions"
680−msgstr ""
681−
682−#: qml/Wizard/Pages/passwd-confirm.qml:49
683−msgid "Confirm passphrase"
684−msgstr ""
685−
686−#: qml/Wizard/Pages/passwd-confirm.qml:50
687−msgid "Confirm passcode"
688−msgstr ""
689−
690−#: qml/Wizard/Pages/passwd-confirm.qml:53
691−#: qml/Wizard/Pages/passwd-confirm.qml:54
692−msgid "Please try again."
693−msgstr ""
694−
695−#: qml/Wizard/Pages/passwd-set.qml:61
696−msgid "Choose your passcode"
697−msgstr ""
698−
699−#: qml/Wizard/Pages/passwd-set.qml:68
700−msgid "Passphrase must be 4 characters long"
701−msgstr ""
702−
703687#. Translators: This is the arrow for "Back" buttons
704688#: qml/Wizard/StackButton.qml:39
705689#, qt-format
qml/Components/MediaServices/VideoPlayerControls.qml+2−2
@@ -38,12 +38,12 @@ MediaServicesControls {
3838 if (secs < 10) secs = "0%1".arg(secs);
3939 if (min < 10) min = "0%1".arg(min);
4040 if (hour > 0) {
41− // Translators: this refers to a duration/remaining time of the video in hours, minutes and seconds,
41+ // TRANSLATORS: this refers to a duration/remaining time of the video in hours, minutes and seconds,
4242 // of which you can change the order.
4343 // %1 refers to hours, %2 refers to minutes and %3 refers to seconds.
4444 return i18n.tr("%1:%2:%3").arg(hour).arg(min).arg(secs);
4545 } else {
46− // Translators: this refers to a duration/remaining time of the video in minutes and seconds,
46+ // TRANSLATORS: this refers to a duration/remaining time of the video in minutes and seconds,
4747 // of which you can change the order.
4848 // %1 refers to minutes and %2 refers to seconds.
4949 return i18n.tr("%1:%2").arg(min).arg(secs);
qml/Dash/Previews/PreviewInlineVideo.qmlnew file+89
@@ -0,0 +1,89 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtMultimedia 5.0
19+import Ubuntu.Components 1.2
20+import Ubuntu.Thumbnailer 0.1
21+//import Ubuntu.Content 0.1
22+import "../../Components/MediaServices"
23+
24+/*! \brief Preview widget for video.
25+
26+ This widget shows video contained in widgetData["source"],
27+ with a placeholder screenshot specified by widgetData["screenshot"].
28+ */
29+
30+PreviewWidget {
31+ id: root
32+ implicitWidth: units.gu(35)
33+ implicitHeight: services.height
34+
35+ property alias rootItem: services.rootItem
36+
37+ MediaServices {
38+ id: services
39+ width: parent.width
40+
41+ context: "video"
42+ sourceData: root.isCurrentPreview ? widgetData : undefined
43+ fullscreen: false
44+ maximumEmbeddedHeight: rootItem.height / 2
45+
46+ onClose: fullscreen = false
47+
48+// actions: [
49+// Action {
50+// text: i18n.tr("Share")
51+// iconSource: "image://theme/share"
52+// onTriggered: sharePicker.visible = true
53+// }
54+// ]
55+ }
56+
57+// Component {
58+// id: contentItemComp
59+// ContentItem {
60+// url: widgetData["source"]
61+// }
62+// }
63+// ContentPeerPicker {
64+// id: sharePicker
65+// objectName: "sharePickerEvents"
66+// anchors.fill: parent
67+// showTitle: false
68+// visible: false
69+// parent: rootItem
70+// z: 100
71+
72+// contentType: ContentType.Videos
73+// handler: ContentHandler.Share
74+
75+// onPeerSelected: {
76+// visible = false;
77+
78+// var curTransfer = peer.request();
79+// if (curTransfer.state === ContentTransfer.InProgress)
80+// {
81+// var medias = [ contentItemComp.createObject(parent) ]
82+// curTransfer.state = ContentTransfer.Charged;
83+// }
84+// }
85+// onCancelPressed: {
86+// visible = false;
87+// }
88+// }
89+}
qml/Dash/Previews/PreviewVideoPlayback.qml+41−15
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -15,11 +15,9 @@
1515 */
1616
1717import QtQuick 2.0
18−import QtMultimedia 5.0
19−import Ubuntu.Components 1.2
18+import Ubuntu.Components 0.1
2019import Ubuntu.Thumbnailer 0.1
21−//import Ubuntu.Content 0.1
22−import "../../Components/MediaServices"
20+import "../../Components"
2321
2422/*! \brief Preview widget for video.
2523
@@ -30,19 +28,47 @@ import "../../Components/MediaServices"
3028PreviewWidget {
3129 id: root
3230 implicitWidth: units.gu(35)
33− implicitHeight: services.height
31+ implicitHeight: childrenRect.height
3432
35− property alias rootItem: services.rootItem
33+ LazyImage {
34+ objectName: "screenshot"
35+ anchors {
36+ left: parent.left
37+ right: parent.right
38+ }
39+ scaleTo: "width"
40+ source: {
41+ var screenshot = widgetData["screenshot"];
42+ if (screenshot) return screenshot;
3643
37− MediaServices {
38− id: services
39− width: parent.width
44+ var source = widgetData["source"];
45+ if (source) {
46+ if (source.toString().indexOf("file://") === 0) {
47+ return "image://thumbnailer/" + source.toString().substr(7);
48+ }
49+ }
4050
41− context: "video"
42− sourceData: root.isCurrentPreview ? widgetData : undefined
43− fullscreen: false
44− maximumEmbeddedHeight: rootItem.height / 2
51+ return "";
52+ }
53+ initialHeight: width * 10 / 16
4554
46− onClose: fullscreen = false
55+ Image {
56+ objectName: "playButton"
57+
58+ readonly property bool bigButton: parent.width > units.gu(40)
59+
60+ anchors.centerIn: parent
61+ width: bigButton ? units.gu(8) : units.gu(4.5)
62+ height: width
63+ source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
64+ visible: parent.state === "ready"
65+ }
66+
67+ MouseArea {
68+ enabled: parent.state === "ready"
69+ id: previewImageMouseArea
70+ anchors.fill: parent
71+ onClicked: Qt.openUrlExternally(widgetData["source"])
72+ }
4773 }
4874}
qml/Dash/Previews/PreviewWidgetFactory.qml+1−1
@@ -61,7 +61,7 @@ Loader {
6161 case "reviews": return "PreviewRatingDisplay.qml";
6262 case "table": return "PreviewTable.qml";
6363 case "text": return "PreviewTextSummary.qml";
64− case "video": return "PreviewVideoPlayback.qml";
64+ case "video": return "PreviewInlineVideo.qml";
6565 default: return "";
6666 }
6767 }
tests/qmltests/CMakeLists.txt+1−1
@@ -10,7 +10,6 @@ add_unity8_qmltest(Components Dialogs LIGHTDM)
1010add_unity8_qmltest(Components DraggingArea)
1111add_unity8_qmltest(Components LazyImage)
1212add_unity8_qmltest(Components Lockscreen)
13−add_unity8_qmltest(Components MediaServices)
1413add_unity8_qmlunittest(Components PhysicalKeysMapper)
1514add_unity8_qmltest(Components Rating)
1615add_unity8_qmltest(Components ResponsiveGridView)
@@ -31,6 +30,7 @@ add_unity8_qmltest(Dash/Previews PreviewAudioPlayback)
3130add_unity8_qmltest(Dash/Previews PreviewExpandable)
3231add_unity8_qmltest(Dash/Previews PreviewHeader)
3332add_unity8_qmltest(Dash/Previews PreviewImageGallery)
33+add_unity8_qmltest(Dash/Previews PreviewInlineVideo)
3434add_unity8_qmltest(Dash/Previews PreviewPayments)
3535add_unity8_qmltest(Dash/Previews PreviewProgress)
3636add_unity8_qmltest(Dash/Previews PreviewRatingDisplay)
tests/qmltests/Dash/Previews/tst_PreviewInlineVideo.qmlnew file+106
@@ -0,0 +1,106 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import "../../../../qml/Dash/Previews"
20+import Unity.Test 0.1 as UT
21+import Ubuntu.Components 1.2
22+import QtMultimedia 5.0
23+
24+Rectangle {
25+ width: units.gu(70)
26+ height: units.gu(80)
27+ color: "lightgrey"
28+
29+ property var widgetData0: {
30+ "source": "file:///test-video1",
31+ "screenshot": Qt.resolvedUrl("../artwork/avatar.png")
32+ }
33+
34+ property var widgetData1: {
35+ "source": "file:///test-video2",
36+ "screenshot": "file:///test-video2-screenshot"
37+ }
38+
39+ MediaDataSource {
40+ source: "file:///test-video1"
41+ duration: 6000000
42+ metaData: {
43+ "title" : "TEST MPEG",
44+ "resolution" : { "width": 1920, "height": 1080 }
45+ }
46+ }
47+
48+ Item {
49+ anchors.fill: parent
50+
51+ Item {
52+ id: inner
53+ anchors {
54+ top: parent.top
55+ bottom: parent.bottom
56+ left: parent.left
57+ right: controls.left
58+ }
59+
60+ Item {
61+ anchors.fill: parent
62+ anchors.margins: units.gu(2)
63+
64+ PreviewInlineVideo {
65+ id: videoPlayback
66+ width: parent.width
67+ widgetData: widgetData0
68+
69+ rootItem: inner
70+ }
71+ }
72+
73+ }
74+
75+ Rectangle {
76+ id: controls
77+ color: "darkgrey"
78+ anchors {
79+ top: parent.top
80+ bottom: parent.bottom
81+ right: parent.right
82+ }
83+ width: units.gu(30)
84+
85+ Column {
86+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
87+
88+ UT.MouseTouchEmulationCheckbox {}
89+ }
90+ }
91+ }
92+
93+ UT.UnityTestCase {
94+ name: "PreviewInlineVideoTest"
95+ when: windowShown
96+
97+ function test_loadScreenshot() {
98+ var screenshot = findChild(videoPlayback, "screenshot");
99+ verify(screenshot !== null);
100+
101+ videoPlayback.widgetData = widgetData1;
102+ var screenshotSource = screenshot.source
103+ compare(screenshotSource.toString(), "file:///test-video2-screenshot");
104+ }
105+ }
106+}
tests/qmltests/Dash/Previews/tst_PreviewVideoPlayback.qml+17−62
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2015 Canonical Ltd.
2+ * Copyright 2014 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -18,89 +18,44 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 1.2
22−import QtMultimedia 5.0
2321
2422Rectangle {
25− width: units.gu(70)
23+ id: root
24+ width: units.gu(40)
2625 height: units.gu(80)
2726 color: "lightgrey"
2827
2928 property var widgetData0: {
30− "source": "file:///test-video1",
31− "screenshot": Qt.resolvedUrl("../artwork/avatar.png")
29+ "source": "",
30+ "screenshot": ""
3231 }
3332
3433 property var widgetData1: {
35− "source": "file:///test-video2",
36− "screenshot": "file:///test-video2-screenshot"
34+ "source": "",
35+ "screenshot": "../../../tests/qmltests/Components/tst_LazyImage/square.png"
3736 }
3837
39− MediaDataSource {
40− source: "file:///test-video1"
41− duration: 6000000
42− metaData: {
43− "title" : "TEST MPEG",
44− "resolution" : { "width": 1920, "height": 1080 }
45− }
38+ property var widgetData2: {
39+ "source": "file:///path/to/local/file",
40+ "screenshot": ""
4641 }
4742
48− Item {
49− anchors.fill: parent
50−
51− Item {
52− id: inner
53− anchors {
54− top: parent.top
55− bottom: parent.bottom
56− left: parent.left
57− right: controls.left
58− }
59−
60− Item {
61− anchors.fill: parent
62− anchors.margins: units.gu(2)
63−
64− PreviewVideoPlayback {
65− id: videoPlayback
66− width: parent.width
67− widgetData: widgetData0
68−
69− rootItem: inner
70− }
71− }
72−
73− }
74−
75− Rectangle {
76− id: controls
77− color: "darkgrey"
78− anchors {
79− top: parent.top
80− bottom: parent.bottom
81− right: parent.right
82− }
83− width: units.gu(30)
84−
85− Column {
86− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
87−
88− UT.MouseTouchEmulationCheckbox {}
89− }
90− }
43+ PreviewVideoPlayback {
44+ id: videoPlayback
45+ width: parent.width
46+ widgetData: widgetData1
9147 }
9248
9349 UT.UnityTestCase {
94− name: "PreviewInlineVideoTest"
50+ name: "PreviewVideoPlaybackTest"
9551 when: windowShown
9652
9753 function test_loadScreenshot() {
9854 var screenshot = findChild(videoPlayback, "screenshot");
99− verify(screenshot !== null);
10055
101− videoPlayback.widgetData = widgetData1;
56+ videoPlayback.widgetData = widgetData2;
10257 var screenshotSource = screenshot.source
103− compare(screenshotSource.toString(), "file:///test-video2-screenshot");
58+ verify(screenshotSource.toString().indexOf("image://thumbnailer/") === 0)
10459 }
10560 }
10661}