diff --git a/YACReaderLibrary/comic_vine/comic_vine_client.cpp b/YACReaderLibrary/comic_vine/comic_vine_client.cpp index d83a09ff..e0e9e505 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_client.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_client.cpp @@ -71,17 +71,12 @@ void ComicVineClient::processVolumeComicsInfo(const QByteArray &data) emit finished(); } -void ComicVineClient::queryTimeOut() -{ - -} - //CV_SERIES_DETAIL void ComicVineClient::getSeriesDetail(const QString & id) { HttpWorker * search = new HttpWorker(CV_SERIES_DETAIL.arg(id)); connect(search,SIGNAL(dataReady(const QByteArray &)),this,SLOT(proccessSeriesDetailData(const QByteArray &))); - connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); + connect(search,SIGNAL(timeout()),this,SIGNAL(timeOut())); connect(search,SIGNAL(finished()),search,SLOT(deleteLater())); search->get(); } @@ -90,7 +85,7 @@ void ComicVineClient::getSeriesCover(const QString & url) { HttpWorker * search = new HttpWorker(url); connect(search,SIGNAL(dataReady(const QByteArray &)),this,SIGNAL(seriesCover(const QByteArray &))); - connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); //TODO + connect(search,SIGNAL(timeout()),this,SIGNAL(timeOut())); //TODO connect(search,SIGNAL(finished()),search,SLOT(deleteLater())); search->get(); } @@ -100,7 +95,7 @@ void ComicVineClient::getVolumeComicsInfo(const QString & idVolume) { HttpWorker * search = new HttpWorker(CV_COMICS_INFO.arg(idVolume)); connect(search,SIGNAL(dataReady(const QByteArray &)),this,SLOT(processVolumeComicsInfo(const QByteArray &))); - connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); //TODO + connect(search,SIGNAL(timeout()),this,SIGNAL(timeOut())); //TODO connect(search,SIGNAL(finished()),search,SLOT(deleteLater())); search->get(); } diff --git a/YACReaderLibrary/comic_vine/comic_vine_client.h b/YACReaderLibrary/comic_vine/comic_vine_client.h index 7ab8898f..aadb18d2 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_client.h +++ b/YACReaderLibrary/comic_vine/comic_vine_client.h @@ -16,7 +16,7 @@ signals: void seriesDetail(QString);//JSON void seriesCover(const QByteArray &); void volumeComicsInfo(QString); - + void timeOut(); void finished(); public slots: void search(const QString & query, int page = 0); @@ -32,7 +32,5 @@ protected slots: void proccessSeriesDetailData(const QByteArray & data); void processVolumeComicsInfo(const QByteArray & data); - void queryTimeOut(); - }; #endif // COMIC_VINE_CLIENT_H diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index c6137179..c88d5720 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -133,6 +133,7 @@ void ComicVineDialog::goNext() ComicVineClient * comicVineClient = new ComicVineClient; connect(comicVineClient,SIGNAL(volumeComicsInfo(QString)),this,SLOT(showSortVolumeComics(QString))); + connect(comicVineClient,SIGNAL(timeOut()),this,SLOT(queryTimeOut())); connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater())); comicVineClient->getVolumeComicsInfo(selectVolumeWidget->getSelectedVolumeId()); } @@ -307,6 +308,25 @@ void ComicVineDialog::showSortVolumeComics(const QString &json) closeButton->setVisible(true); } +void ComicVineDialog::queryTimeOut() +{ + QMessageBox::warning(this,"Comic Vine error", "Time out connecting to Comic Vine"); + + switch (status) { + case SelectingSeries: + if(mode == Volume) + showSearchVolume(); + else + showSearchSingleComic(); + break; + case SortingComics: + showSelectVolume(); + break; + default: + break; + } +} + void ComicVineDialog::showLoading() { content->setCurrentIndex(0); @@ -333,6 +353,7 @@ void ComicVineDialog::searchVolume(const QString &v) { ComicVineClient * comicVineClient = new ComicVineClient; connect(comicVineClient,SIGNAL(searchResult(QString)),this,SLOT(debugClientResults(QString))); + connect(comicVineClient,SIGNAL(timeOut()),this,SLOT(queryTimeOut())); connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater())); comicVineClient->search(v); diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.h b/YACReaderLibrary/comic_vine/comic_vine_dialog.h index f3362e20..31e358e8 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.h +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.h @@ -50,6 +50,7 @@ protected slots: void showSelectVolume(); void showSelectComic(const QString & json); void showSortVolumeComics(const QString & json); + void queryTimeOut(); private: enum ScraperMode