CRC message error added.

This commit is contained in:
Luis Ángel San Martín
2013-08-17 19:19:16 +02:00
parent 08581319da
commit 2dd51a0df7
5 changed files with 30 additions and 2 deletions

View File

@ -157,6 +157,7 @@ void Viewer::createConnections()
//render
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(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()));
@ -203,6 +204,11 @@ void Viewer::showMessageErrorOpening()
QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found"));
}
void Viewer::showMessageErrorOpening(QString message)
{
QMessageBox::critical(NULL,tr("Error opening"),message);
}
void Viewer::next()
{
direction = 1;
@ -238,6 +244,11 @@ void Viewer::updatePage()
//TODO -> update bookmark action
setFocus(Qt::ShortcutFocusReason);
delete previousPage;
//TODO: fix loading...please wait!
if(currentPage->isNull())
setPageUnavailableMessage();
if(restoreMagnifyingGlass)
{
restoreMagnifyingGlass = false;
@ -669,6 +680,17 @@ void Viewer::setLoadingMessage()
configureContent(tr("Loading...please wait!"));
}
void Viewer::setPageUnavailableMessage()
{
if(magnifyingGlassShowed)
{
hideMagnifyingGlass();
restoreMagnifyingGlass = true;
}
emit(pageAvailable(false));
configureContent(tr("Page not available!"));
}
void Viewer::configureContent(QString msg)
{
content->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);