diff --git a/CMakeLists.txt b/CMakeLists.txt index 1563569efddb3481d278c64c0e54dc63534e45f3..48c9e6358582ed47dc0b67124cc6b0c969441364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS ) add_subdirectory(src) +add_subdirectory(plasmoid) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/plasmoid/CMakeLists.txt b/plasmoid/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..529f2abce8c364538ddf507cb9eccdeab154183a --- /dev/null +++ b/plasmoid/CMakeLists.txt @@ -0,0 +1,3 @@ +find_package(KF5Plasma REQUIRED) + +plasma_install_package(package org.eyecreate.simplecastplasmoid) diff --git a/plasmoid/Messages.sh b/plasmoid/Messages.sh new file mode 100644 index 0000000000000000000000000000000000000000..a75b5dc307798fee3e5e7b9bdc66c1d48d50fd83 --- /dev/null +++ b/plasmoid/Messages.sh @@ -0,0 +1,2 @@ +#! /usr/bin/env bash +$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.simplecastplasmoid.pot diff --git a/plasmoid/README b/plasmoid/README new file mode 100644 index 0000000000000000000000000000000000000000..caf097a7ba3ecda24dda48e116fa3457970e502b --- /dev/null +++ b/plasmoid/README @@ -0,0 +1,31 @@ +Simple Cast Plasma Applet +---------------------- +Goes with Simple Cast DataEngine to display and start service to allow casting/streaming Youtube and Bandcamp audio on device. + + +-- Build instructions -- + +cd /where/your/applet/is/generated +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. +make +make install + +(MYPREFIX is where you install your Plasma setup, replace it accordingly) + +Restart plasma to load the applet +(in a terminal type: +kquitapp plasmashell +and then +plasmashell) + +or view it with +plasmoidviewer -a YourAppletName + +-- Tutorials and resources -- +The explanation of the template +https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted + +Plasma QML API explained +https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml new file mode 100644 index 0000000000000000000000000000000000000000..1605c16f7fe8efe35dbd875f0db9a7718c74c082 --- /dev/null +++ b/plasmoid/package/contents/ui/main.qml @@ -0,0 +1,93 @@ +/*************************************************************************** + * Copyright (C) 2019 by Kevin Whiaker * + * * + * 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) any later version. * + * * + * 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, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.1 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras + +Item { + Plasmoid.fullRepresentation: ColumnLayout { + Layout.minimumWidth: units.gridUnit * 20 + Layout.minimumHeight: units.gridUnit * 10 + + PlasmaExtras.ScrollArea { + id:scrollingList + Layout.fillHeight: true + Layout.fillWidth: true + ListView { + id:trackList + delegate:PlasmaComponents.ListItem { + checked: index==0?true:false + content: Text{ + text:modelData + } + } + } + } + PlasmaCore.DataSource { + id:castSource + engine: "simplecast" + connectedSources: ["Playlist","CurrentState"] + interval: 500 + onNewData: { + if(sourceName == "Playlist") + { + trackList.model = data.trackNames; + } + } + } + RowLayout { + PlasmaComponents.Button { + iconSource: castSource.data.CurrentState.playingState?"media-playback-pause":"media-playback-start" + onClicked: { + var service = castSource.serviceForSource("CurrentState"); + var playPause = service.operationDescription("changePlayState"); + playPause.playing = !castSource.data.CurrentState.playingState; + service.startOperationCall(playPause); + } + } + PlasmaComponents.Button { + iconSource: "media-skip-forward" + onClicked: { + var service = castSource.serviceForSource("CurrentState"); + var nextTrack = service.operationDescription("skipToNextTrack"); + service.startOperationCall(nextTrack); + } + } + PlasmaComponents.TextField { + Layout.fillWidth: true + Layout.minimumWidth: units.gridWidth * 10 + id:url + } + PlasmaComponents.Button { + text:"Add URL" + onClicked: { + var service = castSource.serviceForSource("CurrentState"); + var loadTrack = service.operationDescription("addURLToPlaylist"); + loadTrack.URL = url.text; + service.startOperationCall(loadTrack); + } + } + } + } + //TODO: Plasmoid.compactRepresentation? +} diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop new file mode 100644 index 0000000000000000000000000000000000000000..aed52207967dc53fe9254e2c04132fd7b0851efa --- /dev/null +++ b/plasmoid/package/metadata.desktop @@ -0,0 +1,95 @@ +[Desktop Entry] +Name=SimpleCastPlasmoid +Name[ar]=SimpleCastPlasmoid +Name[ca]=SimpleCastPlasmoid +Name[ca@valencia]=SimpleCastPlasmoid +Name[cs]=SimpleCastPlasmoid +Name[da]=SimpleCastPlasmoid +Name[de]=SimpleCastPlasmoid +Name[en_GB]=SimpleCastPlasmoid +Name[es]=SimpleCastPlasmoid +Name[et]=SimpleCastPlasmoid +Name[eu]=SimpleCastPlasmoid +Name[fi]=SimpleCastPlasmoid +Name[fr]=SimpleCastPlasmoid +Name[gd]=SimpleCastPlasmoid +Name[gl]=SimpleCastPlasmoid +Name[hu]=SimpleCastPlasmoid +Name[ia]=SimpleCastPlasmoid +Name[id]=SimpleCastPlasmoid +Name[it]=SimpleCastPlasmoid +Name[ko]=SimpleCastPlasmoid +Name[nb]=SimpleCastPlasmoid +Name[nl]=SimpleCastPlasmoid +Name[nn]=SimpleCastPlasmoid +Name[pl]=SimpleCastPlasmoid +Name[pt]=SimpleCastPlasmoid +Name[pt_BR]=SimpleCastPlasmoid +Name[ru]=SimpleCastPlasmoid +Name[sk]=SimpleCastPlasmoid +Name[sl]=SimpleCastPlasmoid +Name[sr]=SimpleCastPlasmoid +Name[sr@ijekavian]=SimpleCastPlasmoid +Name[sr@ijekavianlatin]=SimpleCastPlasmoid +Name[sr@latin]=SimpleCastPlasmoid +Name[sv]=SimpleCastPlasmoid +Name[tr]=SimpleCastPlasmoid +Name[uk]=SimpleCastPlasmoid +Name[x-test]=xxSimpleCastPlasmoidxx +Name[zh_CN]=SimpleCastPlasmoid +Name[zh_TW]=SimpleCastPlasmoid +Comment=what your app does in a few words +Comment[ar]=ما يفعله تطبيقك ببضع كلمات +Comment[ca]=Què fa aquesta aplicació en poques paraules +Comment[ca@valencia]=Què fa aquesta aplicació en poques paraules +Comment[da]=nogle få ord om hvad din app gør +Comment[de]=In ein paar Worten, was Ihre Anwendung tut +Comment[en_GB]=what your app does in a few words +Comment[es]=lo que hace su aplicación, en pocas palabras +Comment[et]=Mõne sõnaga, mida rakendus teeb +Comment[eu]=zure aplikazioak egiten duena hitz gutxitan +Comment[fi]=ohjelmasi toiminta muutamalla sanalla +Comment[fr]=que fait votre application en quelques mots +Comment[gd]=na nì an aplacaid agad ann am beagan fhaclan +Comment[gl]=o que fai o seu aplicativo en poucas palabras +Comment[hu]=Írja le néhány szóba, mit csinál az alkalmazása! +Comment[ia]=cosa tu app face in pauc parolas +Comment[id]=app apa yang kamu lakukan dalam beberapa kata +Comment[it]=Cosa fa la tua applicazione in poche parole +Comment[ko]=프로그램이 하는 일에 대한 간단한 설명 +Comment[nb]=hva programmet gjør, med noen få ord +Comment[nl]=wat uw app doet in een paar woorden +Comment[nn]=nokre få ord om kva programmet gjer +Comment[pl]=w kilku słowach opis co robi twój program +Comment[pt]=o que faz a sua aplicação, em poucas palavras +Comment[pt_BR]=breve descrição do que o seu aplicativo faz +Comment[ru]=Несколько слов о том, что делает ваша программа +Comment[sk]=čo vaša aplikácia robí v niekoľkých slovách +Comment[sl]=kaj vaš program dela, v nekaj besedah +Comment[sr]=Укратко о томе шта ваш програм ради +Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради +Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi +Comment[sr@latin]=Ukratko o tome šta vaš program radi +Comment[sv]=vad programmet gör med några få ord +Comment[tr]=uygulamanızın yaptığı şey, birkaç sözcükte +Comment[uk]=призначення вашої програми у декількох словах +Comment[x-test]=xxwhat your app does in a few wordsxx +Comment[zh_CN]=简单几个词概括您的小程序的功能 +Comment[zh_TW]=以數個字描述您的應用程式的用途 + +Icon=emblem-music-symbolic +Type=Service +X-KDE-ServiceTypes=Plasma/Applet + +X-KDE-PluginInfo-Author=Kevin Whitaker +X-KDE-PluginInfo-Email=eyecreate@eyecreate.org +X-KDE-PluginInfo-Name=org.eyecreate.simplecastplasmoid +X-KDE-PluginInfo-Version=1.0 +X-KDE-PluginInfo-Website=https://plasma.kde.org/ +X-KDE-PluginInfo-Category=Utilities +X-KDE-PluginInfo-Depends= +X-KDE-PluginInfo-License=GPL +X-KDE-PluginInfo-EnabledByDefault=true + +X-Plasma-API=declarativeappletscript +X-Plasma-MainScript=ui/main.qml