Commit b2c5aa61 authored by Katarina Behrens's avatar Katarina Behrens Committed by Albert Astals Cid
Browse files

Read/write certificate settings

parent dd0c06a8
......@@ -398,4 +398,8 @@
<default code="true">userString</default>
</entry>
</group>
<group name="Signatures" >
<entry key="Certificates" type="StringList">
</entry>
</group>
</kcfg>
......@@ -10,6 +10,7 @@
#include "certificatetools.h"
#include <iostream>
#include <klocalizedstring.h>
#include "settings.h"
#include <QFileDialog>
#include <QListWidget>
......@@ -24,12 +25,29 @@ CertificateTools::CertificateTools( QWidget * parent )
QStringList CertificateTools::tools() const
{
QStringList res;
const int count = m_list->count();
for ( int i = 0; i < count; ++i )
{
QListWidgetItem * listEntry = m_list->item(i);
res << listEntry->text();
}
return res;
}
void CertificateTools::setTools(const QStringList& /*items*/)
{
return;
m_list->clear();
QStringList certs = Okular::Settings::certificates();
foreach( const QString cert, certs )
{
QListWidgetItem * listEntry = new QListWidgetItem( cert, m_list );
}
updateButtons();
}
void CertificateTools::slotAdd()
......
......@@ -12,6 +12,8 @@
#include "certificatetools.h"
#include "ui_dlgsignaturesbase.h"
#include <KConfigDialogManager>
DlgSignatures::DlgSignatures(QWidget *parent)
: QWidget(parent)
{
......@@ -20,6 +22,9 @@ DlgSignatures::DlgSignatures(QWidget *parent)
CertificateTools * kcfg_CertTools = new CertificateTools( m_dlg->certificatesGroup );
m_dlg->certificatesPlaceholder->addWidget( kcfg_CertTools );
kcfg_CertTools->setObjectName( QStringLiteral("kcfg_Certificates") );
KConfigDialogManager::changedMap()->insert( QStringLiteral("CertificateTools"), SIGNAL(changed()) );
}
DlgSignatures::~DlgSignatures()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment