mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
some TODOs comments removed
SelectVolume: finished load volume cover/detail
This commit is contained in:
parent
0b1a0098d5
commit
a6b7df4d90
@ -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)
|
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 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
|
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
|
Corregidos algunos bugs relacionados con la apertura de cómics
|
||||||
Añadido función de rating
|
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.
|
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)
|
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
|
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
|
||||||
|
@ -682,10 +682,7 @@ void Render::createComic(const QString & path)
|
|||||||
}
|
}
|
||||||
void Render::loadComic(const QString & path,const ComicDB & comicDB)
|
void Render::loadComic(const QString & path,const ComicDB & comicDB)
|
||||||
{
|
{
|
||||||
//if(typeid(*comic) != typeid(FolderComic))
|
comic->load(path,comicDB);
|
||||||
comic->load(path,comicDB);
|
|
||||||
//else
|
|
||||||
{/*TODO error*/}
|
|
||||||
}
|
}
|
||||||
void Render::loadComic(const QString & path, int atPage)
|
void Render::loadComic(const QString & path, int atPage)
|
||||||
{
|
{
|
||||||
|
@ -252,11 +252,10 @@ void Viewer::updatePage()
|
|||||||
updateVerticalScrollBar();
|
updateVerticalScrollBar();
|
||||||
emit backgroundChanges();
|
emit backgroundChanges();
|
||||||
emit(pageAvailable(true));
|
emit(pageAvailable(true));
|
||||||
//TODO -> update bookmark action
|
|
||||||
setFocus(Qt::ShortcutFocusReason);
|
setFocus(Qt::ShortcutFocusReason);
|
||||||
delete previousPage;
|
delete previousPage;
|
||||||
|
|
||||||
//TODO: fix loading...please wait!
|
|
||||||
if(currentPage->isNull())
|
if(currentPage->isNull())
|
||||||
setPageUnavailableMessage();
|
setPageUnavailableMessage();
|
||||||
|
|
||||||
|
@ -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
|
//gets the detail for a volume %1
|
||||||
static const QString CV_SERIES_DETAIL = CV_WEB_ADDRESS + "/volume/4050-%1/?api_key=" + CV_API_KEY +
|
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
|
//gets ids for comics in a volume id %1
|
||||||
static const QString CV_COMIC_IDS = CV_WEB_ADDRESS + "/issues/?api_key=" + CV_API_KEY +
|
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();
|
emit finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ComicVineClient::proccessSeriesDetailData(const QByteArray &data)
|
||||||
|
{
|
||||||
|
QString json(data);
|
||||||
|
emit seriesDetail(json);
|
||||||
|
emit finished();
|
||||||
|
}
|
||||||
|
|
||||||
void ComicVineClient::queryTimeOut()
|
void ComicVineClient::queryTimeOut()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -65,7 +72,20 @@ void ComicVineClient::queryTimeOut()
|
|||||||
//CV_SERIES_DETAIL
|
//CV_SERIES_DETAIL
|
||||||
void ComicVineClient::getSeriesDetail(const QString & id)
|
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
|
//CV_COMIC_IDS
|
||||||
|
@ -13,16 +13,21 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void searchResult(QString);
|
void searchResult(QString);
|
||||||
|
void seriesDetail(QString);//JSON
|
||||||
|
void seriesCover(const QByteArray &);
|
||||||
void finished();
|
void finished();
|
||||||
public slots:
|
public slots:
|
||||||
void search(const QString & query, int page = 0);
|
void search(const QString & query, int page = 0);
|
||||||
void getSeriesDetail(const QString & id);
|
void getSeriesDetail(const QString & id);
|
||||||
|
void getSeriesCover(const QString & url);
|
||||||
|
|
||||||
void getComicIds(const QString & id, int page = 0);
|
void getComicIds(const QString & id, int page = 0);
|
||||||
void getComicId(const QString & id, int comicNumber);
|
void getComicId(const QString & id, int comicNumber);
|
||||||
void getComicDetail(const QString & id);
|
void getComicDetail(const QString & id);
|
||||||
void getCoverURL(const QString & id);
|
void getCoverURL(const QString & id);
|
||||||
protected slots:
|
protected slots:
|
||||||
void proccessVolumesSearchData(const QByteArray & data);
|
void proccessVolumesSearchData(const QByteArray & data);
|
||||||
|
void proccessSeriesDetailData(const QByteArray & data);
|
||||||
void queryTimeOut();
|
void queryTimeOut();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -7,9 +7,13 @@
|
|||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
|
||||||
|
#include <QtScript>
|
||||||
|
|
||||||
#include "volumes_model.h"
|
#include "volumes_model.h"
|
||||||
#include "http_worker.h"
|
#include "comic_vine_client.h"
|
||||||
|
|
||||||
SelectVolume::SelectVolume(QWidget *parent)
|
SelectVolume::SelectVolume(QWidget *parent)
|
||||||
:QWidget(parent),model(0)
|
:QWidget(parent),model(0)
|
||||||
@ -44,9 +48,38 @@ SelectVolume::SelectVolume(QWidget *parent)
|
|||||||
cover = new QLabel();
|
cover = new QLabel();
|
||||||
cover->setScaledContents(true);
|
cover->setScaledContents(true);
|
||||||
cover->setAlignment(Qt::AlignTop|Qt::AlignHCenter);
|
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 = new QLabel();
|
||||||
detailLabel->setStyleSheet(labelStylesheet);
|
detailLabel->setStyleSheet("QLabel {background-color: #2B2B2B; color:white; font-size:12px; font-family:Arial; }");
|
||||||
detailLabel->setWordWrap(true);
|
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 = new QTableView();
|
||||||
tableVolumes->setStyleSheet(tableStylesheet);
|
tableVolumes->setStyleSheet(tableStylesheet);
|
||||||
|
|
||||||
@ -87,7 +120,7 @@ SelectVolume::SelectVolume(QWidget *parent)
|
|||||||
connect(tableVolumes,SIGNAL(clicked(QModelIndex)),this,SLOT(loadVolumeInfo(QModelIndex)));
|
connect(tableVolumes,SIGNAL(clicked(QModelIndex)),this,SLOT(loadVolumeInfo(QModelIndex)));
|
||||||
|
|
||||||
left->addWidget(cover);
|
left->addWidget(cover);
|
||||||
left->addWidget(detailLabel);
|
left->addWidget(scroll,1);
|
||||||
left->addStretch();
|
left->addStretch();
|
||||||
leftWidget->setMaximumWidth(180);
|
leftWidget->setMaximumWidth(180);
|
||||||
leftWidget->setLayout(left);
|
leftWidget->setLayout(left);
|
||||||
@ -140,14 +173,22 @@ void SelectVolume::loadVolumeInfo(const QModelIndex & mi)
|
|||||||
QString id = data->at(VolumesModel::ID);
|
QString id = data->at(VolumesModel::ID);
|
||||||
|
|
||||||
//cover->setText(coverURL);
|
//cover->setText(coverURL);
|
||||||
detailLabel->setText(deck);
|
//detailLabel->setText(deck);
|
||||||
|
QString loadingStyle = "<font color='#AAAAAA'>%1</font>";
|
||||||
|
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);
|
ComicVineClient * comicVineClient = new ComicVineClient;
|
||||||
connect(search,SIGNAL(dataReady(const QByteArray &)),this,SLOT(setCover(const QByteArray &)));
|
connect(comicVineClient,SIGNAL(seriesCover(const QByteArray &)),this,SLOT(setCover(const QByteArray &)));
|
||||||
connect(search,SIGNAL(timeout()),this,SLOT(queryTimeOut())); //TODO
|
connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater()));
|
||||||
connect(search,SIGNAL(finished()),search,SLOT(deleteLater()));
|
comicVineClient->getSeriesCover(coverURL);
|
||||||
search->get();
|
|
||||||
|
|
||||||
|
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)
|
void SelectVolume::setCover(const QByteArray & data)
|
||||||
@ -165,8 +206,26 @@ void SelectVolume::setCover(const QByteArray & data)
|
|||||||
cover->update();
|
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("<a","<a style = 'color:#827A68; text-decoration:none;'"));
|
||||||
|
detailLabel->adjustSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SelectVolume::openLink(const QString & link)
|
||||||
|
{
|
||||||
|
QDesktopServices::openUrl(QUrl("http://www.comicvine.com"+link));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void loadVolumeInfo(const QModelIndex & mi);
|
void loadVolumeInfo(const QModelIndex & mi);
|
||||||
void setCover(const QByteArray &);
|
void setCover(const QByteArray &);
|
||||||
void setDescription(const QString & description);
|
void setDescription(const QString & jsonDetail);
|
||||||
|
void openLink(const QString & link);
|
||||||
private:
|
private:
|
||||||
QLabel * cover;
|
QLabel * cover;
|
||||||
QLabel * detailLabel;
|
QLabel * detailLabel;
|
||||||
|
@ -293,7 +293,7 @@ void TableModel::setupModelData(QSqlQuery &sqlquery)
|
|||||||
QString nameCurrent = currentItem->data(TableModel::FileName).toString();
|
QString nameCurrent = currentItem->data(TableModel::FileName).toString();
|
||||||
int numberLast,numberCurrent;
|
int numberLast,numberCurrent;
|
||||||
int max = (std::numeric_limits<int>::max)();
|
int max = (std::numeric_limits<int>::max)();
|
||||||
numberLast = numberCurrent = max; //TODO change by std limit
|
numberLast = numberCurrent = max;
|
||||||
|
|
||||||
if(!last->data(TableModel::Number).isNull())
|
if(!last->data(TableModel::Number).isNull())
|
||||||
numberLast = last->data(TableModel::Number).toInt();
|
numberLast = last->data(TableModel::Number).toInt();
|
||||||
|
@ -68,7 +68,7 @@ TreeItem::~TreeItem()
|
|||||||
void TreeItem::appendChild(TreeItem *item)
|
void TreeItem::appendChild(TreeItem *item)
|
||||||
{
|
{
|
||||||
item->parentItem = this;
|
item->parentItem = this;
|
||||||
//TODO insertar odernado
|
|
||||||
if(childItems.isEmpty())
|
if(childItems.isEmpty())
|
||||||
childItems.append(item);
|
childItems.append(item);
|
||||||
else
|
else
|
||||||
|
@ -22,7 +22,7 @@ void HttpVersionChecker::checkNewVersion(const QByteArray & data)
|
|||||||
{
|
{
|
||||||
checkNewVersion(QString(data));
|
checkNewVersion(QString(data));
|
||||||
}
|
}
|
||||||
//TODO escribir prueba unitaria
|
|
||||||
bool HttpVersionChecker::checkNewVersion(QString sourceContent)
|
bool HttpVersionChecker::checkNewVersion(QString sourceContent)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
|
@ -626,8 +626,6 @@ void PDFComic::process()
|
|||||||
{
|
{
|
||||||
delete pdfComic;
|
delete pdfComic;
|
||||||
pdfComic = 0;
|
pdfComic = 0;
|
||||||
//TODO emitir este mensaje en otro sitio
|
|
||||||
//QMessageBox::critical(NULL,QObject::tr("Bad PDF File"),QObject::tr("Invalid PDF file"));
|
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user