Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e75b0d98 authored by Camilo higuita's avatar Camilo higuita

testing albums popups

parent 79cd7867
......@@ -245,7 +245,7 @@ bool CollectionDB::addTrack(const DB &track)
auto artwork = track[BAE::KEY::ARTWORK].isEmpty() ? "" : track[BAE::KEY::ARTWORK];
auto artistTrack = track;
BAE::artworkCache(artistTrack, BAE::KEY::ALBUM);
BAE::artworkCache(artistTrack, BAE::KEY::ARTIST);
auto artistArtwork = artistTrack[BAE::KEY::ARTWORK];
/* first needs to insert the source, album and artist*/
......
This diff is collapsed.
......@@ -26,7 +26,6 @@
<file>utils/Props.js</file>
<file>widgets/SettingsView/SettingsView.qml</file>
<file>widgets/MyBeatView/LogginForm.qml</file>
<file>view_models/BabeMenu/BabeMenu.qml</file>
<file>widgets/SettingsView/SourcesDialog.qml</file>
<file>assets/banner.png</file>
<file>assets/banner.svg</file>
......
......@@ -66,14 +66,14 @@ function refreshTracks()
function refreshAlbums()
{
albumsView.grid.clearGrid()
albumsView.clearGrid()
albumsView.populate(Q.GET.allAlbumsAsc)
}
function refreshArtists()
{
artistsView.grid.clearGrid()
artistsView.clearGrid()
artistsView.populate(Q.GET.allArtistsAsc)
}
......
......@@ -455,7 +455,7 @@ inline bool artworkCache(DB &track, const KEY &type = KEY::NONE)
case KEY::ALBUM:
if(fileName == track[KEY::ARTIST]+"_"+track[KEY::ALBUM]+".jpg")
{
track.insert(KEY::ARTWORK,file);
track.insert(KEY::ARTWORK, file);
return true;
}
break;
......@@ -463,7 +463,7 @@ inline bool artworkCache(DB &track, const KEY &type = KEY::NONE)
case KEY::ARTIST:
if(fileName == track[KEY::ARTIST]+".jpg")
{
track.insert(KEY::ARTWORK,file);
track.insert(KEY::ARTWORK, file);
return true;
}
break;
......
......@@ -451,9 +451,9 @@ void Brain::artistArtworks()
/* BEFORE FETCHING ONLINE LOOK UP IN THE CACHE FOR THE IMAGE */
for(auto artist : artworks)
if(BAE::artworkCache(artist, KEY::ARTIST))
this->insertArtwork(artist);
// for(auto artist : artworks)
// if(BAE::artworkCache(artist, KEY::ARTIST))
// this->insertArtwork(artist);
artworks = this->getDBData(queryTxt);
this->setInfo(artworks, ontology, services, PULPO::INFO::ARTWORK, PULPO::RECURSIVE::OFF, nullptr);
......
......@@ -18,6 +18,7 @@ Maui.Page
property alias gridModel: gridModel
property alias grid: grid
property alias holder: holder
property alias count: grid.count
signal albumCoverClicked(string album, string artist)
signal albumCoverPressed(string album, string artist)
......@@ -26,8 +27,6 @@ Maui.Page
margins: space.medium
topMargin: space.big
onWidthChanged: grid.forceLayout()
function clearGrid()
{
gridModel.clear()
......
......@@ -71,7 +71,7 @@ BabeList
{
id: menuBtn
iconName: /*"application-menu"*/ "overflow-menu"
onClicked: isMobile ? headerMenu.open() : headerMenu.popup()
onClicked: headerMenu.popup()
}
]
......@@ -95,7 +95,7 @@ BabeList
id: contextMenu
menuItem: [
MenuItem
Maui.MenuItem
{
text: qsTr("Select...")
onTriggered:
......@@ -105,13 +105,13 @@ BabeList
}
},
MenuSeparator {},
MenuItem
Maui.MenuItem
{
text: qsTr("Go to Artist")
onTriggered: goToArtist()
},
MenuItem
Maui.MenuItem
{
text: qsTr("Go to Album")
onTriggered: goToAlbum()
......@@ -141,7 +141,7 @@ BabeList
{
var value = H.rateIt(paths, rate)
list.currentItem.rate(H.setStars(value))
ist.model.get(list.currentIndex).stars = value
list.model.get(list.currentIndex).stars = value
}
onColorClicked:
{
......@@ -220,10 +220,8 @@ BabeList
currentIndex = index
goToAlbum()
}
}
function openItemMenu(index)
{
currentIndex = index
......
......@@ -4,12 +4,11 @@ import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
import QtQuick.Layouts 1.3
import "../../view_models/BabeMenu"
import "../../view_models"
import "../../utils/Player.js" as Player
import "../../db/Queries.js" as Q
BabeMenu
Maui.Menu
{
signal sortBy(string text)
MenuItem
......
......@@ -3,12 +3,12 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../view_models/BabeMenu"
import "../../utils"
import ".."
BabeMenu
Maui.Menu
{
signal saveListClicked()
signal queueListClicked()
......@@ -16,7 +16,7 @@ BabeMenu
property alias menuItem : customItems.children
MenuItem
Maui.MenuItem
{
text: "Queue list"
onTriggered:
......@@ -26,7 +26,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: "Save list to..."
onTriggered:
......@@ -36,14 +36,14 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: "Send list to..."
}
MenuSeparator {}
MenuItem
Maui.MenuItem
{
text: "Visible info..."
onTriggered: {close()}
......@@ -51,7 +51,7 @@ BabeMenu
MenuSeparator {}
MenuItem
Maui.MenuItem
{
text: "Sort..."
onTriggered:
......@@ -61,7 +61,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Selection "+ (selectionMode ? "OFF" : "ON"))
onTriggered: selectionMode = !selectionMode
......@@ -71,5 +71,4 @@ BabeMenu
{
id: customItems
}
}
......@@ -2,13 +2,12 @@ import QtQuick 2.0
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../../view_models/BabeMenu"
import "../../utils"
import ".."
import org.kde.mauikit 1.0 as Maui
BabeMenu
Maui.Menu
{
id: control
property var paths : []
......@@ -32,7 +31,7 @@ BabeMenu
property alias menuItem : customItems.children
MenuItem
Maui.MenuItem
{
text: babe == false ? qsTr("Fav it"): qsTr("UnFav it")
onTriggered:
......@@ -42,7 +41,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Queue")
onTriggered:
......@@ -52,7 +51,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Save to...")
onTriggered:
......@@ -62,7 +61,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: isAndroid ? qsTr("Open with...") : qsTr("Show in folder...")
......@@ -73,7 +72,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Edit...")
onTriggered:
......@@ -83,7 +82,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Share...")
onTriggered:
......@@ -95,7 +94,7 @@ BabeMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Remove")
onTriggered:
......@@ -112,11 +111,11 @@ BabeMenu
width: parent.implicitWidth
}
MenuItem
Maui.MenuItem
{
id: starsRow
width: parent.width
height: iconSizes.small
height: iconSizes.medium + space.small
RowLayout
{
......@@ -127,7 +126,7 @@ BabeMenu
Layout.fillWidth: true
Layout.fillHeight: true
iconName: starIcon
size: iconSizes.small
size: iconSizes.medium
iconColor: rate >= 1 ? starColor :starReg
onClicked:
{
......@@ -141,7 +140,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
size: iconSizes.small
size: iconSizes.medium
iconName: starIcon
iconColor: rate >= 2 ? starColor :starReg
onClicked:
......@@ -156,7 +155,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
size: iconSizes.small
size: iconSizes.medium
iconName: starIcon
iconColor: rate >= 3 ? starColor :starReg
onClicked:
......@@ -171,7 +170,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
size: iconSizes.small
size: iconSizes.medium
iconName: starIcon
iconColor: rate >= 4 ? starColor :starReg
onClicked:
......@@ -186,7 +185,7 @@ BabeMenu
{
Layout.fillWidth: true
Layout.fillHeight: true
size: iconSizes.small
size: iconSizes.medium
iconName: starIcon
iconColor: rate >= 5 ? starColor :starReg
onClicked:
......@@ -201,11 +200,11 @@ BabeMenu
}
MenuItem
Maui.MenuItem
{
id: colorsRow
width: parent.width
height: iconSizes.small
height: iconSizes.medium + space.small
ColorTagsBar
{
......@@ -217,9 +216,6 @@ BabeMenu
function show(urls)
{
paths = urls
if(root.isMobile)
contextMenu.open()
else
contextMenu.popup()
contextMenu.popup()
}
}
......@@ -11,21 +11,15 @@ import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
Kirigami.PageRow
BabeGrid
{
id: albumsPageRoot
clip: true
separatorVisible: wideMode
initialPage: [albumsViewGrid, albumFilter]
defaultColumnWidth: width
interactive: currentIndex === 1
id: albumsViewGrid
property string currentAlbum: ""
property string currentArtist: ""
property var tracks: []
property alias grid : albumsViewGrid
property alias table : albumsViewTable
property alias tagBar : tagBar
......@@ -35,111 +29,117 @@ Kirigami.PageRow
signal appendAll(string album, string artist)
signal playAll(string album, string artist)
signal albumCoverClicked(string album, string artist)
// signal albumCoverClicked(string album, string artist)
signal albumCoverPressedAndHold(string album, string artist)
BabeGrid
visible: true
// topPadding: space.large
onAlbumCoverPressed: albumCoverPressedAndHold(album, artist)
headBarVisible: true
headBarExit: false
headBar.leftContent: Maui.ToolButton
{
id: albumsViewGrid
visible: true
// topPadding: space.large
onAlbumCoverClicked: albumsPageRoot.albumCoverClicked(album, artist)
onAlbumCoverPressed: albumCoverPressedAndHold(album, artist)
headBarVisible: true
headBarExit: false
headBar.leftContent: Maui.ToolButton
{
id : playAllBtn
visible : headBarVisible && count > 0
anim : true
iconName : "media-playlist-play"
onClicked : playAll()
}
id : playAllBtn
visible : headBarVisible && albumsViewGrid.count > 0
anim : true
iconName : "media-playlist-play"
onClicked : playAll()
}
headBar.rightContent: [
headBar.rightContent: [
Maui.ToolButton
{
id: appendBtn
visible: headBarVisible && count > 0
anim : true
iconName : "media-playlist-append"//"media-repeat-track-amarok"
onClicked: appendAll()
},
Maui.ToolButton
{
id: menuBtn
iconName: /*"application-menu"*/ "overflow-menu"
// onClicked: isMobile ? headerMenu.open() : headerMenu.popup()
}
]
Maui.ToolButton
{
id: appendBtn
visible: headBarVisible && albumsViewGrid.count > 0
anim : true
iconName : "media-playlist-append"//"media-repeat-track-amarok"
onClicked: appendAll()
},
}
Maui.ToolButton
{
id: menuBtn
iconName: /*"application-menu"*/ "overflow-menu"
// onClicked: isMobile ? headerMenu.open() : headerMenu.popup()
}
]
ColumnLayout
Maui.Dialog
{
id: albumFilter
anchors.fill: parent
spacing: 0
id: albumDialog
parent: parent
maxHeight: maxWidth
maxWidth: unit * 600
defaultButtons: false
page.margins: 0
// verticalAlignment: Qt.AlignBottom
BabeTable
ColumnLayout
{
id: albumsViewTable
Layout.fillHeight: true
Layout.fillWidth: true
trackNumberVisible: true
headBarVisible: true
headBarExit: !albumsPageRoot.wideMode
headBarExitIcon: "go-previous"
coverArtVisible: true
quickPlayVisible: true
focus: true
holder.emoji: "qrc:/assets/ElectricPlug.png"
holder.isMask: false
holder.title : "Oops!"
holder.body: "This list is empty"
holder.emojiSize: iconSizes.huge
onRowClicked:
{
albumsPageRoot.rowClicked(model.get(index))
}
id: albumFilter
anchors.fill: parent
spacing: 0
onQuickPlayTrack:
BabeTable
{
albumsPageRoot.playTrack(model.get(index))
}
id: albumsViewTable
Layout.fillHeight: true
Layout.fillWidth: true
trackNumberVisible: true
headBarVisible: true
headBarExit: false
coverArtVisible: true
quickPlayVisible: true
focus: true
holder.emoji: "qrc:/assets/ElectricPlug.png"
holder.isMask: false
holder.title : "Oops!"
holder.body: "This list is empty"
holder.emojiSize: iconSizes.huge
onRowClicked:
{
albumsViewGrid.rowClicked(model.get(index))
}
onQuickPlayTrack:
{
albumsViewGrid.playTrack(model.get(index))
}
onQueueTrack:
{
albumsViewGrid.queueTrack(model.get(index))
}
onPlayAll:
{
albumDialog.close()
albumsViewGrid.playAll(currentAlbum, currentArtist)
}
onAppendAll:
{
albumDialog.close()
albumsViewGrid.appendAll(currentAlbum, currentArtist)
}
onQueueTrack:
{
albumsPageRoot.queueTrack(model.get(index))
}
onPlayAll:
{
albumsPageRoot.currentIndex = 0
albumsPageRoot.playAll(currentAlbum, currentArtist)
}
onAppendAll:
Maui.TagsBar
{
albumsPageRoot.currentIndex = 0
albumsPageRoot.appendAll(currentAlbum, currentArtist)
id: tagBar
Layout.fillWidth: true
allowEditMode: false
onTagClicked: H.searchFor("tag:"+tag)
}
onExit: albumsPageRoot.currentIndex = 0
}
Maui.TagsBar
{
id: tagBar
Layout.fillWidth: true
allowEditMode: false
onTagClicked: H.searchFor("tag:"+tag)
}
}
function populate(query)
......@@ -148,16 +148,15 @@ Kirigami.PageRow
if(map.length > 0)
for(var i in map)
grid.gridModel.append(map[i])
gridModel.append(map[i])
}
function populateTable(album, artist)
{
console.log("PAPULATE ALBUMS VIEW")
albumDialog.open()
table.clearTable()
albumsPageRoot.currentIndex = 1
var query = ""
var tagq = ""
......
......@@ -13,7 +13,7 @@ StackView
initialItem: Maui.Page
{
anchors.fill: parent
headBarTitle: qsTr("Source folders")
headBarExit: false
margins: space.large
......
......@@ -36,7 +36,7 @@ Maui.Page
focus: true
headBarExit: false
margins: 0
headBarTitle: currentTrack.title + " - " + currentTrack.artist
headBarTitle: currentTrack.title ? currentTrack.title + " - " + currentTrack.artist : ""
headBar.leftContent: Maui.ToolButton
{
id: infoBtn
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import "../../view_models/BabeMenu"
import org.kde.mauikit 1.0 as Maui
BabeMenu
Maui.Menu
{
signal clearOut()
signal clean()
......
......@@ -5,7 +5,6 @@ import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../view_models/BabeTable"
import "../../view_models/BabeMenu"
import "../../view_models"
import "../../db/Queries.js" as Q
import "../../utils/Help.js" as H
......@@ -39,7 +38,6 @@ Kirigami.PageRow
spacing: 0
Layout.margins: 0
SwipeView
{
id: playlistSwipe
......
......@@ -16,11 +16,14 @@ BabeList
headBarExit: false
headBarTitle: "Playlists"
Maui.NewDialog
{
id: newPlaylistDialog
title: qsTr("New Plasylist...")
title: qsTr("New Playlist...")
onFinished: addPlaylist(text)
acceptText: qsTr("Create")
rejectButton.visible: false
}
signal playSync(int index)
......@@ -80,23 +83,19 @@ BabeList
break;
case "Favorites":
filterList.section.property = "stars"
playlistViewRoot.populate(Q.GET.favoriteTracks);
break;
case "Recent":
playlistViewRoot.populate(Q.GET.recentTracks);
break;