Advertisement
Guest User

config.qml

a guest
Oct 21st, 2016
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. import QtQuick 2.5
  2. import QtQuick.Controls 1.2
  3. import QtQuick.Controls.Styles 1.4
  4. import QtQuick.Dialogs 1.2
  5. import QtQuick.Layouts 1.2
  6. import org.kde.plasma.core 2.0 as PlasmaCore
  7.  
  8. ColumnLayout {
  9. id: root
  10. property string cfg_Playlist
  11. property string cfg_PlaylistFolder
  12. property bool cfg_Shuffle
  13. property bool cfg_Muted
  14.  
  15. GroupBox {
  16. title: "Playlist file picker"
  17. Layout.fillWidth: true
  18. GridLayout {
  19. columns: 2
  20.  
  21. Label {
  22. text: "Click to pick"
  23. Layout.alignment: Qt.AlignRight
  24. }
  25.  
  26. Rectangle {
  27. width: 256
  28. height: 144
  29. color: "transparent"
  30. PlasmaCore.IconItem {
  31. source: "org.kde.plasma.folder"
  32. anchors.fill: parent
  33. MouseArea {
  34. anchors.fill: parent
  35. onClicked: {fileDialog.folder = cfg_PlaylistFolder; fileDialog.open() }
  36. }
  37. }
  38. }
  39. }
  40. }
  41.  
  42. FileDialog {
  43. id: fileDialog
  44. title: "Pick a playlist file"
  45. nameFilters: [ "Playlist files (*.m3u)"]
  46. onAccepted: {
  47. cfg_Playlist = fileDialog.fileUrls[0]
  48. cfg_PlaylistFolder = fileDialog.folder
  49. }
  50. }
  51.  
  52. GroupBox {
  53. title: "Playlist settings"
  54. Layout.fillWidth: true
  55. RadioButton {
  56. text: "Shuffle Playlist"
  57. checked: wallpaper.configuration.Shuffle
  58. onCheckedChanged: {
  59. if (checked)
  60. { cfg_Shuffle = true }
  61. else
  62. { cfg_Shuffle = false }
  63. }
  64. }
  65. }
  66.  
  67. GroupBox {
  68. title: "Audio settings"
  69. Layout.fillWidth: true
  70. RadioButton {
  71. text: "Muted"
  72. checked: wallpaper.configuration.Muted
  73. onCheckedChanged: {
  74. if (checked)
  75. { cfg_Muted = true }
  76. else
  77. { cfg_Muted = false }
  78. }
  79. }
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement