summaryrefslogtreecommitdiffstats
path: root/qml
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-10-22 21:21:10 +0200
committerYoann Lopes <yoann.lopes@nokia.com>2011-10-22 21:21:10 +0200
commit49ce7f225fc49793fe628f7c5a923577ae648522 (patch)
treebd09b67dc242bf7a990a116663def335c0619d99 /qml
parent0d73477754400ffb91b1ea10490c33c69b501075 (diff)
Handle offline status per track and not per playlist.
Diffstat (limited to 'qml')
-rw-r--r--qml/PlaylistDelegate.qml4
-rw-r--r--qml/PlaylistPage.qml12
-rw-r--r--qml/TrackMenu.qml1
-rw-r--r--qml/TracklistPage.qml10
4 files changed, 11 insertions, 16 deletions
diff --git a/qml/PlaylistDelegate.qml b/qml/PlaylistDelegate.qml
index 0caefc8..cbc934e 100644
--- a/qml/PlaylistDelegate.qml
+++ b/qml/PlaylistDelegate.qml
@@ -200,7 +200,7 @@ Item {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
height: subText.height
- visible: listItem.offlineStatus == SpotifyPlaylist.Yes || listItem.offlineStatus == SpotifyPlaylist.No
+ visible: listItem.offlineStatus == SpotifyPlaylist.Yes || listItem.offlineStatus == SpotifyPlaylist.No || spotifySession.offlineMode
Label {
id: subText
@@ -248,7 +248,7 @@ Item {
anchors.left: offlineStatusIcon.right
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
- visible: listItem.offlineStatus == SpotifyPlaylist.Waiting
+ visible: listItem.offlineStatus == SpotifyPlaylist.Waiting && !spotifySession.offlineMode
font.family: listItem.subtitleFont
font.pixelSize: listItem.subtitleSize
font.weight: Font.Light
diff --git a/qml/PlaylistPage.qml b/qml/PlaylistPage.qml
index 2052a83..bf2bf4b 100644
--- a/qml/PlaylistPage.qml
+++ b/qml/PlaylistPage.qml
@@ -5,22 +5,22 @@
** Contact: Yoann Lopes (yoann.lopes@nokia.com)
**
** This file is part of the MeeSpot project.
-**
+**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
-**
+**
** Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
-**
+**
** Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
-**
+**
** Neither the name of Nokia Corporation and its Subsidiary(-ies) nor the names of its
** contributors may be used to endorse or promote products derived from
** this software without specific prior written permission.
-**
+**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -93,7 +93,7 @@ Page {
downloadProgress: modelData.offlineDownloadProgress
unseens: modelData.unseenCount
enabled: opacity == 1.0
- opacity: !spotifySession.offlineMode || modelData.offlineStatus == SpotifyPlaylist.Yes ? 1.0 : 0.3
+ opacity: !spotifySession.offlineMode || modelData.availableOffline ? 1.0 : 0.3
onClicked: {
if (modelData.trackCount > 0)
diff --git a/qml/TrackMenu.qml b/qml/TrackMenu.qml
index d0a042b..86e0c73 100644
--- a/qml/TrackMenu.qml
+++ b/qml/TrackMenu.qml
@@ -109,6 +109,7 @@ MyMenu {
MyMenuItem {
text: "Add to queue";
onClicked: { track.enqueue() }
+ visible: track && track.isAvailable
}
MyMenuItem {
id: starItem
diff --git a/qml/TracklistPage.qml b/qml/TracklistPage.qml
index 10edebb..121b9b9 100644
--- a/qml/TracklistPage.qml
+++ b/qml/TracklistPage.qml
@@ -67,6 +67,7 @@ Page {
highlighted: modelData.isCurrentPlayingTrack
starred: modelData.isStarred
available: modelData.isAvailable
+ enabled: !spotifySession.offlineMode || available
onClicked: {
modelData.play()
}
@@ -84,6 +85,7 @@ Page {
highlighted: modelData.isCurrentPlayingTrack
starred: modelData.isStarred
available: modelData.isAvailable
+ enabled: !spotifySession.offlineMode || available
onClicked: {
modelData.play()
}
@@ -106,14 +108,6 @@ Page {
Component.onCompleted: {
tracks.delegate = playlist.type == SpotifyPlaylist.Inbox ? inboxDelegate : trackDelegate
-// if (playlist.isCurrentPlaylist()) {
-// for (var i in playlist.tracks) {
-// if (playlist.tracks[i].isCurrentPlayingTrack) {
-// positionViewAtIndex(i, ListView.Center)
-// return;
-// }
-// }
-// }
}
}