MainPage.qml 773 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import QtQuick 2.0
  2. import DMusic 1.0
  3. import "qrc:/qml"
  4. DPage {
  5. id: root
  6. Row {
  7. id: _yandexHomePlaylists
  8. spacing: 25
  9. anchors.left: parent.left
  10. anchors.top: parent.top
  11. anchors.leftMargin: 25
  12. anchors.topMargin: 25
  13. Repeater {
  14. id: _yandexHomePlaylistsRepeater
  15. Component.onCompleted: {
  16. if (YClient.loggined) {
  17. model = YClient.homePlaylistsModel()
  18. } else {
  19. YClient.logginedChanged.connect(function(loggined) {
  20. if (loggined) {
  21. model = YClient.homePlaylistsModel()
  22. } else {
  23. model = []
  24. }
  25. })
  26. }
  27. }
  28. PlaylistEntry {
  29. playlist: element
  30. onPlay: YClient.playPlaylist(playlist)
  31. }
  32. }
  33. }
  34. }