diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-30 12:35:54 -0500 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-30 12:35:54 -0500 |
commit | 4a9347a338e7f8ee47d46f24b43b435f36b07875 (patch) | |
tree | ead7e582c67d8b30e90b22f75991ce2644e7d714 /src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | |
parent | Get the OSInterface framework up and running (template OS only at the moment) (diff) | |
download | lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.tar.gz lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.tar.bz2 lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.zip |
Merged some previous changes to lumina-pdf, mainly changing how rotating pages works
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp index fc7c1105..c358d0a1 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp @@ -106,8 +106,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ //connect(ui->actionSelect_Mode, &QAction::triggered, this, [&] { this->setScroll(false); }); connect(ui->actionZoom_In, &QAction::triggered, WIDGET, [&] { WIDGET->zoomIn(1.2); }); connect(ui->actionZoom_Out, &QAction::triggered, WIDGET, [&] { WIDGET->zoomOut(1.2); }); - connect(ui->actionRotate_Counterclockwise, &QAction::triggered, this, [&] { this->rotate(true); }); - connect(ui->actionRotate_Clockwise, &QAction::triggered, this, [&] { this->rotate(false); }); + connect(ui->actionRotate_Counterclockwise, &QAction::triggered, this, [&] { WIDGET->setDegrees(-90); }); + connect(ui->actionRotate_Clockwise, &QAction::triggered, this, [&] { WIDGET->setDegrees(90); }); connect(ui->actionZoom_In_2, &QAction::triggered, WIDGET, [&] { WIDGET->zoomIn(1.2); }); connect(ui->actionZoom_Out_2, &QAction::triggered, WIDGET, [&] { WIDGET->zoomOut(1.2); }); connect(ui->actionFirst_Page, SIGNAL(triggered()), this, SLOT(firstPage()) ); @@ -237,12 +237,12 @@ void MainUI::loadFile(QString path){ Poppler::Page *PAGE = DOC->page(0); if(PAGE!=0){ lastdir = path.section("/",0,-2); //save this for later - switch(PAGE->orientation()){ + /*switch(PAGE->orientation()){ case Poppler::Page::Landscape: WIDGET->setOrientation(QPageLayout::Landscape); break; default: WIDGET->setOrientation(QPageLayout::Portrait); - } + }*/ delete PAGE; qDebug() << " - Document Setup : start loading pages now"; startLoadingPages(); @@ -422,11 +422,8 @@ void MainUI::slotPageLoaded(int page){ //qDebug() << " - finished:" << finished; if(finished == numPages){ progAct->setVisible(false); - //qDebug() << "Setting Pictures"; WIDGET->setPictures(&loadingHash); - WIDGET->setVisible(true); - QTimer::singleShot(10, WIDGET, SLOT(updatePreview())); - //qDebug() << "Updating"; + emit sendDocument(DOC); ui->actionStop_Presentation->setEnabled(false); ui->actionStart_Here->setEnabled(true); ui->actionStart_Begin->setEnabled(true); @@ -526,29 +523,13 @@ void MainUI::updatePageNumber(){ label_page->setText( text.arg( QString::number(WIDGET->currentPage()), QString::number(numPages) )); } -void MainUI::setScroll(bool tog) { +/*void MainUI::setScroll(bool tog) { if(tog) { QApplication::setOverrideCursor(Qt::OpenHandCursor); }else{ QApplication::setOverrideCursor(Qt::IBeamCursor); } -} - -void MainUI::rotate(bool ccw) { - for(int i = 0; i < numPages; i++) { - QImage image = loadingHash[i]; - qDebug() << "Page rotating: " << i; - //Setup a rotation matrix that rotates 90 degrees clockwise or counterclockwise - QMatrix matrix = (ccw) ? QMatrix(0, -1, 1, 0, 0, 0) : QMatrix(0, 1, -1, 0, 0, 0); - image = image.transformed(matrix, Qt::SmoothTransformation); - //Updates the image in the hash - loadingHash.insert(i, image); - } - //Rotates the page as well as the image - //WIDGET->setOrientation((WIDGET->orientation() == QPageLayout::Landscape) ? - //QPageLayout::Portrait : QPageLayout::Landscape); - QTimer::singleShot(0, WIDGET, SLOT(updatePreview())); -} +}*/ void MainUI::updateContextMenu(){ contextMenu->clear(); |