Changeset View
Changeset View
Standalone View
Standalone View
sfos/qml/pages/mpris.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2015 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License or (at your option) version 3 or any later version | ||||
8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | * defined in Section 14 of version 3 of the license. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | import QtQuick 2.0 | ||||
22 | import Sailfish.Silica 1.0 | ||||
23 | import org.kde.kdeconnect 1.0 | ||||
24 | | ||||
25 | Page | ||||
26 | { | ||||
27 | id: root | ||||
28 | property QtObject pluginInterface | ||||
29 | | ||||
30 | Column | ||||
31 | { | ||||
32 | anchors.fill: parent | ||||
33 | PageHeader { title: "Multimedia Controls" } | ||||
34 | | ||||
35 | Component.onCompleted: { | ||||
36 | pluginInterface.requestPlayerList(); | ||||
37 | } | ||||
38 | | ||||
39 | Item { height: parent.height } | ||||
40 | ComboBox { | ||||
41 | label: "Player" | ||||
42 | width: parent.width | ||||
43 | onCurrentIndexChanged: root.pluginInterface.player = value | ||||
44 | | ||||
45 | menu: ContextMenu { | ||||
46 | Repeater { | ||||
47 | model: root.pluginInterface.playerList | ||||
48 | MenuItem { text: modelData } | ||||
49 | } | ||||
50 | } | ||||
51 | } | ||||
52 | Label { | ||||
53 | width: parent.width | ||||
54 | text: root.pluginInterface.nowPlaying | ||||
55 | } | ||||
56 | Row { | ||||
57 | width: parent.width | ||||
58 | IconButton { | ||||
59 | icon.source: "image://theme/icon-m-previous" | ||||
60 | onClicked: root.pluginInterface.sendAction("Previous") | ||||
61 | } | ||||
62 | IconButton { | ||||
63 | icon.source: root.pluginInterface.isPlaying ? "icon-m-image://theme/pause" : "image://theme/icon-m-play" | ||||
64 | onClicked: root.pluginInterface.sendAction("PlayPause"); | ||||
65 | } | ||||
66 | IconButton { | ||||
67 | icon.source: "image://theme/icon-m-next" | ||||
68 | onClicked: root.pluginInterface.sendAction("Next") | ||||
69 | } | ||||
70 | } | ||||
71 | Row { | ||||
72 | width: parent.width | ||||
73 | Label { text: ("Volume:") } | ||||
74 | Slider { | ||||
75 | value: root.pluginInterface.volume | ||||
76 | maximumValue: 100 | ||||
77 | width: parent.width | ||||
78 | } | ||||
79 | } | ||||
80 | Item { height: parent.height } | ||||
81 | } | ||||
82 | } |