Merge lp:~renatofilho/mediaplayer-app/fix-1233268 into lp:mediaplayer-app

Proposed by Renato Araujo Oliveira Filho
Status: Superseded
Proposed branch: lp:~renatofilho/mediaplayer-app/fix-1233268
Merge into: lp:mediaplayer-app
Diff against target: 167 lines (+50/-15)
3 files modified
po/mediaplayer-app.pot (+21/-11)
src/mediaplayer.cpp (+4/-2)
src/qml/player.qml (+25/-2)
To merge this branch: bzr merge lp:~renatofilho/mediaplayer-app/fix-1233268
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Bill Filler (community) Approve
Review via email: mp+188464@code.launchpad.net

This proposal has been superseded by a proposal from 2013-10-07.

Commit message

Show a error message if the app is called without a valid video filename.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
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/mediaplayer-app.pot'
2--- po/mediaplayer-app.pot 2013-09-24 15:26:09 +0000
3+++ po/mediaplayer-app.pot 2013-09-30 21:43:04 +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: 2013-06-12 09:10-0300\n"
9+"POT-Creation-Date: 2013-09-30 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@@ -17,47 +17,57 @@
14 "Content-Type: text/plain; charset=CHARSET\n"
15 "Content-Transfer-Encoding: 8bit\n"
16
17-#: src/qml/player/TimeLine.qml:133
18+#: src/qml/player/TimeLine.qml:132
19 #, qt-format
20 msgid "%1:%2:%3"
21 msgstr ""
22
23-#: src/qml/player/TimeLine.qml:102
24+#: src/qml/player/TimeLine.qml:101
25 #, qt-format
26 msgid "- %1"
27 msgstr ""
28
29-#: src/qml/player/TimeLine.qml:129 src/qml/player/TimeLine.qml:130
30-#: src/qml/player/TimeLine.qml:131
31+#: src/qml/player/TimeLine.qml:128 src/qml/player/TimeLine.qml:129
32+#: src/qml/player/TimeLine.qml:130
33 #, qt-format
34 msgid "0%1"
35 msgstr ""
36
37-#: src/qml/player/TimeLine.qml:69
38+#: src/qml/player/TimeLine.qml:68
39 msgid "0:00:00"
40 msgstr ""
41
42+#: src/qml/player.qml:62
43+msgid "Error"
44+msgstr ""
45+
46 #: data/mediaplayer-app.desktop.in:3 data/mediaplayer-app.desktop.in:4
47 #: data/mediaplayer-app.desktop.in:5
48 msgid "Media Player"
49 msgstr ""
50
51-#: src/qml/player.qml:159
52+#: src/qml/player.qml:63
53+msgid ""
54+"No video selected to play. Connect your phone to your computer to transfer "
55+"videos to the phone. Then select video from Videos lens."
56+msgstr ""
57+
58+#: src/qml/player.qml:177
59 msgid "Pause or Resume Playhead"
60 msgstr ""
61
62-#: src/qml/player.qml:158
63+#: src/qml/player.qml:176
64 msgid "Play / Pause"
65 msgstr ""
66
67-#: src/qml/player.qml:163
68+#: src/qml/player.qml:182
69 msgid "Post;Upload;Attach"
70 msgstr ""
71
72-#: src/qml/player.qml:162
73+#: src/qml/player.qml:181
74 msgid "Share"
75 msgstr ""
76
77-#: src/qml/player/TimeLine.qml:66
78+#: src/qml/player/TimeLine.qml:65
79 msgid "unknown"
80 msgstr ""
81
82=== modified file 'src/mediaplayer.cpp'
83--- src/mediaplayer.cpp 2013-09-25 23:08:08 +0000
84+++ src/mediaplayer.cpp 2013-09-30 21:43:04 +0000
85@@ -81,6 +81,7 @@
86 m_view->setColor(QColor("black"));
87 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
88 m_view->setTitle("Media Player");
89+ QUrl playUri;
90 if (args.count() >= 2) {
91 QUrl uri(args[1]);
92 if (uri.isRelative()) {
93@@ -91,18 +92,19 @@
94 if (uri.isValid() && uri.isLocalFile()) {
95 QFileInfo info(uri.toLocalFile());
96 if (info.exists() && info.isFile()) {
97- m_view->rootContext()->setContextProperty("playUri", uri);
98+ playUri = uri;
99 } else {
100 qWarning() << "File not found:" << uri << info.exists() << info.isFile();
101 }
102 // Otherwise see if it's a remote stream
103 } else if (uri.isValid()) {
104- m_view->rootContext()->setContextProperty("playUri", uri);
105+ playUri = uri;
106 } else {
107 qWarning() << "Invalid uri:" << uri;
108 }
109 }
110
111+ m_view->rootContext()->setContextProperty("playUri", playUri);
112 m_view->rootContext()->setContextProperty("screenWidth", m_view->size().width());
113 m_view->rootContext()->setContextProperty("screenHeight", m_view->size().height());
114 connect(m_view, SIGNAL(widthChanged(int)), SLOT(onWidthChanged(int)));
115
116=== modified file 'src/qml/player.qml'
117--- src/qml/player.qml 2013-09-03 15:24:02 +0000
118+++ src/qml/player.qml 2013-09-30 21:43:04 +0000
119@@ -23,6 +23,8 @@
120 import QtQuick.Window 2.0
121 import QtMultimedia 5.0
122 import Ubuntu.Unity.Action 1.0 as UnityActions
123+import Ubuntu.Components 0.1
124+import Ubuntu.Components.Popups 0.1 as Popups
125
126 Rectangle {
127 id: mediaPlayer
128@@ -51,6 +53,23 @@
129 i18n.domain = "mediaplayer-app"
130 }
131
132+ Component {
133+ id: dialogNoUrl
134+
135+ Popups.Dialog {
136+ id: dialogue
137+
138+ title: i18n.tr("Error")
139+ text: i18n.tr("No video selected to play. Connect your phone to your computer to transfer videos to the phone. Then select video from Videos lens.")
140+
141+ Button {
142+ text: "Ok"
143+ gradient: UbuntuColors.greyGradient
144+ onClicked: Qt.quit()
145+ }
146+ }
147+ }
148+
149 Loader {
150 id: playerLoader
151 source: "player/VideoPlayer.qml"
152@@ -58,9 +77,13 @@
153 anchors.fill: parent
154 clip: true
155 onLoaded: {
156- item.focus = true
157+ item.focus = true
158 item.rotating = Qt.binding(function () { return rotatingTransition.running } )
159- item.playUri(playUri)
160+ if (playUri != "") {
161+ item.playUri(playUri)
162+ } else {
163+ PopupUtils.open(dialogNoUrl, null)
164+ }
165 }
166
167 state: mediaPlayer.orientation != "" ? mediaPlayer.orientation : (screenHeight <= screenWidth ? "0" : "270")

Subscribers

People subscribed via source and target branches