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

example pic

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