Commit 1033a4bf authored by Camilo Higuita's avatar Camilo Higuita

add option to add menu items to babetable header menu and initial work for playlists tags sync

parent 41d63a4d
......@@ -22,6 +22,7 @@ BabeList
property bool headerClose : false
property alias holder : list.holder
property alias headerMenu: headerMenu
signal rowClicked(int index)
signal rowPressed(int index)
......@@ -108,7 +109,6 @@ BabeList
HeaderMenu
{
id: headerMenu
onSaveListClicked: saveList()
}
......
......@@ -8,22 +8,31 @@ import ".."
BabeMenu
{
signal saveListClicked();
BabeMenuItem
{
text: "Queue list"
onTriggered: {}
}
BabeMenuItem
{
text: "Save list to..."
onTriggered: saveListClicked()
}
property alias menuItem: babeMenu.children
BabeMenuItem
Column
{
text: "Send list to..."
onTriggered: {}
id: babeMenu
BabeMenuItem
{
text: "Queue list"
onTriggered: {}
}
BabeMenuItem
{
text: "Save list to..."
onTriggered: saveListClicked()
}
BabeMenuItem
{
text: "Send list to..."
onTriggered: {}
}
}
}
......@@ -4,6 +4,7 @@ import QtQuick.Controls 2.2
import org.kde.kirigami 2.2 as Kirigami
import "../../view_models/BabeTable"
import "../../view_models/BabeMenu"
import "../../view_models"
import "../../db/Queries.js" as Q
......@@ -48,11 +49,7 @@ Kirigami.PageRow
Layout.fillHeight: true
Layout.fillWidth: true
onPlaySync:
{
if(!playlistViewModel.model.get(index).playlistIcon)
playlistViewRoot.playSync(playlistViewModel.model.get(index).playlist)
}
onPlaySync: syncAndPlay(index)
}
......@@ -109,6 +106,21 @@ Kirigami.PageRow
holder.emoji: "qrc:/assets/face-hug.png"
headerMenu.menuItem: [
BabeMenuItem
{
text: "Sync tags"
onTriggered: {}
},
BabeMenuItem
{
text: "Play-n-Sync"
onTriggered: syncAndPlay(playlistViewModel.currentIndex)
}
]
Connections
{
......@@ -156,5 +168,11 @@ Kirigami.PageRow
playlistViewModel.model.append(playlists[i])
}
function syncAndPlay(index)
{
if(!playlistViewModel.model.get(index).playlistIcon)
playlistViewRoot.playSync(playlistViewModel.model.get(index).playlist)
}
Component.onCompleted: setPlaylists()
}
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