Commit 65a031bc authored by Camilo higuita's avatar Camilo higuita

fix playlists view

parent 47b9b9ef
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.6 as Kirigami
import org.kde.mauikit 1.0 as Maui import org.kde.mauikit 1.0 as Maui
...@@ -16,9 +16,9 @@ Kirigami.PageRow ...@@ -16,9 +16,9 @@ Kirigami.PageRow
id: playlistViewRoot id: playlistViewRoot
property string playlistQuery property string playlistQuery
property alias playlistModel : playlistViewModel.model // property alias playlistModel : playlistViewModel.model
property alias playlistList : playlistViewModel.list // property alias playlistList : playlistViewModel.list
property alias playlistViewList : playlistViewModel // property alias playlistViewList : playlistViewModel
// property alias list : _playlistsList // property alias list : _playlistsList
// property alias listModel: _playlistsModel // property alias listModel: _playlistsModel
...@@ -34,18 +34,11 @@ Kirigami.PageRow ...@@ -34,18 +34,11 @@ Kirigami.PageRow
separatorVisible: wideMode separatorVisible: wideMode
initialPage: [playlistLayout, filterList] initialPage: [playlistLayout, filterList]
defaultColumnWidth: Kirigami.Units.gridUnit * 15 defaultColumnWidth: Kirigami.Units.gridUnit * 15
interactive: currentIndex === 1 && !wideMode
Rectangle
{
color: "pink"
anchors.fill: parent
}
ColumnLayout ColumnLayout
{ {
id: playlistLayout id: playlistLayout
clip: true clip: true
anchors.fill: parent
spacing: 0 spacing: 0
Layout.margins: 0 Layout.margins: 0
...@@ -108,7 +101,6 @@ Rectangle ...@@ -108,7 +101,6 @@ Rectangle
{ {
id: filterList id: filterList
clip: true clip: true
anchors.fill: parent
quickPlayVisible: true quickPlayVisible: true
coverArtVisible: true coverArtVisible: true
trackRating: true trackRating: true
...@@ -126,30 +118,30 @@ Rectangle ...@@ -126,30 +118,30 @@ Rectangle
holder.body: "Your playlist is empty,<br>start adding new music to it" holder.body: "Your playlist is empty,<br>start adding new music to it"
holder.emojiSize: iconSizes.huge holder.emojiSize: iconSizes.huge
// headerMenu.menuItem: [ // headerMenu.menuItem: [
// Maui.MenuItem // Maui.MenuItem
// { // {
// enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon // enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
// text: "Sync tags" // text: "Sync tags"
// onTriggered: {} // onTriggered: {}
// }, // },
// Maui.MenuItem // Maui.MenuItem
// { // {
// enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon // enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
// text: "Play-n-Sync" // text: "Play-n-Sync"
// onTriggered: // onTriggered:
// { // {
// filterList.headerMenu.close() // filterList.headerMenu.close()
// syncAndPlay(playlistViewModel.currentIndex) // syncAndPlay(playlistViewModel.currentIndex)
// } // }
// }, // },
// Maui.MenuItem // Maui.MenuItem
// { // {
// enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon // enabled: !playlistViewModel.model.get(playlistViewModel.currentIndex).playlistIcon
// text: "Remove playlist" // text: "Remove playlist"
// onTriggered: removePlaylist() // onTriggered: removePlaylist()
// } // }
// ] // ]
// contextMenu.menuItem: [ // contextMenu.menuItem: [
...@@ -202,46 +194,46 @@ Rectangle ...@@ -202,46 +194,46 @@ Rectangle
} }
function populateExtra(query, title) function populateExtra(query, title)
{ {
// playlistSwipe.currentIndex = 1 // playlistSwipe.currentIndex = 1
// var res = bae.get(query) // var res = bae.get(query)
// playlistViewModelFilter.clearTable() // playlistViewModelFilter.clearTable()
// playlistViewModelFilter.headBarTitle = title // playlistViewModelFilter.headBarTitle = title
// appendToExtraList(res) // appendToExtraList(res)
} }
function appendToExtraList(res) function appendToExtraList(res)
{ {
if(res.length>0) if(res.length>0)
for(var i in res) for(var i in res)
playlistViewModelFilter.model.append(res[i]) playlistViewModelFilter.model.append(res[i])
} }
function populate(query) function populate(query)
{ {
if(!playlistViewRoot.wideMode) if(!playlistViewRoot.wideMode)
playlistViewRoot.currentIndex = 1 playlistViewRoot.currentIndex = 1
playlistViewRoot.playlistQuery = query playlistViewRoot.playlistQuery = query
filterList.list.query = playlistViewRoot.playlistQuery filterList.list.query = playlistViewRoot.playlistQuery
} }
function refresh() function refresh()
{ {
} }
function syncAndPlay(index) function syncAndPlay(index)
{ {
if(!playlistList.get(index).playlistIcon) if(!playlistList.get(index).playlistIcon)
playlistViewRoot.playSync(playlistList.get(index).playlist) playlistViewRoot.playSync(playlistList.get(index).playlist)
} }
function removePlaylist() function removePlaylist()
{ {
bae.removePlaylist(playlistList.get(playlistViewList.currentIndex).playlist) bae.removePlaylist(playlistList.get(playlistViewList.currentIndex).playlist)
filterList.clearTable() filterList.clearTable()
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment