From f0c02a37d6cfcd6cdc8426ce78f69bd0f359289f Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Fri, 11 Mar 2022 22:41:44 -0500 Subject: [PATCH] Prevent massive page turning hang --- reader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reader.cpp b/reader.cpp index 8db4e47..25ab6ec 100644 --- a/reader.cpp +++ b/reader.cpp @@ -988,6 +988,7 @@ void reader::save_word(string word, bool remove) { void reader::on_nextBtn_clicked() { + ui->nextBtn->setEnabled(false); if(is_epub == false and is_pdf == false) { if(split_total - 1 == 1 or split_total - 1 == 0) { showToast("You've reached the end of the document"); @@ -1034,10 +1035,12 @@ void reader::on_nextBtn_clicked() } setupPageWidget(); refreshScreen(); + ui->nextBtn->setEnabled(true); } void reader::on_previousBtn_clicked() { + ui->previousBtn->setEnabled(false); if(is_epub == false and is_pdf == false) { // Making sure we won't encounter a "List index out of range" error ;) if(split_total >= split_files_number - 1) { @@ -1087,6 +1090,7 @@ void reader::on_previousBtn_clicked() } setupPageWidget(); refreshScreen(); + ui->previousBtn->setEnabled(true); } void reader::refreshScreen() {