@@ -1,227 +0,0 @@
2− * Copyright (C) 2013 Canonical, Ltd.
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.
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.
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/>.
18−import Ubuntu.Components 0.1
20−import "../../Components"
26− property alias ready: nfo.ready
27− property bool playable: fileUri != ""
28− readonly property url fileUri: item ? item.fileUri : ""
29− property url url: item ? item.nfoUri.replace(/\.nfo$/, "-fanart.jpg") : ""
33− source: item ? item.nfoUri : ""
36− previewWidthRatio: 0.6
38− onPreviewImageClicked: {
40− shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', root.fileUri);
44− // TODO: replace this UbuntuShape with the Video component once that lands
46− header: UbuntuShape {
48− anchors.left: parent.left
49− anchors.right: parent.right
50− height: width * previewImage.sourceSize.height / previewImage.sourceSize.width
56− fillMode: Image.PreserveAspectCrop
60− objectName: "playButton"
61− anchors.centerIn: parent
62− visible: root.playable
63− readonly property bool bigButton: parent.width > units.gu(40)
64− width: bigButton ? units.gu(8) : units.gu(4.5)
66− source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
70− id: previewImageMouseArea
72− onClicked: root.previewImageClicked()
78− objectName: "titleLabel"
84− elide: Text.ElideRight
86− font.weight: Font.Light
87− color: Theme.palette.selected.backgroundText
89− text: nfo.ready ? nfo.video.title : ""
97− property int buttonWidth: Math.min(units.gu(22), (width - spacing) / 2)
99− width: parent.buttonWidth
100− color: Theme.palette.selected.foreground
101− text: nfo.ready && nfo.video.buyPrice != "" ? "Buy for " + nfo.video.buyPrice : ""
103− iconSource: "graphics/icon_button_amazon.png"
104− iconPosition: "right"
107− width: parent.buttonWidth
108− color: Theme.palette.selected.foreground
109− text: nfo.ready && nfo.video.buyPrice != "" ? "Rent for " + nfo.video.rentPrice : ""
111− iconSource: "graphics/icon_button_u1.png"
112− iconPosition: "right"
117− spacing: units.gu(2)
119− maximumRating: 10 // FIXME: this should happen on the backend side
120− rating: nfo.ready ? nfo.video.rating: 0
124− text: nfo.ready ? nfo.video.plot : ""
125− color: Theme.palette.selected.backgroundText
129− wrapMode: Text.WordWrap
136− spacing: units.gu(1)
138− property int firstColWidth: units.gu(9)
139− property int secondColWidth: width - firstColWidth - spacing
141− visible: directedLabel.visible
145− horizontalAlignment: Text.AlignRight
146− width: parent.firstColWidth
147− text: i18n.tr("Directed by:")
157− width: parent.secondColWidth
158− text: nfo.ready ? nfo.video.director : ""
161− wrapMode: Text.WordWrap
164− visible: starringLabel.visible
167− horizontalAlignment: Text.AlignRight
169− width: parent.firstColWidth
170− text: i18n.tr("Starring:")
180− width: parent.secondColWidth
181− text: nfo.ready ? nfo.getActors().join(", ") : ""
182− wrapMode: Text.WordWrap
187− visible: authorLabel.visible
190− horizontalAlignment: Text.AlignRight
192− width: parent.firstColWidth
193− text: i18n.tr("Author:")
203− width: parent.secondColWidth
204− text: nfo.ready ? nfo.video.author : ""
205− wrapMode: Text.WordWrap
218− if (nfo.video.year) parts.push(nfo.video.year)
219− if (nfo.video.runtime) parts.push("%1 minutes".arg(nfo.video.runtime))
221− return parts.join(", ");