Browse Source

Initial commit.

pull/4/head
Jeromy Streets 3 years ago
commit
74052a903d
4 changed files with 115 additions and 0 deletions
  1. +23
    -0
      contents/config/main.xml
  2. +60
    -0
      contents/ui/config.qml
  3. +20
    -0
      contents/ui/main.qml
  4. +12
    -0
      metadata.desktop

+ 23
- 0
contents/config/main.xml View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>

<group name="General">
<entry name="Video" type="String">
<label>Video file path</label>
<default></default>
</entry>
<entry name="Folder" type="String">
<label>Last folder used</label>
<default></default>
</entry>
<entry name="Muted" type="bool">
<label>Audio muted</label>
<default>false</default>
</entry>
</group>

</kcfg>

+ 60
- 0
contents/ui/config.qml View File

@@ -0,0 +1,60 @@
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore

ColumnLayout {
id: root
property string cfg_Video
property string cfg_Folder
property bool cfg_Muted

GroupBox {
title: "File picker"
Layout.fillWidth: true
GridLayout {
columns: 2

Rectangle {
width: 256
height: 144
color: "transparent"
PlasmaCore.IconItem {
source: "org.kde.plasma.clipboard"
anchors.fill: parent
MouseArea {
anchors.fill: parent
onClicked: {fileDialog.folder = cfg_Folder; fileDialog.open() }
}
}
}
}
}
FileDialog {
id: fileDialog
title: "Pick a video file"
nameFilters: [ "Video files (*.mp4 *.mpg *.ogg *.mov *.webm *.flv *.matroska *.avi)", "All files (*)" ]
onAccepted: {
cfg_Video = fileDialog.fileUrls[0]
cfg_Folder = fileDialog.folder
}
}
GroupBox {
title: "Audio"
Layout.fillWidth: true
RadioButton {
text: "Muted"
checked: wallpaper.configuration.Muted
onCheckedChanged: {
if (checked)
{ cfg_Muted = true }
else
{ cfg_Muted = false }
}
}
}
}

+ 20
- 0
contents/ui/main.qml View File

@@ -0,0 +1,20 @@
import QtQuick 2.5
import QtMultimedia 5.5
import org.kde.plasma.core 2.0 as Plasmacore

Item {
MediaPlayer {
id: mediaplayer
autoPlay: true
muted: wallpaper.configuration.Muted
loops: MediaPlayer.Infinite
source: wallpaper.configuration.Video
}

VideoOutput {
fillMode: VideoOutput.PreserveAspectCrop
anchors.fill: parent
source: mediaplayer
}
}


+ 12
- 0
metadata.desktop View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=Video
Name[x-test]=xxVideoxx

Type=Service
ServiceTypes=Plasma/Wallpaper
Icon=preferences-desktop-wallpaper
X-Plasma-MainScript=ui/main.qml
X-KDE-PluginInfo-Name=org.kde.video
X-KDE-PluginInfo-EnabledByDefault=true


Loading…
Cancel
Save