@@ -34,6 +34,7 @@
|
||||
Sequeira.
|
||||
25. When searching for lyrics, if fail and artist starts with "The " then try
|
||||
again without "The "
|
||||
26. Add "Refresh" action to hover actions for podcasts.
|
||||
|
||||
2.4.2
|
||||
-----
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "support/utils.h"
|
||||
#include "support/monoicon.h"
|
||||
#include "gui/settings.h"
|
||||
#include "gui/stdactions.h"
|
||||
#include "widgets/icons.h"
|
||||
#include "mpd-interface/mpdconnection.h"
|
||||
#include "config.h"
|
||||
@@ -427,6 +428,7 @@ PodcastService::PodcastService()
|
||||
useCovers(name(), true);
|
||||
clearPartialDownloads();
|
||||
connect(MPDConnection::self(), SIGNAL(currentSongUpdated(const Song &)), this, SLOT(currentMpdSong(const Song &)));
|
||||
refreshAction = new Action(Icons::self()->reloadIcon, tr("Refresh"), this);
|
||||
}
|
||||
|
||||
QString PodcastService::name() const
|
||||
@@ -577,6 +579,11 @@ QVariant PodcastService::data(const QModelIndex &index, int role) const
|
||||
Podcast *podcast=static_cast<Podcast *>(item);
|
||||
|
||||
switch(role) {
|
||||
case Cantata::Role_Actions: {
|
||||
QVariant v;
|
||||
v.setValue<QList<Action *> >(QList<Action *>() << StdActions::self()->replacePlayQueueAction << StdActions::self()->appendToPlayQueueAction << refreshAction);
|
||||
return v;
|
||||
}
|
||||
case Cantata::Role_ListImage:
|
||||
return true;
|
||||
case Cantata::Role_CoverSong: {
|
||||
|
||||
@@ -162,6 +162,7 @@ public:
|
||||
void startRssUpdateTimer();
|
||||
void stopRssUpdateTimer();
|
||||
bool exportSubscriptions(const QString &name);
|
||||
Action * refreshAct() { return refreshAction; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void error(const QString &msg);
|
||||
@@ -206,6 +207,7 @@ private:
|
||||
QTimer *deleteTimer;
|
||||
QDateTime lastDelete;
|
||||
QSet<QUrl> updateUrls;
|
||||
Action *refreshAction;
|
||||
static QString iconFile;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ PodcastWidget::PodcastWidget(PodcastService *s, QWidget *p)
|
||||
connect(markAsListenedAction, SIGNAL(triggered()), this, SLOT(markAsListened()));
|
||||
//connect(unplayedOnlyAction, SIGNAL(toggled(bool)), this, SLOT(showUnplayedOnly(bool)));
|
||||
connect(exportAction, SIGNAL(triggered()), SLOT(exportSubscriptions()));
|
||||
connect(srv->refreshAct(), SIGNAL(triggered()), this, SLOT(refreshPodcast()));
|
||||
|
||||
view->setMode(ItemView::Mode_DetailedTree);
|
||||
Configuration config(metaObject()->className());
|
||||
@@ -271,7 +272,17 @@ void PodcastWidget::doSearch()
|
||||
}
|
||||
}
|
||||
|
||||
void PodcastWidget::refreshPodcast()
|
||||
{
|
||||
doRefresh(true);
|
||||
}
|
||||
|
||||
void PodcastWidget::refresh()
|
||||
{
|
||||
doRefresh(false);
|
||||
}
|
||||
|
||||
void PodcastWidget::doRefresh(bool singleOnly)
|
||||
{
|
||||
QModelIndexList sel=view->selectedIndexes(false);
|
||||
QModelIndexList selected;
|
||||
@@ -281,6 +292,13 @@ void PodcastWidget::refresh()
|
||||
}
|
||||
}
|
||||
|
||||
if (singleOnly) {
|
||||
if (1==selected.count()) {
|
||||
srv->refresh(selected);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (selected.isEmpty() || selected.count()==srv->podcastCount()) {
|
||||
srv->refreshAll();
|
||||
return;
|
||||
|
||||
@@ -52,10 +52,12 @@ private Q_SLOTS:
|
||||
//void showUnplayedOnly(bool on);
|
||||
void configure();
|
||||
void exportSubscriptions();
|
||||
void refreshPodcast();
|
||||
|
||||
private:
|
||||
void doSearch() override;
|
||||
void refresh() override;
|
||||
void doRefresh(bool singleOnly);
|
||||
void controlActions() override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user