mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
added errors check to Comic
This commit is contained in:
parent
91f89b161d
commit
ed729385f8
@ -122,7 +122,7 @@ void MainWindowViewer::setupUI()
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
|
||||
viewer = new Viewer(this);
|
||||
connect(viewer,SIGNAL(reset()),this,SLOT(disableActions()));
|
||||
connect(viewer,SIGNAL(reset()),this,SLOT(processReset()));
|
||||
//detected end of comic
|
||||
connect(viewer,SIGNAL(openNextComic()),this,SLOT(openNextComic()));
|
||||
//detected start of comic
|
||||
@ -888,8 +888,28 @@ void MainWindowViewer::checkNewVersion()
|
||||
tT->start(100);
|
||||
|
||||
conf.setLastVersionCheck(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindowViewer::processReset()
|
||||
{
|
||||
if(isClient)
|
||||
{
|
||||
if(siblingComics.count()>1)
|
||||
{
|
||||
bool openNextB = openNextComicAction->isEnabled();
|
||||
bool openPrevB = openPreviousComicAction->isEnabled();
|
||||
disableActions();
|
||||
openNextComicAction->setEnabled(openNextB);
|
||||
openPreviousComicAction->setEnabled(openPrevB);
|
||||
}
|
||||
else
|
||||
disableActions();
|
||||
}
|
||||
else
|
||||
disableActions();
|
||||
}
|
||||
|
||||
void MainWindowViewer::changeFit()
|
||||
{
|
||||
Configuration & conf = Configuration::getConfiguration();
|
||||
|
@ -50,6 +50,7 @@ class YACReaderSliderAction;
|
||||
void fitToWidth();
|
||||
void fitToHeight();
|
||||
void checkNewVersion();
|
||||
void processReset();
|
||||
/*void viewComic();
|
||||
void prev();
|
||||
void next();
|
||||
|
@ -213,12 +213,14 @@ void Viewer::open(QString pathFile, const ComicDB & comic)
|
||||
|
||||
void Viewer::showMessageErrorOpening()
|
||||
{
|
||||
QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found"));
|
||||
QMessageBox::critical(this,tr("Not found"),tr("Comic not found"));
|
||||
resetContent();
|
||||
}
|
||||
|
||||
void Viewer::showMessageErrorOpening(QString message)
|
||||
{
|
||||
QMessageBox::critical(NULL,tr("Error opening"),message);
|
||||
QMessageBox::critical(this,tr("Error opening comic"),message);
|
||||
resetContent();
|
||||
}
|
||||
|
||||
void Viewer::next()
|
||||
|
@ -414,7 +414,16 @@ void FileComic::process()
|
||||
{
|
||||
CompressedArchive archive(_path);
|
||||
if(!archive.toolsLoaded())
|
||||
{
|
||||
emit errorOpening(tr("7z not found"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(!archive.isValid())
|
||||
{
|
||||
emit errorOpening(tr("Format not supported"));
|
||||
return;
|
||||
}
|
||||
//se filtran para obtener sólo los formatos soportados
|
||||
_order = archive.getFileNames();
|
||||
_fileNames = filter(_order);
|
||||
@ -665,11 +674,11 @@ void PDFComic::renderPage(int page)
|
||||
Poppler::Page* pdfpage = pdfComic->page(page);
|
||||
if (pdfpage)
|
||||
{
|
||||
QImage img = pdfpage->renderToImage(150,150);
|
||||
delete pdfpage;
|
||||
QImage img = pdfpage->renderToImage(150,150);
|
||||
delete pdfpage;
|
||||
QByteArray ba;
|
||||
QBuffer buf(&ba);
|
||||
img.save(&buf, "jpg");
|
||||
img.save(&buf, "jpg");
|
||||
_pages[page] = ba;
|
||||
emit imageLoaded(page);
|
||||
emit imageLoaded(page,_pages[page]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user