mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
GoTo dialogs: Restrict input values to existing pages
This commit is contained in:
parent
54b9952253
commit
df32cf01fb
@ -60,12 +60,10 @@ void GoToDialog::setupUI()
|
|||||||
void GoToDialog::goTo()
|
void GoToDialog::goTo()
|
||||||
{
|
{
|
||||||
unsigned int page = pageNumber->text().toInt();
|
unsigned int page = pageNumber->text().toInt();
|
||||||
pageNumber->clear();
|
if (page >= 1 && page <= v->top()) {
|
||||||
|
|
||||||
if (page >= 1)
|
|
||||||
emit(goToPage(page - 1));
|
emit(goToPage(page - 1));
|
||||||
|
close();
|
||||||
close();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToDialog::setNumPages(unsigned int numPages)
|
void GoToDialog::setNumPages(unsigned int numPages)
|
||||||
|
@ -109,8 +109,10 @@ void GoToFlowToolBar::setTop(int numPages)
|
|||||||
|
|
||||||
void GoToFlowToolBar::goTo()
|
void GoToFlowToolBar::goTo()
|
||||||
{
|
{
|
||||||
if (edit->text().toInt() != 0)
|
unsigned int page = edit->text().toInt();
|
||||||
emit(goTo(edit->text().toInt() - 1));
|
if (page >= 1 && page <= v->top()) {
|
||||||
|
emit(goTo(page - 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToFlowToolBar::centerSlide()
|
void GoToFlowToolBar::centerSlide()
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
mainLayout = new QVBoxLayout;
|
mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->setMargin(0);
|
mainLayout->setMargin(0);
|
||||||
mainLayout->setSpacing(0);
|
mainLayout->setSpacing(0);
|
||||||
|
|
||||||
@ -22,11 +22,7 @@ GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
|||||||
//toolBar->installEventFilter(this);
|
//toolBar->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
GoToFlowWidget::~GoToFlowWidget()
|
GoToFlowWidget::~GoToFlowWidget() { }
|
||||||
{
|
|
||||||
delete toolBar;
|
|
||||||
delete mainLayout;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GoToFlowWidget::setPageNumber(int page)
|
void GoToFlowWidget::setPageNumber(int page)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user