Make sure you have no unsaved changes before saving

remotes/origin/work/aacid/dont_show_non_valid_certs
Albert Astals Cid 5 years ago committed by Albert Astals Cid
parent a5df71a79a
commit 6325a4fe0b
  1. 5
      core/document.cpp
  2. 2
      core/document.h
  3. 5
      part/pageview.cpp

@ -4558,6 +4558,11 @@ void Document::setHistoryClean(bool clean)
d->m_undoStack->resetClean();
}
bool Document::isHistoryClean() const
{
return d->m_undoStack->isClean();
}
bool Document::canSaveChanges() const
{
if (!d->m_generator)

@ -831,6 +831,8 @@ public:
*/
void setHistoryClean(bool clean);
bool isHistoryClean() const;
/**
* Saving capabilities. Their availability varies according to the
* underlying generator and/or the document type.

@ -4778,6 +4778,11 @@ void PageView::slotSetMouseTableSelect()
void PageView::slotSignature()
{
if (!d->document->isHistoryClean()) {
KMessageBox::information(this, i18n("You have unsaved changes. Please save the document before signing it."));
return;
}
d->messageWindow->display(i18n("Draw a rectangle to insert the signature field"), QString(), PageViewMessage::Info, -1);
if (!d->annotator) {

Loading…
Cancel
Save