Commit b45ef222 authored by camilo higuita's avatar camilo higuita

quick needed fixes for appimage creation

parent 95353d47
......@@ -42,8 +42,8 @@ add_executable(vvave
db/conthread.cpp
db/collectionDB.cpp
# settings/BabeSettings.cpp
settings/fileloader.cpp
utils/brain.cpp
# settings/fileloader.cpp
# utils/brain.cpp
utils/babeconsole.cpp
models/tracks/tracksmodel.cpp
models/basemodel.cpp
......
......@@ -917,6 +917,8 @@ Maui.ApplicationWindow
Layout.bottomMargin: space.big
onIconClicked: _contextMenu.popup()
onExitClicked: clear()
colorScheme.backgroundColor: "#212121"
model: BaseModel
{
list: _selectionBarModelList
......
......@@ -241,3 +241,24 @@ void PlaylistsModel::addTrack(const int &index, const QStringList &urls)
for(auto url : urls)
this->db->trackPlaylist(url, this->list[index][FMH::MODEL_KEY::PLAYLIST]);
}
void PlaylistsModel::removeTrack(const int &index, const QString &url)
{
if(index >= this->list.size() || index < 0)
return;
this->db->removePlaylistTrack(url, this->list.at(index)[FMH::MODEL_KEY::PLAYLIST]);
}
void PlaylistsModel::removePlaylist(const int &index)
{
if(index >= this->list.size() || index < 0)
return;
if(this->db->removePlaylist(this->list.at(index)[FMH::MODEL_KEY::PLAYLIST]))
{
emit this->preItemRemoved(index);
this->list.removeAt(index);
emit this->postItemRemoved();
}
}
......@@ -46,6 +46,8 @@ public slots:
void insert(const QString &playlist);
void insertAt(const QString &playlist, const int &at);
void addTrack(const int &index, const QStringList &urls);
void removeTrack(const int &index, const QString &url);
void removePlaylist(const int &index);
};
#endif // PLAYLISTSMODEL_H
......@@ -18,7 +18,7 @@ function playTrack(index)
currentArtwork = currentTrack.artwork
else bae.loadCover(currentTrack.url)
progressBar.enabled = true
progressBar.enabled = true
if(!isMobile)
{
......@@ -29,7 +29,7 @@ function playTrack(index)
}
// if(currentTrack.lyrics.length < 1)
bae.trackLyrics(currentTrack.url)
// bae.trackLyrics(currentTrack.url)
// root.mainPlaylist.infoView.wikiAlbum = bae.albumWiki(root.mainPlaylist.currentTrack.album,root.mainPlaylist.currentTrack.artist)
// root.mainPlaylist.infoView.wikiArtist = bae.artistWiki(root.mainPlaylist.currentTrack.artist)
......@@ -199,10 +199,11 @@ function savePlaylist()
list.push(url)
}
bae.savePlaylist(list)
bae.savePlaylistPos(mainPlaylist.listView.currentIndex)
Maui.FM.saveSettings("LASTPLAYLIST", list, "PLAYLIST");
Maui.FM.saveSettings("PLAYLIST_POS", mainPlaylist.listView.currentIndex, "MAINWINDOW")
}
function clearOutPlaylist()
{
mainPlaylist.list.clear()
......
......@@ -218,11 +218,11 @@ BabeList
playlistDialog.open()
}
onOpenWithClicked: bae.showFolder([list.get(listView.currentIndex).url])
onOpenWithClicked: Maui.FM.openLocation([list.get(listView.currentIndex).url])
onRemoveClicked:
{
list.remove(listView.currentIndex)
// list.remove(listView.currentIndex)
}
onRateClicked:
......
......@@ -142,5 +142,15 @@ QString vvave::moodColor(const int &index)
else return "";
}
void vvave::scanDir(const QString &path)
{
this->checkCollection(QStringList() << path);
}
QStringList vvave::getSourceFolders()
{
return this->db->getSourcesFolders();
}
......@@ -33,6 +33,12 @@ public slots:
/// useful functions for non modeled views and actions with not direct access to a tracksmodel or its own model
QVariantList sourceFolders() const;
static QString moodColor(const int &index);
void scanDir(const QString &path);
QStringList getSourceFolders();
};
#endif // VVAVE_H
......@@ -16,13 +16,9 @@ Kirigami.PageRow
id: playlistViewRoot
property string playlistQuery
// property alias playlistModel : playlistViewModel.model
// property alias playlistList : playlistViewModel.list
// property alias playlistViewList : playlistViewModel
// property alias list : _playlistsList
// property alias listModel: _playlistsModel
// property alias listView : playlistViewModel.listView
property alias playlistModel : playlistViewModel.model
property alias playlistList : playlistViewModel.list
property alias playlistViewList : playlistViewModel
signal rowClicked(var track)
signal quickPlayTrack(var track)
......@@ -187,53 +183,52 @@ Kirigami.PageRow
onRemoveClicked:
{
bae.removePlaylistTrack(url, playlistViewModel.model.get(playlistViewList.currentIndex).playlist)
playlistList.removeTrack(playlistViewList.currentIndex, filterList.list.get(filterList.currentIndex).url)
populate(playlistQuery)
}
}
}
function populateExtra(query, title)
{
// playlistSwipe.currentIndex = 1
// var res = bae.get(query)
// playlistViewModelFilter.clearTable()
// playlistViewModelFilter.headBarTitle = title
// appendToExtraList(res)
}
function populateExtra(query, title)
{
// playlistSwipe.currentIndex = 1
function appendToExtraList(res)
{
if(res.length>0)
for(var i in res)
playlistViewModelFilter.model.append(res[i])
}
// var res = bae.get(query)
// playlistViewModelFilter.clearTable()
// playlistViewModelFilter.headBarTitle = title
// appendToExtraList(res)
}
function populate(query)
{
if(!playlistViewRoot.wideMode)
playlistViewRoot.currentIndex = 1
function appendToExtraList(res)
{
if(res.length>0)
for(var i in res)
playlistViewModelFilter.model.append(res[i])
}
playlistViewRoot.playlistQuery = query
filterList.list.query = playlistViewRoot.playlistQuery
}
function populate(query)
{
if(!playlistViewRoot.wideMode)
playlistViewRoot.currentIndex = 1
function refresh()
{
}
playlistViewRoot.playlistQuery = query
filterList.list.query = playlistViewRoot.playlistQuery
}
function syncAndPlay(index)
{
if(!playlistList.get(index).playlistIcon)
playlistViewRoot.playSync(playlistList.get(index).playlist)
}
function refresh()
{
}
function removePlaylist()
{
bae.removePlaylist(playlistList.get(playlistViewList.currentIndex).playlist)
function syncAndPlay(index)
{
if(!playlistList.get(index).playlistIcon)
playlistViewRoot.playSync(playlistList.get(index).playlist)
}
filterList.clearTable()
}
function removePlaylist()
{
playlistList.removePlaylist(playlistViewList.currentIndex)
filterList.clearTable()
}
}
......@@ -14,7 +14,7 @@ Maui.Dialog
defaultButtons: false
function scanDir(folderUrl)
{
bae.scanDir(folderUrl)
vvave.scanDir(folderUrl)
}
Maui.Dialog
......@@ -113,7 +113,7 @@ Maui.Dialog
function getSources()
{
sources.model.clear()
var folders = bae.getSourceFolders()
var folders = vvave.getSourceFolders()
for(var i in folders)
sources.model.append({url : folders[i]})
}
......
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