Finish Tidal

- Add configurable settings
- Add progressbar
- Simplify code
This commit is contained in:
Jonas Kvinge
2018-09-06 17:39:26 +02:00
parent 440a223bfb
commit 0a64a2a394
10 changed files with 578 additions and 256 deletions

View File

@@ -71,6 +71,9 @@ TidalSearch::TidalSearch(Application *app, QObject *parent)
connect(this, SIGNAL(SearchAsyncSig(int, QString, TidalSettingsPage::SearchBy)), this, SLOT(DoSearchAsync(int, QString, TidalSettingsPage::SearchBy)));
connect(this, SIGNAL(ResultsAvailable(int, TidalSearch::ResultList)), SLOT(ResultsAvailableSlot(int, TidalSearch::ResultList)));
connect(this, SIGNAL(ArtLoaded(int, QImage)), SLOT(ArtLoadedSlot(int, QImage)));
connect(service_, SIGNAL(UpdateStatus(QString)), SLOT(UpdateStatusSlot(QString)));
connect(service_, SIGNAL(ProgressSetMaximum(int)), SLOT(ProgressSetMaximumSlot(int)));
connect(service_, SIGNAL(UpdateProgress(int)), SLOT(UpdateProgressSlot(int)));
connect(service_, SIGNAL(SearchResults(int, SongList)), SLOT(SearchDone(int, SongList)));
connect(service_, SIGNAL(SearchError(int, QString)), SLOT(HandleError(int, QString)));
@@ -178,6 +181,7 @@ void TidalSearch::CancelSearch(int id) {
return;
}
}
service_->CancelSearch();
}
void TidalSearch::timerEvent(QTimerEvent *e) {
@@ -311,3 +315,15 @@ MimeData *TidalSearch::LoadTracks(const ResultList &results) {
return mime_data;
}
void TidalSearch::UpdateStatusSlot(QString text) {
emit UpdateStatus(text);
}
void TidalSearch::ProgressSetMaximumSlot(int max) {
emit ProgressSetMaximum(max);
}
void TidalSearch::UpdateProgressSlot(int progress) {
emit UpdateProgress(progress);
}