Commit 771db774 authored by Camilo higuita's avatar Camilo higuita

latest changes

parent 61208aed
......@@ -183,7 +183,7 @@ Maui.ApplicationWindow
iconName: "headphones"
iconColor: !accent || isPlaying ? babeColor : altColorText
onClicked: pageStack.currentIndex = 0
colorScheme.highlightColor: babeColor
text: qsTr("Now")
},
......@@ -199,19 +199,23 @@ Maui.ApplicationWindow
text: qsTr("Tracks")
tooltipText: pageStack.wideMode ? "" : text
colorScheme.highlightColor: babeColor
},
Maui.ToolButton
{
text: qsTr("Albums")
iconName: /*"album"*/ "view-media-album-cover"
iconColor: accent && currentView === viewsIndex.albums ? babeColor : altColorText
iconColor: accent && currentView === viewsIndex.albums ? babeColor : altColorText
onClicked:
{
pageStack.currentIndex = 1
currentView = viewsIndex.albums
}
tooltipText: pageStack.wideMode ? "" : text
colorScheme.highlightColor: babeColor
},
Maui.ToolButton
......@@ -225,6 +229,8 @@ Maui.ApplicationWindow
currentView = viewsIndex.artists
}
tooltipText: pageStack.wideMode ? "" : text
colorScheme.highlightColor: babeColor
},
Maui.ToolButton
......@@ -238,6 +244,8 @@ Maui.ApplicationWindow
currentView = viewsIndex.playlists
}
tooltipText: pageStack.wideMode ? "" : text
colorScheme.highlightColor: babeColor
}
]
......@@ -298,7 +306,7 @@ Maui.ApplicationWindow
}
]
leftIcon.iconColor: accent && currentView === viewsIndex.search ? babeColor : altColorText
onSearchButtonClicked:
{
pageStack.currentIndex = 1
......@@ -772,8 +780,26 @@ Maui.ApplicationWindow
target: playlistsView
onRowClicked: Player.addTrack(track)
onQuickPlayTrack: Player.quickPlay(track)
onPlayAll: Player.playAll(tracks)
onAppendAll: Player.appendAll(tracks)
onPlayAll:
{
var query = playlistsView.playlistQuery
mainPlaylist.list.clear()
mainPlaylist.list.sortBy = Tracks.NONE
mainPlaylist.list.query = query
Player.playAll()
}
onAppendAll:
{
var query = playlistsView.playlistQuery
mainPlaylist.list.appendQuery(query)
mainPlaylist.listView.positionViewAtEnd()
}
onPlaySync:
{
var tracks = bae.get(Q.GET.playlistTracks_.arg(playlist))
......@@ -792,11 +818,19 @@ Maui.ApplicationWindow
Connections
{
target: searchView.searchTable
onRowClicked: Player.addTrack(searchView.searchTable.model.get(index))
onQuickPlayTrack: Player.quickPlay(searchView.searchTable.model.get(index))
onPlayAll: Player.playAll(searchView.searchRes)
onAppendAll: Player.appendAll(searchView.searchRes)
target: searchView
onRowClicked: Player.addTrack(searchView.list.get(index))
onQuickPlayTrack: Player.quickPlay(searchView.list.get(index))
onPlayAll:
{
var tracks = searchView.list.getAll()
for(var i in tracks)
Player.appendTrack(tracks[i])
Player.playAll()
}
onAppendAll: Player.appendAll(searchView.list.getAll())
onArtworkDoubleClicked:
{
var query = Q.GET.albumTracks_.arg(
......
......@@ -137,6 +137,22 @@ QVariantMap TracksModel::get(const int &index) const
return res;
}
QVariantList TracksModel::getAll()
{
QVariantList res;
for(auto item : this->list)
{
QVariantMap map;
for(auto key : item.keys())
map.insert(FMH::MODEL_NAME[key], item[key]);
res << map;
}
return res;
}
void TracksModel::append(const QVariantMap &item)
{
if(item.isEmpty())
......
......@@ -54,6 +54,7 @@ signals:
public slots:
QVariantMap get(const int &index) const override;
QVariantList getAll();
void append(const QVariantMap &item);
void append(const QVariantMap &item, const int &at);
void appendQuery(const QString &query);
......
......@@ -225,28 +225,6 @@ function cleanPlaylist()
}
}
function playAll(tracks)
{
if(tracks.length > 0)
{
sync = false
syncPlaylist = ""
infoMsg = ""
mainPlaylist.list.clear()
pageStack.currentIndex = 0
for(var i in tracks)
appendTrack(tracks[i])
// root.mainPlaylist.list.currentIndex = 0
// playTrack(root.mainPlaylist.list.model.get(0))
mainPlaylist.listView.positionViewAtBeginning()
playAt(0)
}
}
function playAll()
{
sync = false
......
......@@ -26,9 +26,9 @@ Kirigami.PageRow
signal rowClicked(var track)
signal quickPlayTrack(var track)
signal playAll(var tracks)
signal playAll()
signal playSync(var playlist)
signal appendAll(var tracks)
signal appendAll()
clip: true
separatorVisible: wideMode
......@@ -180,8 +180,8 @@ Kirigami.PageRow
{
playlistViewRoot.quickPlayTrack(filterList.model.get(index))
}
onPlayAll: playAll(bae.get(playlistQuery))
onAppendAll: appendAll(bae.get(playlistQuery))
onPlayAll: playAll()
onAppendAll: appendAll()
onPulled: populate(playlistQuery)
}
......
......@@ -54,7 +54,7 @@ Maui.Popup
{
if(!visible) open()
suggestionsList.clearTable()
// suggestionsList.clearTable()
var qq = bae.loadSetting("QUERIES", "BABE", {})
savedQueries = qq.split(",")
......
......@@ -15,11 +15,10 @@ BabeTable
id: searchTable
property alias searchInput : searchInput
property alias searchTable : searchTable
property var searchRes : []
property var savedQueries : []
property bool autoSuggestions : bae.loadSetting("AUTOSUGGESTIONS", "BABE", false) === "true" ? true : false
// property bool autoSuggestions : bae.loadSetting("AUTOSUGGESTIONS", "BABE", false) === "true" ? true : false
property bool autoSuggestions : false
Layout.fillHeight: true
......@@ -111,7 +110,6 @@ BabeTable
searchInput.clear()
searchTable.clearTable()
searchTable.headBarTitle = ""
searchRes = []
suggestionsPopup.close()
}
......
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