mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-28 19:28:38 +00:00
Add 'Sign' menu entry
This commit is contained in:
parent
35590a273d
commit
2845db76fb
2 changed files with 11 additions and 0 deletions
|
@ -232,6 +232,7 @@ public:
|
|||
QAction *aMouseTableSelect;
|
||||
QAction *aMouseMagnifier;
|
||||
KToggleAction *aTrimToSelection;
|
||||
KToggleAction * aToggleSignature;
|
||||
KSelectAction *aZoom;
|
||||
QAction *aZoomIn;
|
||||
QAction *aZoomOut;
|
||||
|
@ -363,6 +364,7 @@ PageView::PageView(QWidget *parent, Okular::Document *document)
|
|||
d->aMouseNormal = nullptr;
|
||||
d->aMouseSelect = nullptr;
|
||||
d->aMouseTextSelect = nullptr;
|
||||
d->aToggleSignature = nullptr;
|
||||
d->aZoomFitWidth = nullptr;
|
||||
d->aZoomFitPage = nullptr;
|
||||
d->aZoomAutoFit = nullptr;
|
||||
|
@ -715,6 +717,10 @@ void PageView::setupActions(KActionCollection *ac)
|
|||
d->aMouseModeMenu->setText(i18nc("@action", "Selection Tools"));
|
||||
ac->addAction(QStringLiteral("mouse_selecttools"), d->aMouseModeMenu);
|
||||
|
||||
d->aToggleSignature = new KToggleAction(QIcon::fromTheme( QStringLiteral("application-pkcs7-signature") ), i18n("&Sign"), this);
|
||||
ac->addAction(QStringLiteral("mouse_toggle_sign"), d->aToggleSignature );
|
||||
d->aToggleSignature->setCheckable( true );
|
||||
|
||||
// speak actions
|
||||
#ifdef HAVE_SPEECH
|
||||
d->aSpeakDoc = new QAction(QIcon::fromTheme(QStringLiteral("text-speak")), i18n("Speak Whole Document"), this);
|
||||
|
@ -1210,6 +1216,10 @@ void PageView::updateActionState(bool haspages, bool hasformwidgets)
|
|||
d->annotator->setToolsEnabled(allowTools);
|
||||
d->annotator->setTextToolsEnabled(allowTools && d->document->supportsSearching());
|
||||
}
|
||||
|
||||
if ( d->aToggleSignature )
|
||||
d->aToggleSignature->setEnabled( haspages );
|
||||
|
||||
#ifdef HAVE_SPEECH
|
||||
if (d->aSpeakDoc) {
|
||||
const bool enablettsactions = haspages ? Okular::Settings::useTTS() : false;
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
<Action name="mouse_magnifier"/>
|
||||
<Separator/>
|
||||
<Action name="mouse_toggle_annotate"/>
|
||||
<Action name="mouse_toggle_sign"/>
|
||||
<Separator/>
|
||||
<Action name="speak_document"/>
|
||||
<Action name="speak_current_page"/>
|
||||
|
|
Loading…
Reference in a new issue