diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b65c3978..4f771c7d 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,44 +1,47 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/core) add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-plugins\") install(FILES kdeconnect_plugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) add_subdirectory(ping) add_subdirectory(battery) add_subdirectory(sendnotifications) add_subdirectory(clipboard) +if (NOT WIN32) + add_subdirectory(mpriscontrol) +endif() + if(NOT SAILFISHOS) add_subdirectory(contacts) add_subdirectory(share) add_subdirectory(remotekeyboard) add_subdirectory(notifications) add_subdirectory(findmyphone) add_subdirectory(telephony) add_subdirectory(mousepad) if(NOT WIN32) add_subdirectory(runcommand) add_subdirectory(pausemusic) - add_subdirectory(mpriscontrol) add_subdirectory(screensaver-inhibit) add_subdirectory(sftp) endif() if(Phonon4Qt5_FOUND) add_subdirectory(findthisdevice) endif() endif() if(SAILFISHOS OR EXPERIMENTALAPP_ENABLED) add_subdirectory(remotecommands) add_subdirectory(mprisremote) add_subdirectory(remotecontrol) add_subdirectory(lockdevice) endif() if(KF5PulseAudioQt_FOUND) add_subdirectory(systemvolume) endif() #FIXME: If we split notifications in several files, they won't appear in the same group in the Notifications KCM install(FILES kdeconnect.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) diff --git a/sfos/qml/pages/mpris.qml b/sfos/qml/pages/mpris.qml index 1b0c7268..4fb0b5c5 100644 --- a/sfos/qml/pages/mpris.qml +++ b/sfos/qml/pages/mpris.qml @@ -1,82 +1,138 @@ /* * Copyright 2015 Aleix Pol Gonzalez * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import Sailfish.Silica 1.0 +import QtQuick.Layouts 1.0 import org.kde.kdeconnect 1.0 Page { id: root property QtObject pluginInterface - Column + Label { + id: noPlayersText + text: "No players available" + anchors.centerIn: parent + visible: pluginInterface.playerList.length == 0 + } + ColumnLayout { anchors.fill: parent + anchors.margins: Theme.paddingMedium PageHeader { title: "Multimedia Controls" } + visible: !noPlayersText.visible - Component.onCompleted: { - pluginInterface.requestPlayerList(); - } - - Item { height: parent.height } ComboBox { label: "Player" - width: parent.width + Layout.fillWidth: true onCurrentIndexChanged: root.pluginInterface.player = value menu: ContextMenu { Repeater { model: root.pluginInterface.playerList MenuItem { text: modelData } } } } + Label { - width: parent.width + id: nowPlaying + Layout.fillWidth: true text: root.pluginInterface.nowPlaying + visible: root.pluginInterface.title.length == 0 + wrapMode: Text.Wrap + } + Label { + Layout.fillWidth: true + text: root.pluginInterface.title + visible: !nowPlaying.visible + wrapMode: Text.Wrap + } + Label { + Layout.fillWidth: true + text: root.pluginInterface.artist + visible: !nowPlaying.visible && !artistAlbum.visible && root.pluginInterface.artist.length > 0 + wrapMode: Text.Wrap + } + Label { + Layout.fillWidth: true + text: root.pluginInterface.album + visible: !nowPlaying.visible && !artistAlbum.visible && root.pluginInterface.album.length > 0 + wrapMode: Text.Wrap } - Row { - width: parent.width + Label { + id: artistAlbum + Layout.fillWidth: true + text: "%1 - %2", root.pluginInterface.artist, root.pluginInterface.album + visible: !nowPlaying.visible && root.pluginInterface.album.length > 0 && root.pluginInterface.artist.length > 0 + wrapMode: Text.Wrap + } + + RowLayout { + Layout.fillWidth: true + height: childrenRect.height IconButton { + id: btnPrev + Layout.fillWidth: true icon.source: "image://theme/icon-m-previous" onClicked: root.pluginInterface.sendAction("Previous") } IconButton { - icon.source: root.pluginInterface.isPlaying ? "icon-m-image://theme/pause" : "image://theme/icon-m-play" + id: btnPlay + Layout.fillWidth: true + icon.source: root.pluginInterface.isPlaying ? "image://theme/icon-m-pause" : "image://theme/icon-m-play" onClicked: root.pluginInterface.sendAction("PlayPause"); } IconButton { + id: btnNext + Layout.fillWidth: true icon.source: "image://theme/icon-m-next" onClicked: root.pluginInterface.sendAction("Next") } } - Row { - width: parent.width - Label { text: ("Volume:") } - Slider { - value: root.pluginInterface.volume - maximumValue: 100 - width: parent.width + + Slider { + id: sldVolume + label: "Volume" + maximumValue: 100 + Layout.fillWidth: true + //value: root.pluginInterface.volume + onValueChanged: { + root.pluginInterface.volume = value; } } + Item { height: parent.height } } + + + Connections { + target: root.pluginInterface + onPropertiesChanged: { + sldVolume.value = root.pluginInterface.volume; + } + } + + Component.onCompleted: { + pluginInterface.requestPlayerList(); + } } diff --git a/sfos/rpm/kdeconnect-sfos.spec b/sfos/rpm/kdeconnect-sfos.spec index e8a880c0..72ca2582 100644 --- a/sfos/rpm/kdeconnect-sfos.spec +++ b/sfos/rpm/kdeconnect-sfos.spec @@ -1,85 +1,86 @@ # # Do NOT Edit the Auto-generated Part! # Generated by: spectacle version 0.27 # Name: kdeconnect-sfos # >> macros # << macros Summary: KDEConnect client for Sailfish Version: 0.1 Release: 1 Group: Qt/Qt License: LICENSE URL: http://example.org/ Source0: %{name}-%{version}.tar.bz2 Source100: kdeconnect-sfos.yaml Requires: sailfishsilica-qt5 >= 0.10.9 +Requires: qt5-qtquickcontrols-layouts BuildRequires: pkgconfig(sailfishapp) >= 1.0.2 BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Quick) BuildRequires: pkgconfig(nemonotifications-qt5) BuildRequires: pkgconfig(qca2-qt5) >= 2.0.0 BuildRequires: desktop-file-utils BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= 5.31.0 BuildRequires: kcoreaddons-devel >= 5.31.0 BuildRequires: kdbusaddons-devel >= 5.31.0 BuildRequires: ki18n-devel >= 5.31.0 BuildRequires: kconfig-devel >= 5.31.0 BuildRequires: kiconthemes-devel >= 5.31.0 %description Short description of my Sailfish OS Application %prep %setup -q # >> setup # << setup %build # >> build pre # << build pre mkdir -p build cd build %cmake .. -DSAILFISHOS=YES make %{?jobs:-j%jobs} # >> build post # << build post %install rm -rf %{buildroot} # >> install pre # << install pre pushd build %make_install popd # >> install post # << install post desktop-file-install --delete-original \ --dir %{buildroot}%{_datadir}/applications \ %{buildroot}%{_datadir}/applications/*.desktop %files %defattr(-,root,root,-) %{_bindir} %{_libdir} %{_datadir}/%{name} %{_datadir}/applications/%{name}.desktop /etc/xdg/autostart/kdeconnectd.desktop /usr/share/dbus-1/services/org.kde.kdeconnect.service /usr/share/knotifications5/kdeconnect.notifyrc /usr/share/kservicetypes5/kdeconnect_plugin.desktop #%{_datadir}/icons/hicolor/*/apps/%{name}.png /usr/share/icons/ # >> files # << files