Commit ea57aeaf authored by Camilo Higuita's avatar Camilo Higuita

scan source path and add to collection db

parent c0190216
......@@ -21,6 +21,8 @@ Kirigami.ApplicationWindow
property int defaultColumnWidth: Kirigami.Units.gridUnit * 13
property int columnWidth: defaultColumnWidth
property int currentView : 0
property int iconSize
pageStack.defaultColumnWidth: columnWidth
pageStack.initialPage: [playlist, views]
......@@ -34,15 +36,17 @@ Kirigami.ApplicationWindow
{
id: mainToolbar
visible: true
size: iconSize
currentIndex: currentView
onTracksViewClicked: currentView = 0
onAlbumsViewClicked: currentView = 1
onArtistsViewClicked: currentView = 2
onPlaylistsViewClicked: currentView = 3
onInfoViewClicked: currentView = 4
onPlaylistClicked: {
onSettingsViewClicked: currentView = 4
onPlaylistClicked:
{
con.test()
console.log(BAE.SettingPath)
}
......@@ -182,20 +186,22 @@ Kirigami.ApplicationWindow
currentIndex: currentView
TracksView
{
}
TracksView {}
AlbumsView
{
}
AlbumsView {}
ArtistsView
{
}
ArtistsView {}
PlaylistsView {}
SettingsView
{
onIconSizeChanged:
{
iconSize = size
console.log(size)
}
}
onCurrentIndexChanged:
......
......@@ -33,6 +33,7 @@ public:
void requestPath(QString path)
{
qDebug()<<"FROM file loader"<< path;
this->queue << path;
for(auto url : this->queue)
{
......
......@@ -66,14 +66,14 @@ settings::settings(QObject *parent) : QObject(parent)
}
});
// connect(this->fileLoader, &FileLoader::trackReady, [this]()
// {
// this->ui->progressBar->setValue(this->ui->progressBar->value()+1);
// });
// connect(this->fileLoader, &FileLoader::trackReady, [this]()
// {
// this->ui->progressBar->setValue(this->ui->progressBar->value()+1);
// });
connect(this->fileLoader,&FileLoader::finished,[this]()
connect(this->fileLoader, &FileLoader::finished,[this]()
{
this->collectionWatcher();
this->collectionWatcher();
emit refreshTables({{TABLE::TRACKS, true},{TABLE::ALBUMS, false},{TABLE::ARTISTS, false},{TABLE::PLAYLISTS, true}});
});
......@@ -109,9 +109,9 @@ void settings::refreshCollectionPaths()
{
auto queryTxt = QString("SELECT %1 FROM %2").arg(BAE::KEYMAP[BAE::KEY::URL], BAE::TABLEMAP[BAE::TABLE::SOURCES]);
// for (auto track : this->connection->getDBData(queryTxt))
// {
// }
// for (auto track : this->connection->getDBData(queryTxt))
// {
// }
}
void settings::addToWatcher(QStringList paths)
......@@ -172,12 +172,18 @@ void settings::checkCollection()
{
this->refreshCollectionPaths();
this->collectionWatcher();
this->collectionWatcher();
}
void settings::populateDB(const QString &path)
{
qDebug() << "Function Name: " << Q_FUNC_INFO
<< "new path for database action: " << path;
fileLoader->requestPath(path);
auto newPath = path;
if(path.startsWith("file://"))
{
newPath = newPath.replace("file://", "");
fileLoader->requestPath(newPath);
}
}
......@@ -4,8 +4,10 @@ Text
{
id: text
property string iconColor
property int iconSize
font.family: "Material Design Icons"
font.pixelSize: 24
font.pixelSize: iconSize || 24
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
......
......@@ -10,14 +10,16 @@ ToolBar
property alias babeBar : babeBar
property string accentColor : "#fa5a77"
property string textColor : "#ffffff"
property string backgroundColor : "#31363b"
property string backgroundColor : "#31363b"
property int size
property int currentIndex : 0
signal tracksViewClicked()
signal albumsViewClicked()
signal artistsViewClicked()
signal playlistsViewClicked()
signal infoViewClicked()
signal settingsViewClicked()
signal playlistClicked()
......@@ -40,6 +42,7 @@ ToolBar
{
text: MdiFont.Icon.playCircle
color: currentIndex === -1? accentColor : textColor
iconSize: size
}
ToolTip { text: "Playlist" }
......@@ -59,6 +62,8 @@ ToolBar
id: tracksIcon
text: MdiFont.Icon.musicNote
color: currentIndex === 0? accentColor : textColor
iconSize: size
}
onClicked: tracksViewClicked()
......@@ -78,6 +83,8 @@ ToolBar
id: albumsIcon
text: MdiFont.Icon.album
color: currentIndex === 1? accentColor : textColor
iconSize: size
}
onClicked: albumsViewClicked()
......@@ -98,6 +105,8 @@ ToolBar
id: artistsIcon
text: MdiFont.Icon.face
color: currentIndex === 2? accentColor : textColor
iconSize: size
}
onClicked: artistsViewClicked()
......@@ -117,6 +126,8 @@ ToolBar
id: playlistsIcon
text: MdiFont.Icon.libraryMusic
color: currentIndex === 3? accentColor : textColor
iconSize: size
}
onClicked: playlistsViewClicked()
......@@ -130,22 +141,24 @@ ToolBar
ToolButton
{
id: infoView
id: settingsView
Icon
{
id: infoIcon
text: MdiFont.Icon.information
id: settingsIcon
text: MdiFont.Icon.settings
color: currentIndex === 4? accentColor : textColor
iconSize: size
}
onClicked: infoViewClicked()
onClicked: settingsViewClicked()
hoverEnabled: true
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered
ToolTip.text: qsTr("Info")
ToolTip.text: qsTr("Settings")
}
}
}
......
import QtQuick 2.9
import "../view_models"
Item {
BabeTable
{
id: playlistsView
}
......@@ -11,13 +11,18 @@ Pane
{
id: settingsView
signal iconSizeChanged(int size)
FolderDialog
{
id: folderDialog
folder: StandardPaths.standardLocations(StandardPaths.MusicLocation)[0]
onAccepted:
{
listModel.append({source: folder.toString()})
set.collectionPathChanged(folder.toString())
}
}
......@@ -77,12 +82,14 @@ Pane
Row
{
id: sourceActions
anchors.top: sources.bottom
width: parent.width
ToolButton
{
id: addSource
Icon
{
text: MdiFont.Icon.plus
......@@ -111,5 +118,37 @@ Pane
}
}
Row
{
anchors.top: sourceActions.bottom
width: parent.width
height: iconSize.height
Label
{
width: parent.width - iconSize.width
height: parent.height
text: "Toolbar icon size"
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
ComboBox
{
id: iconSize
width: 100
model: ListModel
{
id: sizes
ListElement { size: 16 }
ListElement { size: 24 }
ListElement { size: 32 }
}
currentIndex: 1
onCurrentIndexChanged: iconSizeChanged(sizes.get(currentIndex).size )
}
}
}
}
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