Issue #133: Rectangle selector when choosing the page of the PDF

This commit is contained in:
Jakub Melka
2023-12-29 18:40:32 +01:00
parent 1fded3d6b7
commit 0ddeda8036
2 changed files with 26 additions and 0 deletions

View File

@ -1900,6 +1900,17 @@ void PDFProgramController::onDocumentReadingFinished()
QMessageBox::warning(m_mainWindow, QApplication::applicationDisplayName(), requirementResult.message);
}
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
settings.beginGroup("LastOpenedDocumentPages");
QVariant lastOpenedPage = settings.value(m_fileInfo.absoluteFilePath, QVariant());
settings.endGroup();
if (lastOpenedPage.isValid())
{
m_pdfWidget->getDrawWidgetProxy()->goToPage(lastOpenedPage.toInt());
}
m_mainWindowInterface->setStatusBarMessage(tr("Document '%1' was successfully loaded!").arg(m_fileInfo.fileName), 4000);
break;
}
@ -2036,6 +2047,20 @@ void PDFProgramController::setDocument(pdf::PDFModifiedDocument document, bool i
void PDFProgramController::closeDocument()
{
if (m_pdfDocument && !m_fileInfo.absoluteFilePath.isEmpty())
{
std::vector<pdf::PDFInteger> pages = m_pdfWidget->getDrawWidget()->getCurrentPages();
if (!pages.empty())
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
settings.beginGroup("LastOpenedDocumentPages");
settings.setValue(m_fileInfo.absoluteFilePath, pages.front());
settings.endGroup();
}
}
m_signatures.clear();
setDocument(pdf::PDFModifiedDocument(), true);
m_pdfDocument.reset();

View File

@ -1,6 +1,7 @@
CURRENT:
- Issue #137: Redaction - Cannot convert '#000000' to color value
- Issue #134: Add search bar for actions
- Issue #133: Rectangle selector when choosing the page of the PDF
- Issue #129: Cannot compile with lcms 2.16
- Issue #128: Create list of markup annotations
- Issue #126: Remove <QtCore> include from main headers