aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp2
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/Renderer.h2
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/mainUI.cpp20
4 files changed, 20 insertions, 8 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp b/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp
index c75a32bb..23d9b3d1 100644
--- a/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp
@@ -236,3 +236,5 @@ void Renderer::clearHash() {
qDeleteAll(dataHash);
dataHash.clear();
}
+
+bool Renderer::supportsExtraFeatures() { return true; }
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
index 62548f78..439fd804 100644
--- a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
@@ -107,7 +107,7 @@ QList<TextData*> Renderer::searchDocument(QString text, bool matchCase){
for(int j = 0; j < textList.size(); j++) {
if(textList[j]->text().contains(text,
(matchCase) ? Qt::CaseSensitive : Qt::CaseInsensitive)) {
- TextData *t = new TextData(textList[j]->boundingBox(), i+1, text, degrees);
+ TextData *t = new TextData(textList[j]->boundingBox(), i+1, text);
results.append(t);
}
}
@@ -126,3 +126,5 @@ int Renderer::hashSize() {
void Renderer::clearHash() {
loadingHash.clear();
}
+
+bool Renderer::supportsExtraFeatures() { return false; }
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer.h b/src-qt5/desktop-utils/lumina-pdf/Renderer.h
index 870267a8..ab86724d 100644
--- a/src-qt5/desktop-utils/lumina-pdf/Renderer.h
+++ b/src-qt5/desktop-utils/lumina-pdf/Renderer.h
@@ -50,6 +50,8 @@ public:
emit reloadPages(this->degrees);
}
+ bool supportsExtraFeatures();
+
signals:
void PageLoaded(int);
void OrigSize(QSizeF);
diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp
index 1d1df0ce..3c2d1541 100644
--- a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp
@@ -21,8 +21,6 @@
#include <LuminaXDG.h>
#include "PrintWidget.h"
-#define TESTING 0
-
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){
ui->setupUi(this);
//this->setWindowTitle(tr("Lumina PDF Viewer"));
@@ -210,6 +208,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){
ui->bookmarksFrame->setVisible(false);
//TESTING features/functionality
+ bool TESTING = BACKEND->supportsExtraFeatures();
ui->actionSettings->setEnabled(TESTING);
ui->actionSettings->setVisible(TESTING);
ui->actionBookmarks->setEnabled(TESTING);
@@ -218,14 +217,20 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){
ui->actionScroll_Mode->setVisible(TESTING);
ui->actionSelect_Mode->setEnabled(TESTING);
ui->actionSelect_Mode->setVisible(TESTING);
- //ui->actionProperties->setEnabled(TESTING);
- //ui->actionProperties->setVisible(TESTING);
- //ui->menuSettings->setEnabled(TESTING);
- //ui->menuSettings->setVisible(TESTING);
+ ui->actionProperties->setEnabled(TESTING);
+ ui->actionProperties->setVisible(TESTING);
+ ui->menuSettings->setEnabled(TESTING);
+ ui->menuSettings->setVisible(TESTING);
if(!TESTING){
- //ui->menubar->removeAction(ui->menuSettings->menuAction() );
+ ui->menubar->removeAction(ui->menuSettings->menuAction() );
}
+ ui->actionSettings->setEnabled(false);
+ ui->actionSettings->setVisible(false);
+ ui->actionScroll_Mode->setEnabled(false);
+ ui->actionScroll_Mode->setVisible(false);
+ ui->actionSelect_Mode->setEnabled(false);
+ ui->actionSelect_Mode->setVisible(false);
}
MainUI::~MainUI(){
@@ -236,6 +241,7 @@ void MainUI::loadFile(QString path){
if(!QFile::exists(path) || path.isEmpty() ){ return; }
QString password;
bool ok = true;
+
while( ok && !BACKEND->loadDocument(path, password) && BACKEND->needPassword() ){
password = QInputDialog::getText(this, tr("Unlock PDF"), tr("Password:"), QLineEdit::Password, "", &ok);
if(!ok){ break; } //cancelled
bgstack15