Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7f0411a2 authored by Camilo Higuita's avatar Camilo Higuita

better albums view drawer and initial work on brainz

parent ec23afde
......@@ -72,7 +72,7 @@ BabeSettings::BabeSettings(QObject *parent) : QObject(parent)
connect(this->ytFetch, &YouTube::done, [this]()
{
this->populateDB({BAE::YoutubeCachePath});
this->startBrainz(true, BAE::SEG::THREE);
});
connect(this->babeSocket, &Socket::message, this->ytFetch, &YouTube::fetch);
......@@ -109,18 +109,16 @@ BabeSettings::BabeSettings(QObject *parent) : QObject(parent)
{BAE::TABLEMAP[TABLE::PLAYLISTS], true}});
// this->startBrainz(true, 1500);
// this->startBrainz(true, BAE::SEG::ONEHALF);
qDebug()<<"Finished inserting into DB";
}/*else
}else
{
this->dirs.clear();
this->collectionWatcher();
this->watcher->removePaths(watcher->directories());
this->startBrainz(BAE::loadSettings("BRAINZ", "BABE", false).toBool(), 3000);
}*/
this->startBrainz(BAE::loadSettings("BRAINZ", "BABE", false).toBool(), BAE::SEG::THREE);
}
});
connect(this, &BabeSettings::collectionPathChanged, this, &BabeSettings::populateDB);
......@@ -219,7 +217,7 @@ void BabeSettings::handleDirectoryChanged(const QString &dir)
void BabeSettings::checkCollectionBrainz(const bool &state)
{
qDebug()<<"BRAINZ STATE<<"<<state;
this->startBrainz(state, 3000);
this->startBrainz(state, BAE::SEG::THREE);
}
void BabeSettings::startBrainz(const bool &on, const uint &speed)
......
......@@ -39,7 +39,7 @@ private slots:
void on_remove_clicked();
public slots:
void startBrainz(const bool &on, const uint &speed);
void startBrainz(const bool &on, const uint &speed = BAE::SEG::THREE);
void populateDB(const QStringList &paths);
private:
......
This diff is collapsed.
......@@ -23,10 +23,9 @@ Brain::~Brain()
void Brain::start()
{
if(this->isRunning()) this->go = false;
this->go = true;
if(!this->isRunning())
this->go = true;
QMetaObject::invokeMethod(this, "synapse");
}
void Brain::stop()
......@@ -69,7 +68,7 @@ void Brain::setInfo(DB_LIST dataList, ONTOLOGY ontology, QList<SERVICES> service
if (cb != nullptr) cb(data);
this->pulpo.feed(data, recursive);
this->t.msleep(this->interval);
}
}else return;
}
}
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
BabeDialog
{
property string message
property string messageBody
standardButtons: Dialog.Yes | Dialog.No
Column
ColumnLayout
{
spacing: 20
anchors.fill: parent
Label
{
Layout.margins: contentMargins
text: message ? message : ""
width: parent.width
elide: Text.ElideRight
......@@ -21,6 +21,7 @@ BabeDialog
Label
{
Layout.margins: contentMargins
text: messageBody ? messageBody : ""
width: parent.width
elide: Text.ElideRight
......
......@@ -8,6 +8,7 @@ ColumnLayout
{
id: babeAlbumRoot
signal albumClicked(int index)
signal albumPressed(int index)
property int albumSize : 150
......@@ -97,7 +98,6 @@ ColumnLayout
Layout.margins: contentMargins
spacing: 5
Label
{
width: parent.width
......
......@@ -33,50 +33,51 @@ BabeGrid
Drawer
{
id: drawer
y: parent.height-height-root.footer.height
width: pageStack.wideMode ? albumsViewGrid.width-1 : albumsViewGrid.width
height:
{
var customHeight = (drawerList.count*rowHeight)+48
var customHeight = (drawerList.count*rowHeight)+toolBarHeight
if(customHeight > parent.height)
parent.height-root.header.height
parent.height - root.header.height - root.footer.height
else
{
if(customHeight < parent.height*0.4)
parent.height*0.4
(parent.height*0.4) - root.footer.height
else
customHeight
customHeight - root.footer.height
}
}
x: pageStack.wideMode ? columnWidth+1 : 0
width: pageStack.wideMode ? albumsViewGrid.width-1 : albumsViewGrid.width
edge: Qt.BottomEdge
edge: Qt.RightEdge
interactive: false
focus: true
modal: root.isMobile
dragMargin: 0
Component.onCompleted: drawerList.forceActiveFocus()
margins: 0
spacing: 0
onOpened: drawerList.forceActiveFocus()
enter: Transition
{
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition
{
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
background: Rectangle
{
anchors.fill: parent
z: -999
color: altColor
Kirigami.Separator
{
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
}
BabeTable
......@@ -88,6 +89,7 @@ BabeGrid
headerBarExit: true
coverArtVisible: true
quickPlayVisible: true
focus: true
onRowClicked:
{
......@@ -130,6 +132,22 @@ BabeGrid
}
onExit: drawer.close()
Kirigami.Separator
{
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
}
}
......@@ -196,4 +214,5 @@ BabeGrid
}
Component.onCompleted: populate()
}
......@@ -34,52 +34,54 @@ BabeGrid
Drawer
{
id: drawer
y: parent.height-height-root.footer.height
width: pageStack.wideMode ? artistsViewGrid.width-1 : artistsViewGrid.width
height:
{
var customHeight = (drawerList.count*rowHeight)+48
var customHeight = (drawerList.count*rowHeight)+toolBarHeight
if(customHeight > parent.height)
parent.height-root.header.height
parent.height - root.header.height - root.footer.height
else
{
if(customHeight < parent.height*0.4)
parent.height*0.4
(parent.height*0.4) - root.footer.height
else
customHeight
customHeight - root.footer.height
}
}
x: pageStack.wideMode ? columnWidth+1 : 0
width: pageStack.wideMode ? artistsViewGrid.width-1 : artistsViewGrid.width
edge: Qt.BottomEdge
edge: Qt.RightEdge
interactive: false
focus: true
modal: root.isMobile
dragMargin: 0
clip: true
margins: 0
spacing: 0
onOpened: drawerList.forceActiveFocus()
enter: Transition
{
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
}
exit: Transition
{
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
}
background: Rectangle
{
anchors.fill: parent
z: -999
color: altColor
Kirigami.Separator
{
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
}
BabeTable
{
id: drawerList
......@@ -126,6 +128,22 @@ BabeGrid
}
onExit: drawer.close()
Kirigami.Separator
{
Rectangle
{
anchors.fill: parent
color: Kirigami.Theme.viewFocusColor
}
anchors
{
left: parent.left
right: parent.right
top: parent.top
}
}
}
}
......@@ -160,6 +178,8 @@ BabeGrid
gridModel.append(map[i])
}
Component.onCompleted: populate()
}
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