From c809d16fbe3e36ae8006b1e01ac67b7467848559 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Sun, 13 Apr 2014 06:31:25 +0000 Subject: [PATCH] Artist images --- ubuntu/main.cpp | 2 ++ ubuntu/qml/cantata/ArtistPage.qml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ubuntu/main.cpp b/ubuntu/main.cpp index 4f3a926d6..f1962290b 100644 --- a/ubuntu/main.cpp +++ b/ubuntu/main.cpp @@ -188,6 +188,8 @@ int main(int argc, char *argv[]) MPDStats::self(); MPDConnection::self(); + MusicLibraryModel::self()->setUseArtistImages(true); // TODO: Configurable? + MPDBackend backend; QGuiApplication app(argc, argv); diff --git a/ubuntu/qml/cantata/ArtistPage.qml b/ubuntu/qml/cantata/ArtistPage.qml index aafceebbd..73a0b1360 100644 --- a/ubuntu/qml/cantata/ArtistPage.qml +++ b/ubuntu/qml/cantata/ArtistPage.qml @@ -92,9 +92,25 @@ Page { clip: true delegate: ListItemDelegate { + id: delegate text: model.mainText subText: model.subText -// progression: true //Removed due to the app showdown, will be implemented later + iconSource: !(model.image.indexOf("qrc:") === 0)?"file:" + model.image:model.image + + firstButtonImageSource: "../../icons/toolbar/media-playback-start-light.svg" + secondButtonImageSource: "../../icons/toolbar/add.svg" +// progression: true //Removed due to the app showdown, will be implemented later + +// onIconSourceChanged: console.log("Debug iconSource: " + iconSource) + + onFirstImageButtonClicked: add(true) + onSecondImageButtonClicked: add(false) + + function add(replace) { + // TODO: Artist or album? + //backend.addArtist(index, replace) + pageStack.push(currentlyPlayingPage) + } } }