From 69ddb957f10bd26785170c703984079300020eff Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Tue, 18 Jun 2019 10:53:18 +0200 Subject: [PATCH] Add config page to configure signing identities/certificates --- CMakeLists.txt | 2 ++ part/dlgsignatures.cpp | 25 +++++++++++++ part/dlgsignatures.h | 29 +++++++++++++++ part/dlgsignaturesbase.ui | 72 ++++++++++++++++++++++++++++++++++++++ part/preferencesdialog.cpp | 4 +++ part/preferencesdialog.h | 2 ++ 6 files changed, 134 insertions(+) create mode 100644 part/dlgsignatures.cpp create mode 100644 part/dlgsignatures.h create mode 100644 part/dlgsignaturesbase.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bcb8be9a..f09b5e699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -360,6 +360,7 @@ if(BUILD_DESKTOP) part/dlgannotations.cpp part/dlgperformance.cpp part/dlgpresentation.cpp + part/dlgsignatures.cpp part/editannottooldialog.cpp part/editdrawingtooldialog.cpp part/widgetannottools.cpp @@ -431,6 +432,7 @@ ki18n_wrap_ui(okularpart_SRCS part/dlgannotationsbase.ui part/dlgperformancebase.ui part/dlgpresentationbase.ui + part/dlgsignaturesbase.ui ) kconfig_add_kcfg_files(okularpart_SRCS GENERATE_MOC conf/settings.kcfgc) diff --git a/part/dlgsignatures.cpp b/part/dlgsignatures.cpp new file mode 100644 index 000000000..f64d10b6f --- /dev/null +++ b/part/dlgsignatures.cpp @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (C) 2019 by Bubli * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "dlgsignatures.h" + +#include "ui_dlgsignaturesbase.h" + +DlgSignatures::DlgSignatures(QWidget *parent) + : QWidget(parent) +{ + m_dlg = new Ui_DlgSignaturesBase(); + m_dlg->setupUi(this); +} + +DlgSignatures::~DlgSignatures() +{ + delete m_dlg; +} +#include "moc_dlgsignatures.cpp" diff --git a/part/dlgsignatures.h b/part/dlgsignatures.h new file mode 100644 index 000000000..f54fd04c8 --- /dev/null +++ b/part/dlgsignatures.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (C) 2019 by Bubli * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef DLGSIGNATURES_H +#define DLGSIGNATURES_H + +#include + +class Ui_DlgSignaturesBase; + +class DlgSignatures : public QWidget +{ + Q_OBJECT + +public: + explicit DlgSignatures(QWidget *parent = nullptr); + virtual ~DlgSignatures(); + +private: + Ui_DlgSignaturesBase *m_dlg; +}; + +#endif diff --git a/part/dlgsignaturesbase.ui b/part/dlgsignaturesbase.ui new file mode 100644 index 000000000..d29a2b60a --- /dev/null +++ b/part/dlgsignaturesbase.ui @@ -0,0 +1,72 @@ + + + DlgSignaturesBase + + + + 0 + 0 + 375 + 118 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Digital Signatures + + + + + + Add + + + + + + + Remove + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 4 + + + + + + + + + diff --git a/part/preferencesdialog.cpp b/part/preferencesdialog.cpp index d03a67816..0f7c1c867 100644 --- a/part/preferencesdialog.cpp +++ b/part/preferencesdialog.cpp @@ -20,6 +20,7 @@ #include "dlggeneral.h" #include "dlgperformance.h" #include "dlgpresentation.h" +#include "dlgsignatures.h" PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton, Okular::EmbedMode embedMode) : KConfigDialog(parent, QStringLiteral("preferences"), skeleton) @@ -33,6 +34,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton, m_annotations = nullptr; m_annotationsPage = nullptr; m_editor = nullptr; + m_signatures = nullptr; #ifdef OKULAR_DEBUG_CONFIGPAGE m_debug = new DlgDebug(this); #endif @@ -46,9 +48,11 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton, m_presentation = new DlgPresentation(this); m_annotations = new DlgAnnotations(this); m_editor = new DlgEditor(this); + m_signatures = new DlgSignatures(this); addPage(m_presentation, i18n("Presentation"), QStringLiteral("view-presentation"), i18n("Options for Presentation Mode")); m_annotationsPage = addPage(m_annotations, i18n("Annotations"), QStringLiteral("draw-freehand"), i18n("Annotation Options")); addPage(m_editor, i18n("Editor"), QStringLiteral("accessories-text-editor"), i18n("Editor Options")); + addPage(m_signatures, i18n("Signatures"), QStringLiteral("application-pkcs7-signature"), i18n("Digital Signatures")); } #ifdef OKULAR_DEBUG_CONFIGPAGE addPage(m_debug, "Debug", "system-run", "Debug options"); diff --git a/part/preferencesdialog.h b/part/preferencesdialog.h index d2f761ff0..d43b073a4 100644 --- a/part/preferencesdialog.h +++ b/part/preferencesdialog.h @@ -23,6 +23,7 @@ class DlgAccessibility; class DlgPresentation; class DlgAnnotations; class DlgEditor; +class DlgSignatures; class DlgDebug; class PreferencesDialog : public KConfigDialog @@ -48,6 +49,7 @@ private: DlgPresentation *m_presentation; DlgAnnotations *m_annotations; DlgEditor *m_editor; + DlgSignatures *m_signatures; #ifdef OKULAR_DEBUG_CONFIGPAGE DlgDebug *m_debug; #endif