Changed CRC errors management.

This commit is contained in:
Luis Ángel San Martín 2013-12-18 23:16:53 +01:00
parent 7e69e94b82
commit d075b111ee
6 changed files with 13 additions and 3 deletions

View File

@ -663,6 +663,7 @@ void Render::createComic(const QString & path)
connect(comic,SIGNAL(errorOpening()),this,SIGNAL(errorOpening()));
connect(comic,SIGNAL(errorOpening(QString)),this,SIGNAL(errorOpening(QString)));
connect(comic,SIGNAL(crcErrorFound(QString)),this,SIGNAL(crcError(QString)));
connect(comic,SIGNAL(errorOpening()),this,SLOT(reset()));
connect(comic,SIGNAL(imageLoaded(int)),this,SIGNAL(imageLoaded(int)));
connect(comic,SIGNAL(imageLoaded(int)),this,SLOT(pageRawDataReady(int)));

View File

@ -171,6 +171,7 @@ signals:
void numPages(unsigned int numPages);
void errorOpening();
void errorOpening(QString);
void crcError(QString);
void currentPageIsBookmark(bool);
void isLast();
void isCover();

View File

@ -159,6 +159,7 @@ void Viewer::createConnections()
connect(render,SIGNAL(errorOpening()),this,SLOT(resetContent()));
connect(render,SIGNAL(errorOpening()),this,SLOT(showMessageErrorOpening()));
connect(render,SIGNAL(errorOpening(QString)),this,SLOT(showMessageErrorOpening(QString)));
connect(render,SIGNAL(crcError(QString)),this,SLOT(processCRCError(QString)));
connect(render,SIGNAL(numPages(unsigned int)),goToFlow,SLOT(setNumSlides(unsigned int)));
connect(render,SIGNAL(numPages(unsigned int)),goToDialog,SLOT(setNumPages(unsigned int)));
//connect(render,SIGNAL(numPages(unsigned int)),this,SLOT(updateInformation()));
@ -214,13 +215,18 @@ void Viewer::open(QString pathFile, const ComicDB & comic)
void Viewer::showMessageErrorOpening()
{
QMessageBox::critical(this,tr("Not found"),tr("Comic not found"));
resetContent();
//resetContent(); --> not needed
}
void Viewer::showMessageErrorOpening(QString message)
{
QMessageBox::critical(this,tr("Error opening comic"),message);
resetContent();
resetContent();
}
void Viewer::processCRCError(QString message)
{
QMessageBox::critical(this,tr("CRC Error"),message);
}
void Viewer::next()

View File

@ -81,6 +81,7 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
void updateConfig(QSettings * settings);
void showMessageErrorOpening();
void showMessageErrorOpening(QString);
void processCRCError(QString message);
void setBookmarks();
//deprecated
void updateImageOptions();

View File

@ -299,7 +299,7 @@ void FileComic::fileExtracted(int index, const QByteArray & rawData)
void FileComic::crcError(int index)
{
emit errorOpening(tr("CRC error on page (%1): some of the pages will not be displayed correctly").arg(index));
emit crcErrorFound(tr("CRC error on page (%1): some of the pages will not be displayed correctly").arg(index+1));
}
//TODO: comprobar que si se produce uno de estos errores, la carga del cómic es irrecuperable

View File

@ -90,6 +90,7 @@ class ComicDB;
void numPages(unsigned int numPages);
void errorOpening();
void errorOpening(QString);
void crcErrorFound(QString);
void isBookmark(bool);
void bookmarksUpdated();
void isCover();