Stub some iface for signing the document

remotes/origin/work/aacid/dont_show_non_valid_certs
Katarina Behrens 7 years ago committed by Albert Astals Cid
parent c560a4a20e
commit d320fa17ad
  1. 6
      core/document.cpp
  2. 2
      core/document.h
  3. 4
      core/generator.h
  4. 3
      generators/poppler/generator_pdf.h
  5. 3
      part/pageviewannotator.cpp

@ -2701,6 +2701,12 @@ bool Document::canConfigurePrinter() const
return false; return false;
} }
void Document::sign()
{
if (d->m_generator->canSign())
d->m_generator->sign();
}
DocumentInfo Document::documentInfo() const DocumentInfo Document::documentInfo() const
{ {
QSet<DocumentInfo::Key> keys; QSet<DocumentInfo::Key> keys;

@ -1052,6 +1052,8 @@ public Q_SLOTS:
*/ */
void reloadDocument() const; void reloadDocument() const;
void sign();
/** /**
* Returns the part of document covered by the given signature @p info. * Returns the part of document covered by the given signature @p info.
* *

@ -307,6 +307,10 @@ public:
*/ */
virtual bool canGeneratePixmap() const; virtual bool canGeneratePixmap() const;
virtual bool canSign() const { return false; }
virtual void sign() { return; }
/** /**
* This method can be called to trigger the generation of * This method can be called to trigger the generation of
* a new pixmap as described by @p request. * a new pixmap as described by @p request.

@ -100,6 +100,9 @@ public:
bool save(const QString &fileName, SaveOptions options, QString *errorText) override; bool save(const QString &fileName, SaveOptions options, QString *errorText) override;
Okular::AnnotationProxy *annotationProxy() const override; Okular::AnnotationProxy *annotationProxy() const override;
bool canSign() const override {return true;}
void sign() override { return; }
protected: protected:
SwapBackingFileResult swapBackingFile(QString const &newFileName, QVector<Okular::Page *> &newPagesVector) override; SwapBackingFileResult swapBackingFile(QString const &newFileName, QVector<Okular::Page *> &newPagesVector) override;
bool doCloseDocument() override; bool doCloseDocument() override;

@ -921,6 +921,9 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
annotation->setAuthor(Okular::Settings::identityAuthor()); annotation->setAuthor(Okular::Settings::identityAuthor());
m_document->addPageAnnotation(m_lockedItem->pageNumber(), annotation); m_document->addPageAnnotation(m_lockedItem->pageNumber(), annotation);
if (signatureMode())
m_document->sign();
if (annotation->openDialogAfterCreation()) if (annotation->openDialogAfterCreation())
m_pageView->openAnnotationWindow(annotation, m_lockedItem->pageNumber()); m_pageView->openAnnotationWindow(annotation, m_lockedItem->pageNumber());
} }

Loading…
Cancel
Save