File indexing completed on 2024-04-28 15:21:51

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2010 Andreas Hartmetz <ahartmetz@gmail.com>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License as published by the Free Software Foundation; either
0007     version 2 of the License, or (at your option) any later version.
0008 
0009     This program is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012     GNU General Public License for more details.
0013 
0014     You should have received a copy of the GNU General Public License
0015     along with this program; if not, write to the Free Software
0016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0017     02110-1301, USA.
0018 */
0019 
0020 #include "kcmssl.h"
0021 #include "cacertificatespage.h"
0022 
0023 #include <kaboutdata.h>
0024 #include <kcoreaddons_version.h>
0025 
0026 #include <QVBoxLayout>
0027 #include <kpluginfactory.h>
0028 #include <kpluginloader.h>
0029 #include <klocalizedstring.h>
0030 
0031 K_PLUGIN_FACTORY(KcmSslFactory, registerPlugin<KcmSsl>();)
0032 
0033 KcmSsl::KcmSsl(QWidget *parent, const QVariantList &args)
0034     : KCModule(parent, args)
0035 {
0036     KAboutData *about = new KAboutData(
0037         "kcm_ssl", i18n("SSL Configuration Module"),
0038         KCOREADDONS_VERSION_STRING, QString(), KAboutLicense::GPL,
0039         i18n("Copyright 2010 Andreas Hartmetz"));
0040     about->addAuthor(i18n("Andreas Hartmetz"), QString(), "ahartmetz@gmail.com");
0041     setAboutData(about);
0042     setButtons(Apply | Default | Help);
0043 
0044     m_tabs = new QTabWidget(this);
0045     // tell the tab widget to resize itself to fill all space, basically...
0046     setLayout(new QVBoxLayout);
0047     layout()->setContentsMargins(0, 0, 0, 0);
0048     layout()->setSpacing(0);
0049     layout()->addWidget(m_tabs);
0050 
0051     m_caCertificatesPage = new CaCertificatesPage(m_tabs);
0052     m_tabs->addTab(m_caCertificatesPage, i18n("SSL Signers"));
0053 
0054     connect(m_caCertificatesPage, SIGNAL(changed(bool)), SLOT(pageChanged(bool)));
0055 }
0056 
0057 void KcmSsl::load()
0058 {
0059     m_caCertificatesPage->load();
0060 }
0061 
0062 void KcmSsl::save()
0063 {
0064     m_caCertificatesPage->save();
0065 }
0066 
0067 void KcmSsl::defaults()
0068 {
0069     m_caCertificatesPage->defaults();
0070 }
0071 
0072 // slot
0073 void KcmSsl::pageChanged(bool isChanged)
0074 {
0075     // HACK
0076     emit changed(isChanged);
0077 }
0078 
0079 #include "kcmssl.moc"
0080 #include "moc_kcmssl.cpp"