Changeset View
Changeset View
Standalone View
Standalone View
ui/formwidgets.cpp
Show All 17 Lines | |||||
18 | #include <QKeyEvent> | 18 | #include <QKeyEvent> | ||
19 | #include <QMenu> | 19 | #include <QMenu> | ||
20 | #include <QEvent> | 20 | #include <QEvent> | ||
21 | #include <klineedit.h> | 21 | #include <klineedit.h> | ||
22 | #include <KLocalizedString> | 22 | #include <KLocalizedString> | ||
23 | #include <kstandardaction.h> | 23 | #include <kstandardaction.h> | ||
24 | #include <qaction.h> | 24 | #include <qaction.h> | ||
25 | #include <QUrl> | 25 | #include <QUrl> | ||
26 | #include <QPushButton> | ||||
26 | 27 | | |||
27 | // local includes | 28 | // local includes | ||
28 | #include "core/form.h" | 29 | #include "core/form.h" | ||
29 | #include "core/document.h" | 30 | #include "core/document.h" | ||
30 | #include "debug_ui.h" | 31 | #include "debug_ui.h" | ||
31 | 32 | | |||
32 | FormWidgetsController::FormWidgetsController( Okular::Document *doc ) | 33 | FormWidgetsController::FormWidgetsController( Okular::Document *doc ) | ||
33 | : QObject( doc ), m_doc( doc ) | 34 | : QObject( doc ), m_doc( doc ) | ||
▲ Show 20 Lines • Show All 237 Lines • ▼ Show 20 Line(s) | 271 | case Okular::FormFieldChoice::ListBox: | |||
271 | widget = new ListEdit( ffc, parent ); | 272 | widget = new ListEdit( ffc, parent ); | ||
272 | break; | 273 | break; | ||
273 | case Okular::FormFieldChoice::ComboBox: | 274 | case Okular::FormFieldChoice::ComboBox: | ||
274 | widget = new ComboEdit( ffc, parent ); | 275 | widget = new ComboEdit( ffc, parent ); | ||
275 | break; | 276 | break; | ||
276 | } | 277 | } | ||
277 | break; | 278 | break; | ||
278 | } | 279 | } | ||
280 | case Okular::FormField::FormSignature: | ||||
281 | { | ||||
282 | auto fs = static_cast<Okular::FormFieldSignature*>(ff); | ||||
283 | widget = new SignatureEdit(fs, parent); | ||||
284 | } | ||||
279 | default: ; | 285 | default: ; | ||
280 | } | 286 | } | ||
281 | 287 | | |||
282 | if ( ff->isReadOnly() ) | 288 | if ( ff->isReadOnly() ) | ||
283 | widget->setVisibility( false ); | 289 | widget->setVisibility( false ); | ||
284 | 290 | | |||
285 | return widget; | 291 | return widget; | ||
286 | } | 292 | } | ||
▲ Show 20 Lines • Show All 760 Lines • ▼ Show 20 Line(s) | 1045 | { | |||
1047 | { | 1053 | { | ||
1048 | emit m_controller->requestRedo(); | 1054 | emit m_controller->requestRedo(); | ||
1049 | return true; | 1055 | return true; | ||
1050 | } | 1056 | } | ||
1051 | } | 1057 | } | ||
1052 | return QComboBox::event( e ); | 1058 | return QComboBox::event( e ); | ||
1053 | } | 1059 | } | ||
1054 | 1060 | | |||
1061 | #include "core/signatureutils.h" | ||||
1062 | #include "certificateviewer.h" | ||||
1063 | #include "revisionviewer.h" | ||||
1064 | | ||||
1065 | SignatureEdit::SignatureEdit(Okular::FormFieldSignature *fs, QWidget *p) | ||||
1066 | : QPushButton("Hello", p), FormWidgetIface(this, fs) | ||||
1067 | { | ||||
1068 | auto sigInfo = fs->validate(); | ||||
1069 | //auto certInfo = sigInfo->certificateInfo(); | ||||
1070 | connect(this, &SignatureEdit::clicked, this, [=]{ | ||||
1071 | QByteArray data; | ||||
1072 | m_controller->m_doc->requestSignedRevisionData( sigInfo, &data ); | ||||
1073 | RevisionViewer v(data, this); | ||||
1074 | v.viewRevision(); | ||||
1075 | }); | ||||
1076 | } | ||||
1077 | | ||||
1055 | // Code for additional action handling. | 1078 | // Code for additional action handling. | ||
1056 | // Challenge: Change preprocessor magic to C++ magic! | 1079 | // Challenge: Change preprocessor magic to C++ magic! | ||
1057 | // | 1080 | // | ||
1058 | // The mouseRelease event is special because the PDF spec | 1081 | // The mouseRelease event is special because the PDF spec | ||
1059 | // says that the activation action takes precedence over this. | 1082 | // says that the activation action takes precedence over this. | ||
1060 | // So the mouse release action is only signaled if no activation | 1083 | // So the mouse release action is only signaled if no activation | ||
1061 | // action exists. | 1084 | // action exists. | ||
1062 | // | 1085 | // | ||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |