File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 <min >0.0</min >
4646 <max >1.0</max >
4747 </entry >
48+ <entry name =" customSoundPath" type =" String" >
49+ <label >Path to custom sound effect</label >
50+ <default ></default >
51+ </entry >
4852 </group >
4953</kcfg >
Original file line number Diff line number Diff line change 11import QtQuick
22import QtQuick.Controls
33import QtQuick.Layouts
4+ import QtQuick.Dialogs
45import org.kde.kirigami as Kirigami
56import QtMultimedia
67
78Item {
89 id: soundPage;
910
1011 property double cfg_volume: plasmoid .configuration .volume
12+ property string cfg_customSoundPath: plasmoid .configuration .customSoundPath
1113
1214 MediaPlayer {
1315 id: testSound;
14- source: Qt .resolvedUrl (" ../../effects/meow.mp3" );
16+ source: cfg_customSoundPath ? cfg_customSoundPath : Qt .resolvedUrl (" ../../effects/meow.mp3" );
1517 audioOutput: AudioOutput {
1618 volume: soundPage .cfg_volume
1719 }
@@ -59,6 +61,40 @@ Item {
5961 }
6062 }
6163 }
64+
65+ RowLayout {
66+ Kirigami .FormData .label : i18n (" Custom sound:" )
67+ Layout .fillWidth : true
68+
69+ TextField {
70+ id: soundPathField
71+ text: soundPage .cfg_customSoundPath
72+ placeholderText: i18n (" Path to custom sound file" )
73+ Layout .fillWidth : true
74+ readOnly: true
75+ }
76+
77+ Button {
78+ text: i18n (" Browse..." )
79+ icon .name : " folder-open"
80+ onClicked: soundFileDialog .open ()
81+ }
82+
83+ Button {
84+ text: i18n (" Reset" )
85+ icon .name : " edit-undo"
86+ enabled: soundPage .cfg_customSoundPath !== " "
87+ onClicked: soundPage .cfg_customSoundPath = " "
88+ }
89+ }
6290 }
6391 }
92+
93+ FileDialog {
94+ id: soundFileDialog
95+ title: i18n (" Choose a sound file" )
96+ currentFolder: StandardPaths .standardLocations (StandardPaths .HomeLocation )[0 ]
97+ nameFilters: [i18n (" Audio files (*.mp3 *.wav *.ogg)" ), i18n (" All files (*)" )]
98+ onAccepted: soundPage .cfg_customSoundPath = selectedFile
99+ }
64100}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ PlasmoidItem {
3434
3535 MediaPlayer {
3636 id: meowSound
37- source: Qt .resolvedUrl (" ../effects/meow.mp3" )
37+ source: plasmoid . configuration . customSoundPath ? plasmoid . configuration . customSoundPath : Qt .resolvedUrl (" ../effects/meow.mp3" )
3838 audioOutput: AudioOutput {
3939 volume: root .volume
4040 }
Original file line number Diff line number Diff line change 33 "KPlugin" : {
44 "Id" : " xyz.attacktive.nyan-wanderer" ,
55 "Name" : " Nyan Wanderer" ,
6- "Version" : " 1.1.3 " ,
6+ "Version" : " 1.1.4 " ,
77 "Description" : " A cute Nyan Cat that wanders around your desktop" ,
88 "Category" : " Fun and Games" ,
99 "Icon" : " animal-symbolic" ,
You can’t perform that action at this time.
0 commit comments