Add clear to playqueue. Currently no icon!!!

This commit is contained in:
craig.p.drummond
2014-04-11 17:40:18 +00:00
parent 56a996c24b
commit 288befdfd7
3 changed files with 11 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ MPDBackend::MPDBackend(QObject *parent) : QObject(parent)
// connect(this, SIGNAL(setSeekId(qint32, quint32)), MPDConnection::self(), SLOT(setSeekId(qint32, quint32)));
connect(this, SIGNAL(startPlayingSongId(qint32)), MPDConnection::self(), SLOT(startPlayingSongId(qint32)));
connect(this, SIGNAL(setDetails(const MPDConnectionDetails &)), MPDConnection::self(), SLOT(setDetails(const MPDConnectionDetails &)));
connect(this, SIGNAL(clear()), MPDConnection::self(), SLOT(clear()));
// connect(this, SIGNAL(setPriority(const QList<qint32> &, quint8 )), MPDConnection::self(), SLOT(setPriority(const QList<qint32> &, quint8)));
// connect(this, SIGNAL(addSongsToPlaylist(const QString &, const QStringList &)), MPDConnection::self(), SLOT(addToPlaylist(const QString &, const QStringList &)));

View File

@@ -58,6 +58,7 @@ public:
Q_INVOKABLE void playPause();
Q_INVOKABLE void nextSong();
Q_INVOKABLE void previousSong();
Q_INVOKABLE void clearPlayQueue() { emit clear(); }
Q_INVOKABLE bool getIsConnected() { return MPDConnection::self()->isConnected(); }
Q_INVOKABLE void addAlbum(int index, bool replace);
Q_INVOKABLE void removeFromPlayQueue(int index);
@@ -74,7 +75,7 @@ public:
Q_INVOKABLE bool getAlbumsFound() { return AlbumsModel::self()->rowCount() != 0; }
signals:
Q_SIGNALS:
void onConnectedChanged();
void onPlayingStatusChanged();
void onCurrentSongChanged();
@@ -117,6 +118,7 @@ Q_SIGNALS:
void updateLibrary();
void add(const QStringList &files, bool replace, quint8 priorty); //Album
void setVolume(int volume);
void clear();
private:
void updateStatus(MPDStatus * const status);

View File

@@ -55,6 +55,13 @@ Page {
opened: true
locked: root.width > units.gu(60) && opened //"&& opened": prevents the bar from being hidden and locked at the same time
pageStack: pageStack
ToolbarButton {
//iconSource: Qt.resolvedUrl("../../icons/toolbar/help.svg")
action: Action {
text: i18n.tr("Clear")
onTriggered: backend.clearPlayQueue()
}
}
}
Row {