From 952a191170caf62f23bf1ebb880b7e1b58b8057c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 24 Oct 2013 07:52:35 +0200 Subject: [PATCH] fixed load volumes model in select volume added full fordwar and backward navigation in volume scraping --- .../comic_vine/comic_vine_dialog.cpp | 21 +++++++++++++++++-- .../comic_vine/comic_vine_dialog.h | 4 +++- YACReaderLibrary/comic_vine/select_volume.cpp | 4 ++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index 965f6870..c6137179 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -73,6 +73,8 @@ void ComicVineDialog::doLayout() setLayout(mainLayout); setFixedSize(872,529); + + setWindowTitle("Comic Vine Scraper (beta)"); } void ComicVineDialog::doStackedWidgets() @@ -145,6 +147,9 @@ void ComicVineDialog::goBack() else showSearchSingleComic(); break; + case SortingComics: + showSelectVolume(); + break; default: break; } @@ -265,6 +270,12 @@ void ComicVineDialog::showSearchVolume() } void ComicVineDialog::showSelectVolume(const QString & json) +{ + showSelectVolume(); + selectVolumeWidget->load(json); +} + +void ComicVineDialog::showSelectVolume() { status = SelectingSeries; @@ -274,8 +285,6 @@ void ComicVineDialog::showSelectVolume(const QString & json) nextButton->setVisible(true); searchButton->setHidden(true); closeButton->setVisible(true); - - selectVolumeWidget->load(json); } void ComicVineDialog::showSelectComic(const QString &json) @@ -286,8 +295,16 @@ void ComicVineDialog::showSelectComic(const QString &json) void ComicVineDialog::showSortVolumeComics(const QString &json) { + status = SortingComics; + content->setCurrentWidget(sortVolumeComicsWidget); + sortVolumeComicsWidget->setData(comics, json); + + backButton->setVisible(true); + nextButton->setVisible(true); + searchButton->setHidden(true); + closeButton->setVisible(true); } void ComicVineDialog::showLoading() diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.h b/YACReaderLibrary/comic_vine/comic_vine_dialog.h index b97618a8..f3362e20 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.h +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.h @@ -47,6 +47,7 @@ protected slots: void launchSearchVolume(); void launchSearchComic(); void showSelectVolume(const QString & json); + void showSelectVolume(); void showSelectComic(const QString & json); void showSortVolumeComics(const QString & json); private: @@ -65,7 +66,8 @@ private: SelectingComic, SelectingSeries, SearchingSingleComic, - SearchingVolume + SearchingVolume, + SortingComics }; ScraperMode mode; diff --git a/YACReaderLibrary/comic_vine/select_volume.cpp b/YACReaderLibrary/comic_vine/select_volume.cpp index bc14dfa2..de4c560b 100644 --- a/YACReaderLibrary/comic_vine/select_volume.cpp +++ b/YACReaderLibrary/comic_vine/select_volume.cpp @@ -103,8 +103,8 @@ void SelectVolume::load(const QString & json) if(model != 0) delete model; - else - model = tempM; + + model = tempM; if(model->rowCount()>0) {