aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp
diff options
context:
space:
mode:
authorjoe berner <stackyjoe@gmail.com>2018-12-18 10:59:15 -0600
committerjoe berner <stackyjoe@gmail.com>2018-12-18 10:59:15 -0600
commite42bc7e16e6d9f813b5c712261dffbef6b1bddb2 (patch)
tree0c9e39d7e3f425691f854288a733b8d56c5f6ed3 /src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp
parentMerge pull request #640 from lumina-desktop/q5sys-patch-1 (diff)
downloadlumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.tar.gz
lumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.tar.bz2
lumina-e42bc7e16e6d9f813b5c712261dffbef6b1bddb2.zip
Changes the UI interface so that only the current page is rendered on screen at a time. This has significant memory benefits for large PDF files. This also implements a least-recently used cache of tunable size, which improves responsiveness if you're hopping between two specific pages.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp b/src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp
index a7a67f03..7f82a8c8 100644
--- a/src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/PropDialog.cpp
@@ -9,14 +9,15 @@
#include "ui_PropDialog.h"
#include <LuminaXDG.h>
-PropDialog::PropDialog(Renderer *Backend) : QDialog(), ui(new Ui::PropDialog()), BACKEND(Backend){
+PropDialog::PropDialog(Renderer *Backend)
+ : QDialog(), ui(new Ui::PropDialog()), BACKEND(Backend) {
ui->setupUi(this);
this->setWindowTitle(tr("PDF Information"));
- this->setWindowIcon( LXDG::findIcon("dialog-information","unknown"));
+ this->setWindowIcon(LXDG::findIcon("dialog-information", "unknown"));
- connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
+ QObject::connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
- //Setup translations
+ // Setup translations
ui->titleL->setText(tr("Title:"));
ui->subjectL->setText(tr("Subject:"));
ui->authorL->setText(tr("Author:"));
@@ -29,21 +30,23 @@ PropDialog::PropDialog(Renderer *Backend) : QDialog(), ui(new Ui::PropDialog()),
ui->closeButton->setText(tr("Close"));
}
-//Load size from mainUI after pages have loaded
+// Load size from mainUI after pages have loaded
void PropDialog::setSize(QSizeF pageSize) {
- ui->sizeL->setText(tr("Page Size: ") + QString::number(pageSize.width())+", "+QString::number(pageSize.height()));
+ ui->sizeL->setText(tr("Page Size: ") + QString::number(pageSize.width()) +
+ ", " + QString::number(pageSize.height()));
}
-//Fill the text boxes with information from the document
+// Fill the text boxes with information from the document
void PropDialog::setInformation() {
QJsonObject info = BACKEND->properties();
- ui->titleE->setText( info.value("title").toString() );
- ui->subjectE->setText( info.value("subject").toString() );
- ui->authorE->setText( info.value("author").toString() );
- ui->creatorE->setText( info.value("creator").toString() );
- ui->producerE->setText( info.value("producer").toString() );
- ui->keywordE->setText( info.value("keywords").toString() );
- ui->createdEntry->setText( info.value("dt_created").toString() );
- ui->modifiedEntry->setText( info.value("dt_modified").toString() );
- ui->numberL->setText( tr("Number of Pages: ") + QString::number(BACKEND->numPages()) );
+ ui->titleE->setText(info.value("title").toString());
+ ui->subjectE->setText(info.value("subject").toString());
+ ui->authorE->setText(info.value("author").toString());
+ ui->creatorE->setText(info.value("creator").toString());
+ ui->producerE->setText(info.value("producer").toString());
+ ui->keywordE->setText(info.value("keywords").toString());
+ ui->createdEntry->setText(info.value("dt_created").toString());
+ ui->modifiedEntry->setText(info.value("dt_modified").toString());
+ ui->numberL->setText(tr("Number of Pages: ") +
+ QString::number(BACKEND->numPages()));
}
bgstack15