mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
New feature: open next/previous comic automatically after reaching end/cover for the current comic
issue #4 https://bitbucket.org/luisangelsm/yacreader/issue/2/auto-advance-to-next-comic
This commit is contained in:
parent
4e3b46a6ba
commit
e6c1b7515e
@ -121,6 +121,10 @@ void MainWindowViewer::setupUI()
|
|||||||
|
|
||||||
viewer = new Viewer(this);
|
viewer = new Viewer(this);
|
||||||
connect(viewer,SIGNAL(reset()),this,SLOT(disableActions()));
|
connect(viewer,SIGNAL(reset()),this,SLOT(disableActions()));
|
||||||
|
//detected end of comic
|
||||||
|
connect(viewer,SIGNAL(openNextComic()),this,SLOT(openNextComic()));
|
||||||
|
//detected start of comic
|
||||||
|
connect(viewer,SIGNAL(openPreviousComic()),this,SLOT(openPreviousComic()));
|
||||||
|
|
||||||
setCentralWidget(viewer);
|
setCentralWidget(viewer);
|
||||||
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
||||||
|
@ -675,8 +675,8 @@ void Render::createComic(const QString & path)
|
|||||||
|
|
||||||
connect(comic,SIGNAL(bookmarksUpdated()),this,SIGNAL(bookmarksUpdated()));
|
connect(comic,SIGNAL(bookmarksUpdated()),this,SIGNAL(bookmarksUpdated()));
|
||||||
|
|
||||||
connect(comic,SIGNAL(isLast()),this,SIGNAL(isLast()));
|
//connect(comic,SIGNAL(isLast()),this,SIGNAL(isLast()));
|
||||||
connect(comic,SIGNAL(isCover()),this,SIGNAL(isCover()));
|
//connect(comic,SIGNAL(isCover()),this,SIGNAL(isCover()));
|
||||||
|
|
||||||
pagesReady.clear();
|
pagesReady.clear();
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,9 @@ wheelStop(false),
|
|||||||
direction(1),
|
direction(1),
|
||||||
restoreMagnifyingGlass(false),
|
restoreMagnifyingGlass(false),
|
||||||
drag(false),
|
drag(false),
|
||||||
numScrollSteps(22)
|
numScrollSteps(22),
|
||||||
|
shouldOpenNext(false),
|
||||||
|
shouldOpenPrevious(false)
|
||||||
{
|
{
|
||||||
translator = new YACReaderTranslator(this);
|
translator = new YACReaderTranslator(this);
|
||||||
translator->hide();
|
translator->hide();
|
||||||
@ -789,6 +791,7 @@ void Viewer::mousePressEvent ( QMouseEvent * event )
|
|||||||
setCursor(Qt::ClosedHandCursor);
|
setCursor(Qt::ClosedHandCursor);
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::mouseReleaseEvent ( QMouseEvent * event )
|
void Viewer::mouseReleaseEvent ( QMouseEvent * event )
|
||||||
{
|
{
|
||||||
drag = false;
|
drag = false;
|
||||||
@ -810,8 +813,6 @@ void Viewer::updateConfig(QSettings * settings)
|
|||||||
QPalette palette;
|
QPalette palette;
|
||||||
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
|
palette.setColor(backgroundRole(), Configuration::getConfiguration().getBackgroundColor());
|
||||||
setPalette(palette);
|
setPalette(palette);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//deprecated
|
//deprecated
|
||||||
@ -832,15 +833,32 @@ void Viewer::setBookmarks()
|
|||||||
|
|
||||||
void Viewer::showIsCoverMessage()
|
void Viewer::showIsCoverMessage()
|
||||||
{
|
{
|
||||||
notificationsLabel->setText(tr("Cover!"));
|
if(!shouldOpenPrevious)
|
||||||
notificationsLabel->flash();
|
{
|
||||||
|
notificationsLabel->setText(tr("Cover!"));
|
||||||
|
notificationsLabel->flash();
|
||||||
|
shouldOpenPrevious = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shouldOpenPrevious = false;
|
||||||
|
emit (openPreviousComic());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::showIsLastMessage()
|
void Viewer::showIsLastMessage()
|
||||||
{
|
{
|
||||||
notificationsLabel->setText(tr("Last page!"));
|
if(!shouldOpenNext)
|
||||||
notificationsLabel->flash();
|
{
|
||||||
|
notificationsLabel->setText(tr("Last page!"));
|
||||||
|
notificationsLabel->flash();
|
||||||
|
shouldOpenNext = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shouldOpenNext = false;
|
||||||
|
emit (openNextComic());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Viewer::getIndex()
|
unsigned int Viewer::getIndex()
|
||||||
@ -885,4 +903,4 @@ void Viewer::updateComic(ComicDB & comic)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,9 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
|
|||||||
|
|
||||||
NotificationsLabelWidget * notificationsLabel;
|
NotificationsLabelWidget * notificationsLabel;
|
||||||
|
|
||||||
|
bool shouldOpenNext;
|
||||||
|
bool shouldOpenPrevious;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//!Magnifying glass
|
//!Magnifying glass
|
||||||
MagnifyingGlass *mglass;
|
MagnifyingGlass *mglass;
|
||||||
@ -153,6 +156,8 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
|
|||||||
void pageAvailable(bool);
|
void pageAvailable(bool);
|
||||||
void pageIsBookmark(bool);
|
void pageIsBookmark(bool);
|
||||||
void reset();
|
void reset();
|
||||||
|
void openNextComic();
|
||||||
|
void openPreviousComic();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user