mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -04:00
SingleComicInList mode working
This commit is contained in:
parent
ff37db33e9
commit
f083713d53
@ -99,6 +99,7 @@ void ComicVineDialog::doConnections()
|
||||
connect(nextButton,SIGNAL(clicked()),this,SLOT(goNext()));
|
||||
connect(backButton,SIGNAL(clicked()),this,SLOT(goBack()));
|
||||
connect(searchButton,SIGNAL(clicked()),this,SLOT(search()));
|
||||
connect(skipButton,SIGNAL(clicked()),this,SLOT(goToNextComic()));
|
||||
}
|
||||
|
||||
void ComicVineDialog::goNext()
|
||||
@ -126,8 +127,8 @@ void ComicVineDialog::goNext()
|
||||
ComicDB comic = comics[currentIndex];
|
||||
QString title = comic.getTitleOrFileName();
|
||||
titleHeader->setSubTitle(tr("comic %1 of %2 - %3").arg(currentIndex+1).arg(comics.length()).arg(title));
|
||||
showLoading(tr("Looking for volume..."));
|
||||
|
||||
showLoading(tr("Looking for volume..."));
|
||||
searchVolume(title);
|
||||
status = AutoSearching;
|
||||
mode = SingleComicInList;
|
||||
@ -279,6 +280,11 @@ void ComicVineDialog::showSeriesQuestion()
|
||||
nextButton->setVisible(true);
|
||||
searchButton->setHidden(true);
|
||||
closeButton->setVisible(true);
|
||||
|
||||
if(mode == SingleComicInList)
|
||||
skipButton->setVisible(true);
|
||||
else
|
||||
skipButton->setHidden(true);
|
||||
}
|
||||
|
||||
void ComicVineDialog::showSearchSingleComic()
|
||||
@ -290,6 +296,11 @@ void ComicVineDialog::showSearchSingleComic()
|
||||
nextButton->setHidden(true);
|
||||
searchButton->setVisible(true);
|
||||
closeButton->setVisible(true);
|
||||
|
||||
if(mode == SingleComicInList)
|
||||
skipButton->setVisible(true);
|
||||
else
|
||||
skipButton->setHidden(true);
|
||||
}
|
||||
|
||||
void ComicVineDialog::showSearchVolume()
|
||||
@ -300,11 +311,7 @@ void ComicVineDialog::showSearchVolume()
|
||||
nextButton->setHidden(true);
|
||||
searchButton->setVisible(true);
|
||||
closeButton->setVisible(true);
|
||||
|
||||
if (mode == SingleComicInList)
|
||||
skipButton->setVisible(true);
|
||||
else
|
||||
skipButton->setHidden(true);
|
||||
toggleSkipButton();
|
||||
}
|
||||
|
||||
void ComicVineDialog::showSelectVolume(const QString & json)
|
||||
@ -323,6 +330,7 @@ void ComicVineDialog::showSelectVolume()
|
||||
nextButton->setVisible(true);
|
||||
searchButton->setHidden(true);
|
||||
closeButton->setVisible(true);
|
||||
toggleSkipButton();
|
||||
}
|
||||
|
||||
void ComicVineDialog::showSelectComic(const QString &json)
|
||||
@ -336,6 +344,7 @@ void ComicVineDialog::showSelectComic(const QString &json)
|
||||
nextButton->setVisible(true);
|
||||
searchButton->setHidden(true);
|
||||
closeButton->setVisible(true);
|
||||
toggleSkipButton();
|
||||
}
|
||||
|
||||
void ComicVineDialog::showSortVolumeComics(const QString &json)
|
||||
@ -350,6 +359,7 @@ void ComicVineDialog::showSortVolumeComics(const QString &json)
|
||||
nextButton->setVisible(true);
|
||||
searchButton->setHidden(true);
|
||||
closeButton->setVisible(true);
|
||||
toggleSkipButton();
|
||||
}
|
||||
|
||||
void ComicVineDialog::queryTimeOut()
|
||||
@ -437,7 +447,7 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
|
||||
emit accepted();
|
||||
} else
|
||||
{
|
||||
currentIndex++;
|
||||
goToNextComic();
|
||||
}
|
||||
}
|
||||
|
||||
@ -567,7 +577,33 @@ QMap<QString, QString> ComicVineDialog::getAuthors(const QScriptValue &json_auth
|
||||
}
|
||||
}
|
||||
|
||||
return authors;
|
||||
return authors;
|
||||
}
|
||||
|
||||
void ComicVineDialog::toggleSkipButton()
|
||||
{
|
||||
if (mode == SingleComicInList)
|
||||
skipButton->setVisible(true);
|
||||
else
|
||||
skipButton->setHidden(true);
|
||||
}
|
||||
|
||||
void ComicVineDialog::goToNextComic()
|
||||
{
|
||||
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
||||
{
|
||||
close();
|
||||
emit accepted();
|
||||
return;
|
||||
}
|
||||
|
||||
currentIndex++;
|
||||
|
||||
showSearchSingleComic();
|
||||
|
||||
ComicDB comic = comics[currentIndex];
|
||||
QString title = comic.getTitleOrFileName();
|
||||
titleHeader->setSubTitle(tr("comic %1 of %2 - %3").arg(currentIndex+1).arg(comics.length()).arg(title));
|
||||
}
|
||||
|
||||
void ComicVineDialog::showLoading(const QString &message)
|
||||
|
@ -57,15 +57,17 @@ protected slots:
|
||||
void queryTimeOut();
|
||||
void getComicsInfo(QList<QPair<ComicDB,QString> > & matchingInfo, int count, const QString & publisher);
|
||||
void getComicInfo(const QString & comicId, int count, const QString & publisher);
|
||||
|
||||
ComicDB parseComicInfo(ComicDB &comic, const QString & json, int count, const QString &publisher);
|
||||
|
||||
void setLoadingMessage(const QString &message);
|
||||
void goToNextComic();
|
||||
|
||||
private:
|
||||
|
||||
QString getCharacters(const QScriptValue & json_characters);
|
||||
QMap<QString,QString> getAuthors(const QScriptValue & json_authors);
|
||||
|
||||
void toggleSkipButton();
|
||||
|
||||
enum ScraperMode
|
||||
{
|
||||
SingleComic, //the scraper has been opened for a single comic
|
||||
|
Loading…
x
Reference in New Issue
Block a user