diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f4b79e3b..c10c8575 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +6.9 (No pública) +Añadida la apertura automática del siguiente/anterior cómic al llegar al final/portada del cómic actual +Corregido el comportamiento del diálogo de nueva versión detectada. Ahora avisa una vez al día o si el usuario lo elige cada 14 días. + 6.8 (No pública) Corregido bug que causaba un cierre inesperado después de cambiar el modo de sincronización vertical (flow) Corregido bug que causaba que la toolbar en el visor no se pudiese ocultar/mostrar sin un cómic abierto @@ -5,6 +9,7 @@ Mejorada la gesti Corregidos algunos bugs relacionados con la apertura de cómics Añadido función de rating El visor ahora puede abrir archivos de imagen directamente. Si se abre un archivo de imagen se abre el directorio que lo contiene con todas las imágenes. +Corregida la ordenación de carpetas y cómics usada en la navegación desde dispositivos iOS 6.7 (No pública) Añadidos nuevos campos en la base de datos para almacenar información adicional sobre cómics: rating, página actual, bookmarks y configuración de imagen diff --git a/YACReader/render.cpp b/YACReader/render.cpp index e9d2d318..eec84d3b 100644 --- a/YACReader/render.cpp +++ b/YACReader/render.cpp @@ -682,10 +682,7 @@ void Render::createComic(const QString & path) } void Render::loadComic(const QString & path,const ComicDB & comicDB) { - //if(typeid(*comic) != typeid(FolderComic)) - comic->load(path,comicDB); - //else - {/*TODO error*/} + comic->load(path,comicDB); } void Render::loadComic(const QString & path, int atPage) { diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index e2cb1ab0..2bf8c220 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -252,11 +252,10 @@ void Viewer::updatePage() updateVerticalScrollBar(); emit backgroundChanges(); emit(pageAvailable(true)); - //TODO -> update bookmark action + setFocus(Qt::ShortcutFocusReason); delete previousPage; - //TODO: fix loading...please wait! if(currentPage->isNull()) setPageUnavailableMessage(); diff --git a/YACReaderLibrary/comic_vine/comic_vine_client.cpp b/YACReaderLibrary/comic_vine/comic_vine_client.cpp index ed9403f4..e564db48 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_client.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_client.cpp @@ -15,7 +15,7 @@ static const QString CV_SEARCH = CV_WEB_ADDRESS + "/search/?api_key=" + CV_API_K //gets the detail for a volume %1 static const QString CV_SERIES_DETAIL = CV_WEB_ADDRESS + "/volume/4050-%1/?api_key=" + CV_API_KEY + - "&format=json&field_list=name,start_year,publisher,image,count_of_issues,id"; + "&format=json&field_list=name,start_year,publisher,image,count_of_issues,id,description"; //gets ids for comics in a volume id %1 static const QString CV_COMIC_IDS = CV_WEB_ADDRESS + "/issues/?api_key=" + CV_API_KEY + @@ -57,6 +57,13 @@ void ComicVineClient::proccessVolumesSearchData(const QByteArray & data) emit finished(); } +void ComicVineClient::proccessSeriesDetailData(const QByteArray &data) +{ + QString json(data); + emit seriesDetail(json); + emit finished(); +} + void ComicVineClient::queryTimeOut() { @@ -65,7 +72,20 @@ 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(finished()),search,SLOT(deleteLater())); + search->get(); +} +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(finished()),search,SLOT(deleteLater())); + search->get(); } //CV_COMIC_IDS diff --git a/YACReaderLibrary/comic_vine/comic_vine_client.h b/YACReaderLibrary/comic_vine/comic_vine_client.h index be12dc47..d2a62c22 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_client.h +++ b/YACReaderLibrary/comic_vine/comic_vine_client.h @@ -13,16 +13,21 @@ public: signals: void searchResult(QString); + void seriesDetail(QString);//JSON + void seriesCover(const QByteArray &); void finished(); public slots: void search(const QString & query, int page = 0); void getSeriesDetail(const QString & id); + void getSeriesCover(const QString & url); + void getComicIds(const QString & id, int page = 0); void getComicId(const QString & id, int comicNumber); void getComicDetail(const QString & id); void getCoverURL(const QString & id); protected slots: void proccessVolumesSearchData(const QByteArray & data); + void proccessSeriesDetailData(const QByteArray & data); void queryTimeOut(); }; diff --git a/YACReaderLibrary/comic_vine/select_volume.cpp b/YACReaderLibrary/comic_vine/select_volume.cpp index d5abb9c2..b71fdbae 100644 --- a/YACReaderLibrary/comic_vine/select_volume.cpp +++ b/YACReaderLibrary/comic_vine/select_volume.cpp @@ -7,9 +7,13 @@ #include #include #include +#include +#include + +#include #include "volumes_model.h" -#include "http_worker.h" +#include "comic_vine_client.h" SelectVolume::SelectVolume(QWidget *parent) :QWidget(parent),model(0) @@ -44,9 +48,38 @@ SelectVolume::SelectVolume(QWidget *parent) cover = new QLabel(); cover->setScaledContents(true); cover->setAlignment(Qt::AlignTop|Qt::AlignHCenter); + cover->setMinimumSize(168,168*5.0/3); + cover->setStyleSheet("QLabel {background-color: #2B2B2B; color:white; font-size:12px; font-family:Arial; }"); detailLabel = new QLabel(); - detailLabel->setStyleSheet(labelStylesheet); + detailLabel->setStyleSheet("QLabel {background-color: #2B2B2B; color:white; font-size:12px; font-family:Arial; }"); detailLabel->setWordWrap(true); + + detailLabel->setMinimumSize(168,12); + + connect(detailLabel,SIGNAL(linkActivated(QString)),this,SLOT(openLink(QString))); + + QScrollArea * scroll = new QScrollArea(this); + scroll->setWidget(detailLabel); + scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scroll->setStyleSheet( + "QScrollArea {background-color:#2B2B2B; border:none;}" + "QScrollBar:vertical { border: none; background: #2B2B2B; width: 3px; margin: 0; }" + "QScrollBar:horizontal { border: none; background: #2B2B2B; height: 3px; margin: 0; }" + "QScrollBar::handle:vertical { background: #DDDDDD; width: 7px; min-height: 20px; }" + "QScrollBar::handle:horizontal { background: #DDDDDD; width: 7px; min-height: 20px; }" + "QScrollBar::add-line:vertical { border: none; background: #404040; height: 10px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 3px 0 0;}" + "QScrollBar::sub-line:vertical { border: none; background: #404040; height: 10px; subcontrol-position: top; subcontrol-origin: margin; margin: 0 3px 0 0;}" + "QScrollBar::add-line:horizontal { border: none; background: #404040; width: 10px; subcontrol-position: bottom; subcontrol-origin: margin; margin: 0 0 3px 0;}" + "QScrollBar::sub-line:horizontal { border: none; background: #404040; width: 10px; subcontrol-position: top; subcontrol-origin: margin; margin: 0 0 3px 0;}" + "QScrollBar::up-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-up.png') center top no-repeat;}" + "QScrollBar::down-arrow:vertical {border:none;width: 9px;height: 6px;background: url(':/images/folders_view/line-down.png') center top no-repeat;}" + "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical, QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {background: none; }" + + ); + //scroll->setWidgetResizable(true); + //iScroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + //iScroll->show(); + tableVolumes = new QTableView(); tableVolumes->setStyleSheet(tableStylesheet); @@ -87,7 +120,7 @@ SelectVolume::SelectVolume(QWidget *parent) connect(tableVolumes,SIGNAL(clicked(QModelIndex)),this,SLOT(loadVolumeInfo(QModelIndex))); left->addWidget(cover); - left->addWidget(detailLabel); + left->addWidget(scroll,1); left->addStretch(); leftWidget->setMaximumWidth(180); leftWidget->setLayout(left); @@ -140,14 +173,22 @@ void SelectVolume::loadVolumeInfo(const QModelIndex & mi) QString id = data->at(VolumesModel::ID); //cover->setText(coverURL); - detailLabel->setText(deck); + //detailLabel->setText(deck); + QString loadingStyle = "%1"; + cover->setText(loadingStyle.arg(tr("loading cover"))); + detailLabel->setAlignment(Qt::AlignTop|Qt::AlignHCenter); + detailLabel->setText(loadingStyle.arg(tr("loading description"))); + detailLabel->adjustSize(); - HttpWorker * search = new HttpWorker(coverURL); - connect(search,SIGNAL(dataReady(const QByteArray &)),this,SLOT(setCover(const QByteArray &))); - connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); //TODO - connect(search,SIGNAL(finished()),search,SLOT(deleteLater())); - search->get(); + ComicVineClient * comicVineClient = new ComicVineClient; + connect(comicVineClient,SIGNAL(seriesCover(const QByteArray &)),this,SLOT(setCover(const QByteArray &))); + connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater())); + comicVineClient->getSeriesCover(coverURL); + ComicVineClient * comicVineClient2 = new ComicVineClient; + connect(comicVineClient2,SIGNAL(seriesDetail(QString)),this,SLOT(setDescription(QString))); + connect(comicVineClient2,SIGNAL(finished()),comicVineClient2,SLOT(deleteLater())); + comicVineClient2->getSeriesDetail(id); } void SelectVolume::setCover(const QByteArray & data) @@ -165,8 +206,26 @@ void SelectVolume::setCover(const QByteArray & data) cover->update(); } -void SelectVolume::setDescription(const QString &description) +void SelectVolume::setDescription(const QString & jsonDetail) { + QScriptEngine engine; + QScriptValue sc; + sc = engine.evaluate("(" + jsonDetail + ")"); + if (!sc.property("error").isValid() && sc.property("error").toString() != "OK") + { + qDebug("Error detected"); + } + else + { + detailLabel->setAlignment(Qt::AlignTop|Qt::AlignLeft); + detailLabel->setText(sc.property("results").property("description").toString().replace("adjustSize(); + } +} + +void SelectVolume::openLink(const QString & link) +{ + QDesktopServices::openUrl(QUrl("http://www.comicvine.com"+link)); } diff --git a/YACReaderLibrary/comic_vine/select_volume.h b/YACReaderLibrary/comic_vine/select_volume.h index f6ec7733..42c74876 100644 --- a/YACReaderLibrary/comic_vine/select_volume.h +++ b/YACReaderLibrary/comic_vine/select_volume.h @@ -18,7 +18,8 @@ public: public slots: void loadVolumeInfo(const QModelIndex & mi); void setCover(const QByteArray &); - void setDescription(const QString & description); + void setDescription(const QString & jsonDetail); + void openLink(const QString & link); private: QLabel * cover; QLabel * detailLabel; diff --git a/YACReaderLibrary/db/tablemodel.cpp b/YACReaderLibrary/db/tablemodel.cpp index b783d4b3..38cc04b3 100644 --- a/YACReaderLibrary/db/tablemodel.cpp +++ b/YACReaderLibrary/db/tablemodel.cpp @@ -293,7 +293,7 @@ void TableModel::setupModelData(QSqlQuery &sqlquery) QString nameCurrent = currentItem->data(TableModel::FileName).toString(); int numberLast,numberCurrent; int max = (std::numeric_limits::max)(); - numberLast = numberCurrent = max; //TODO change by std limit + numberLast = numberCurrent = max; if(!last->data(TableModel::Number).isNull()) numberLast = last->data(TableModel::Number).toInt(); @@ -619,4 +619,4 @@ void TableModel::updateRating(int rating, QModelIndex mi) db.close(); QSqlDatabase::removeDatabase(_databasePath); -} \ No newline at end of file +} diff --git a/YACReaderLibrary/db/treeitem.cpp b/YACReaderLibrary/db/treeitem.cpp index 57d6f5de..84b77583 100644 --- a/YACReaderLibrary/db/treeitem.cpp +++ b/YACReaderLibrary/db/treeitem.cpp @@ -68,7 +68,7 @@ TreeItem::~TreeItem() void TreeItem::appendChild(TreeItem *item) { item->parentItem = this; - //TODO insertar odernado + if(childItems.isEmpty()) childItems.append(item); else @@ -144,4 +144,4 @@ int TreeItem::row() const QList TreeItem::getData() const { return itemData; -} \ No newline at end of file +} diff --git a/common/check_new_version.cpp b/common/check_new_version.cpp index 9bbb981b..e27c0562 100644 --- a/common/check_new_version.cpp +++ b/common/check_new_version.cpp @@ -22,7 +22,7 @@ void HttpVersionChecker::checkNewVersion(const QByteArray & data) { checkNewVersion(QString(data)); } -//TODO escribir prueba unitaria + bool HttpVersionChecker::checkNewVersion(QString sourceContent) { #ifdef Q_OS_WIN32 @@ -81,4 +81,4 @@ bool HttpVersionChecker::checkNewVersion(QString sourceContent) { return false; } -} \ No newline at end of file +} diff --git a/common/comic.cpp b/common/comic.cpp index 0cc4de32..bfaef792 100644 --- a/common/comic.cpp +++ b/common/comic.cpp @@ -626,8 +626,6 @@ void PDFComic::process() { delete pdfComic; pdfComic = 0; - //TODO emitir este mensaje en otro sitio - //QMessageBox::critical(NULL,QObject::tr("Bad PDF File"),QObject::tr("Invalid PDF file")); emit errorOpening(); return; }