Commit 4a2868f8 authored by Camilo Higuita's avatar Camilo Higuita

example pic

parent a054cdd9
...@@ -218,7 +218,7 @@ DISTFILES += \ ...@@ -218,7 +218,7 @@ DISTFILES += \
db/script.sql \ db/script.sql \
android-openssl.pri \ android-openssl.pri \
# 3rdparty/kirigami/kirigami.pri # 3rdparty/kirigami/kirigami.pri
kde/kde.pri kde/kde.pri \
HEADERS += \ HEADERS += \
...@@ -346,13 +346,3 @@ HEADERS += \ ...@@ -346,13 +346,3 @@ HEADERS += \
taglib/taglib_config.h \ taglib/taglib_config.h \
babe.h \ babe.h \
#unix:!macx: LIBS += -L$$PWD/3rdparty/taglib/taglib/ -ltag
#INCLUDEPATH += $$PWD/3rdparty/taglib/taglib
#DEPENDPATH += $$PWD/3rdparty/taglib/taglib
#unix:!macx: PRE_TARGETDEPS += $$PWD/3rdparty/taglib/taglib/libtag.a
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <QPalette> #include <QPalette>
#include <QWidget> #include <QWidget>
#include <QColor> #include <QColor>
#include <QIcon>
#include "db/collectionDB.h" #include "db/collectionDB.h"
#include "settings/settings.h" #include "settings/settings.h"
#include "pulpo/pulpo.h" #include "pulpo/pulpo.h"
...@@ -379,6 +379,13 @@ uint Babe::sizeHint(const uint &hint) ...@@ -379,6 +379,13 @@ uint Babe::sizeHint(const uint &hint)
else return hint; else return hint;
} }
QString Babe::icon(const QString &icon, const int &size)
{
auto pix = QIcon::fromTheme(icon).pixmap(QSize(size, size), QIcon::Mode::Normal, QIcon::State::On);
return "";
}
QString Babe::loadCover(const QString &url) QString Babe::loadCover(const QString &url)
{ {
auto map = this->con->getDBData(QStringList() << url); auto map = this->con->getDBData(QStringList() << url);
......
...@@ -78,6 +78,7 @@ public: ...@@ -78,6 +78,7 @@ public:
Q_INVOKABLE static QVariantMap getParentDir(const QString &path); Q_INVOKABLE static QVariantMap getParentDir(const QString &path);
static void registerTypes(); static void registerTypes();
Q_INVOKABLE static uint sizeHint(const uint &hint); Q_INVOKABLE static uint sizeHint(const uint &hint);
Q_INVOKABLE static QString icon(const QString &icon, const int &size);
/*USEFUL*/ /*USEFUL*/
Q_INVOKABLE QString loadCover(const QString &url); Q_INVOKABLE QString loadCover(const QString &url);
......
...@@ -136,7 +136,7 @@ ApplicationWindow ...@@ -136,7 +136,7 @@ ApplicationWindow
// color: bae.foregroundColor() // color: bae.foregroundColor()
// } // }
Icon BabeIcon
{ {
anchors.centerIn: parent anchors.centerIn: parent
visible: !(searchInput.focus || searchInput.text) visible: !(searchInput.focus || searchInput.text)
......
...@@ -69,7 +69,7 @@ bool Pulpo::initServices() ...@@ -69,7 +69,7 @@ bool Pulpo::initServices()
if(this->track.isEmpty()) return false; if(this->track.isEmpty()) return false;
for(auto service : this->registeredServices) for(auto service : this->registeredServices)
{
switch (service) switch (service)
{ {
case SERVICES::LastFm: case SERVICES::LastFm:
...@@ -83,8 +83,10 @@ bool Pulpo::initServices() ...@@ -83,8 +83,10 @@ bool Pulpo::initServices()
}else qDebug()<<"error settingUp lastfm service"; }else qDebug()<<"error settingUp lastfm service";
break; break;
} }
case SERVICES::Spotify: case SERVICES::Spotify:
{ {
spotify spotify(this->track); spotify spotify(this->track);
...@@ -171,8 +173,12 @@ bool Pulpo::initServices() ...@@ -171,8 +173,12 @@ bool Pulpo::initServices()
{ {
break; break;
} }
} }
qDebug()<<"PULPO::ERROR HAPPENED!";
emit infoReady(this->track, this->packResponse(this->ontology, this->info, {{}}));
}
return false; return false;
} }
...@@ -219,15 +225,24 @@ QByteArray Pulpo::startConnection(const QString &url, const QMap<QString,QString ...@@ -219,15 +225,24 @@ QByteArray Pulpo::startConnection(const QString &url, const QMap<QString,QString
QNetworkReply *reply = manager.get(request); QNetworkReply *reply = manager.get(request);
QEventLoop loop; QEventLoop loop;
connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), &loop, connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), &loop,
SLOT(quit())); SLOT(quit()));
loop.exec(); loop.exec();
reply->deleteLater(); if(reply->error())
if(reply->error()) qDebug()<<reply->error(); {
return reply->readAll(); qDebug() << reply->error();
return QByteArray();
}
if(reply->bytesAvailable())
{
reply->deleteLater();
return reply->readAll();
}
} }
return QByteArray(); return QByteArray();
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<file>view_models/BabeAlbum.qml</file> <file>view_models/BabeAlbum.qml</file>
<file>view_models/BabeGrid.qml</file> <file>view_models/BabeGrid.qml</file>
<file>view_models/BabeTable.qml</file> <file>view_models/BabeTable.qml</file>
<file>utils/Icon.qml</file>
<file>widgets/BabeBar.qml</file> <file>widgets/BabeBar.qml</file>
<file>utils/Icons.js</file> <file>utils/Icons.js</file>
<file>utils/materialdesignicons-webfont.ttf</file> <file>utils/materialdesignicons-webfont.ttf</file>
...@@ -35,5 +34,6 @@ ...@@ -35,5 +34,6 @@
<file>widgets/FolderPicker.qml</file> <file>widgets/FolderPicker.qml</file>
<file>view_models/FolderPickerList.qml</file> <file>view_models/FolderPickerList.qml</file>
<file>view_models/FolderPickerDelegate.qml</file> <file>view_models/FolderPickerDelegate.qml</file>
<file>utils/BabeIcon.qml</file>
</qresource> </qresource>
</RCC> </RCC>
[Dolphin]
PreviewsShown=true
Timestamp=2018,1,20,11,15,12
Version=4
This diff is collapsed.
...@@ -13,4 +13,5 @@ Text ...@@ -13,4 +13,5 @@ Text
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
color: iconColor || defaultColor color: iconColor || defaultColor
} }
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
#include <QDirIterator> #include <QDirIterator>
#include <QApplication> #include <QApplication>
#include <QScreen> #include <QScreen>
#include <QtNetwork>
#include <QEventLoop>
#include <cmath> #include <cmath>
using namespace std; using namespace std;
namespace BAE namespace BAE
...@@ -201,7 +205,7 @@ namespace BAE ...@@ -201,7 +205,7 @@ namespace BAE
{KEY::ART, KEYMAP[KEY::ART]} {KEY::ART, KEYMAP[KEY::ART]}
}; };
inline QString transformTime(const qint64 &value) inline QString transformTime(const qint64 &value)
{ {
QString tStr; QString tStr;
if (value) if (value)
...@@ -451,6 +455,21 @@ namespace BAE ...@@ -451,6 +455,21 @@ namespace BAE
return static_cast<uint>(defaultValue); return static_cast<uint>(defaultValue);
} }
inline bool internetConnection()
{
QNetworkAccessManager nam;
QNetworkRequest req(QUrl("http://google.com"));
QNetworkReply *reply = nam.get(req);
QEventLoop loop;
QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
loop.exec();
if(reply->bytesAvailable())
return true;
else
return false;
}
} }
......
...@@ -44,7 +44,7 @@ ItemDelegate ...@@ -44,7 +44,7 @@ ItemDelegate
Layout.column: 1 Layout.column: 1
Layout.rowSpan: 2 Layout.rowSpan: 2
visible: quickPlay visible: quickPlay
Icon { text: MdiFont.Icon.playCircle } BabeIcon { text: MdiFont.Icon.playCircle }
onClicked: delegate.play() onClicked: delegate.play()
} }
...@@ -116,7 +116,7 @@ ItemDelegate ...@@ -116,7 +116,7 @@ ItemDelegate
{ {
id: menuBtn id: menuBtn
visible: bae.isMobile() visible: bae.isMobile()
Icon { text: MdiFont.Icon.dotsVertical } BabeIcon { text: MdiFont.Icon.dotsVertical }
onClicked: menuClicked() onClicked: menuClicked()
} }
} }
......
...@@ -82,7 +82,7 @@ Menu ...@@ -82,7 +82,7 @@ Menu
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Icon BabeIcon
{ {
text: starIcon text: starIcon
color: rate >= 1 ? starColor :starReg color: rate >= 1 ? starColor :starReg
...@@ -96,7 +96,7 @@ Menu ...@@ -96,7 +96,7 @@ Menu
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Icon BabeIcon
{ {
text: starIcon text: starIcon
color: rate >= 2 ? starColor :starReg color: rate >= 2 ? starColor :starReg
...@@ -110,7 +110,7 @@ Menu ...@@ -110,7 +110,7 @@ Menu
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Icon BabeIcon
{ {
text: starIcon text: starIcon
color: rate >= 3 ? starColor :starReg color: rate >= 3 ? starColor :starReg
...@@ -125,7 +125,7 @@ Menu ...@@ -125,7 +125,7 @@ Menu
// Layout.fillHeight: true // Layout.fillHeight: true
// Layout.fillWidth: true // Layout.fillWidth: true
// Layout.alignment: Qt.AlignCenter // Layout.alignment: Qt.AlignCenter
// Icon // BabeIcon
// { // {
// text: starIcon // text: starIcon
// color: rate >= 4 ? starColor :starReg // color: rate >= 4 ? starColor :starReg
...@@ -140,7 +140,7 @@ Menu ...@@ -140,7 +140,7 @@ Menu
// Layout.fillHeight: true // Layout.fillHeight: true
// Layout.fillWidth: true // Layout.fillWidth: true
// Layout.alignment: Qt.AlignCenter // Layout.alignment: Qt.AlignCenter
// Icon // BabeIcon
// { // {
// text: starIcon // text: starIcon
// color: rate >= 5 ? starColor :starReg // color: rate >= 5 ? starColor :starReg
......
...@@ -72,7 +72,7 @@ BabeGrid ...@@ -72,7 +72,7 @@ BabeGrid
width: parent.height width: parent.height
height: parent.height height: parent.height
Icon {text: MdiFont.Icon.playBoxOutline} BabeIcon {text: MdiFont.Icon.playBoxOutline}
onClicked: onClicked:
{ {
...@@ -94,7 +94,7 @@ BabeGrid ...@@ -94,7 +94,7 @@ BabeGrid
width: parent.height width: parent.height
height: parent.height height: parent.height
Icon {text: MdiFont.Icon.playlistPlus} BabeIcon {text: MdiFont.Icon.playlistPlus}
onClicked: onClicked:
{ {
...@@ -130,7 +130,7 @@ BabeGrid ...@@ -130,7 +130,7 @@ BabeGrid
width: parent.height width: parent.height
height: parent.height height: parent.height
Icon { text: MdiFont.Icon.close } BabeIcon { text: MdiFont.Icon.close }
onClicked: drawer.close() onClicked: drawer.close()
} }
......
...@@ -71,7 +71,7 @@ BabeGrid ...@@ -71,7 +71,7 @@ BabeGrid
height: parent.height height: parent.height
id: playAllBtn id: playAllBtn
Icon {text: MdiFont.Icon.playBoxOutline} BabeIcon {text: MdiFont.Icon.playBoxOutline}
onClicked: onClicked:
{ {
...@@ -91,7 +91,7 @@ BabeGrid ...@@ -91,7 +91,7 @@ BabeGrid
width: parent.height width: parent.height
height: parent.height height: parent.height
Icon {text: MdiFont.Icon.playlistPlus} BabeIcon {text: MdiFont.Icon.playlistPlus}
onClicked: onClicked:
{ {
...@@ -124,7 +124,7 @@ BabeGrid ...@@ -124,7 +124,7 @@ BabeGrid
width: parent.height width: parent.height
height: parent.height height: parent.height
Icon BabeIcon
{ {
text: MdiFont.Icon.close text: MdiFont.Icon.close
} }
......
...@@ -3,7 +3,7 @@ import QtQuick.Controls 2.2 ...@@ -3,7 +3,7 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "../utils/Icons.js" as MdiFont import "../utils/Icons.js" as MdiFont
import "../utils" import "../utils"
import QtLocation 5.3
ToolBar ToolBar
{ {
...@@ -43,7 +43,7 @@ ToolBar ...@@ -43,7 +43,7 @@ ToolBar
ToolButton ToolButton
{ {
id: playlistView id: playlistView
Icon BabeIcon
{ {
text: MdiFont.Icon.headphones text: MdiFont.Icon.headphones
color: currentIndex === 0? accentColor : textColor color: currentIndex === 0? accentColor : textColor
...@@ -67,7 +67,7 @@ ToolBar ...@@ -67,7 +67,7 @@ ToolBar
ToolButton ToolButton
{ {
id: tracksView id: tracksView
Icon BabeIcon
{ {
id: tracksIcon id: tracksIcon
text: MdiFont.Icon.musicNote text: MdiFont.Icon.musicNote
...@@ -88,7 +88,7 @@ ToolBar ...@@ -88,7 +88,7 @@ ToolBar
ToolButton ToolButton
{ {
id: albumsView id: albumsView
Icon BabeIcon
{ {
id: albumsIcon id: albumsIcon
text: MdiFont.Icon.album text: MdiFont.Icon.album
...@@ -109,7 +109,7 @@ ToolBar ...@@ -109,7 +109,7 @@ ToolBar
{ {
id: artistsView id: artistsView
Icon BabeIcon
{ {
id: artistsIcon id: artistsIcon
text: MdiFont.Icon.face text: MdiFont.Icon.face
...@@ -130,7 +130,7 @@ ToolBar ...@@ -130,7 +130,7 @@ ToolBar
{ {
id: playlistsView id: playlistsView
Icon BabeIcon
{ {
id: playlistsIcon id: playlistsIcon
text: MdiFont.Icon.libraryMusic text: MdiFont.Icon.libraryMusic
...@@ -159,7 +159,7 @@ ToolBar ...@@ -159,7 +159,7 @@ ToolBar
{ {
id: settingsView id: settingsView
Icon BabeIcon
{ {
id: settingsIcon id: settingsIcon
text: MdiFont.Icon.settings text: MdiFont.Icon.settings
......
...@@ -43,7 +43,7 @@ Popup ...@@ -43,7 +43,7 @@ Popup
{ {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
id: goBackBtn id: goBackBtn
Icon BabeIcon
{ {
text: MdiFont.Icon.arrowLeft text: MdiFont.Icon.arrowLeft
} }
......
...@@ -56,7 +56,7 @@ Item ...@@ -56,7 +56,7 @@ Item
Layout.column: 1 Layout.column: 1
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: columnWidth Layout.preferredHeight: columnWidth
Layout.maximumHeight: 250 Layout.maximumHeight: 300
visible: list.count>0 visible: list.count>0
Rectangle Rectangle
...@@ -79,7 +79,7 @@ Item ...@@ -79,7 +79,7 @@ Item
Image Image
{ {
id: artwork id: artwork
width: parent.height < 250 ? parent.height : 250 width: parent.height < 300 ? parent.height : 300
height: parent.height height: parent.height
anchors.centerIn: parent anchors.centerIn: parent
source: currentArtwork ? "file://"+encodeURIComponent(currentArtwork) : "qrc:/assets/cover.png" source: currentArtwork ? "file://"+encodeURIComponent(currentArtwork) : "qrc:/assets/cover.png"
...@@ -188,7 +188,7 @@ Item ...@@ -188,7 +188,7 @@ Item
ToolButton ToolButton
{ {
id: infoBtn id: infoBtn
Icon BabeIcon
{ {
text: stackView.currentItem === list ? MdiFont.Icon.informationOutline : MdiFont.Icon.arrowLeft text: stackView.currentItem === list ? MdiFont.Icon.informationOutline : MdiFont.Icon.arrowLeft
} }
...@@ -215,7 +215,7 @@ Item ...@@ -215,7 +215,7 @@ Item
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
ToolButton ToolButton
{ {
Icon BabeIcon
{ {
id: babeBtnIcon id: babeBtnIcon
text: MdiFont.Icon.heartOutline text: MdiFont.Icon.heartOutline
...@@ -228,14 +228,14 @@ Item ...@@ -228,14 +228,14 @@ Item
ToolButton ToolButton
{ {
id: previousBtn id: previousBtn
Icon {text: MdiFont.Icon.skipPrevious} BabeIcon {text: MdiFont.Icon.skipPrevious}
onClicked: Player.previousTrack() onClicked: Player.previousTrack()
} }
ToolButton ToolButton
{ {
id: playBtn id: playBtn
Icon {id: playIcon; text: MdiFont.Icon.play } BabeIcon {id: playIcon; text: MdiFont.Icon.play }
onClicked: onClicked:
{ {
if(player.isPaused()) Player.resumeTrack() if(player.isPaused()) Player.resumeTrack()
...@@ -246,7 +246,7 @@ Item ...@@ -246,7 +246,7 @@ Item
ToolButton ToolButton
{ {
id: nextBtn id: nextBtn
Icon{text: MdiFont.Icon.skipNext} BabeIcon{text: MdiFont.Icon.skipNext}
onClicked: Player.nextTrack() onClicked: Player.nextTrack()
} }
...@@ -254,7 +254,7 @@ Item ...@@ -254,7 +254,7 @@ Item
ToolButton ToolButton
{ {
id: shuffleBtn id: shuffleBtn
Icon { text: shuffle ? MdiFont.Icon.shuffle : MdiFont.Icon.shuffleDisabled} BabeIcon { text: shuffle ? MdiFont.Icon.shuffle : MdiFont.Icon.shuffleDisabled}
onClicked: shuffle = !shuffle onClicked: shuffle = !shuffle
} }
...@@ -267,7 +267,7 @@ Item ...@@ -267,7 +267,7 @@ Item
ToolButton ToolButton
{ {
id: menuBtn id: menuBtn
Icon {text: MdiFont.Icon.dotsVertical} BabeIcon {text: MdiFont.Icon.dotsVertical}
onClicked: playlistMenu.open() onClicked: playlistMenu.open()
} }
} }
......
...@@ -147,7 +147,7 @@ Drawer ...@@ -147,7 +147,7 @@ Drawer
{ {
id: addSource id: addSource
Icon{text: MdiFont.Icon.plus} BabeIcon{text: MdiFont.Icon.plus}
onClicked: onClicked:
{ {
...@@ -163,7 +163,7 @@ Drawer ...@@ -163,7 +163,7 @@ Drawer
ToolButton ToolButton
{ {
id: removeSource id: removeSource
Icon BabeIcon
{ {
id: albumsIcon id: albumsIcon
text: MdiFont.Icon.minus text: MdiFont.Icon.minus
......
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