File indexing completed on 2025-01-19 04:46:52

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "dkimconfiguretab.h"
0008 #include "dkimadvancedwidget.h"
0009 #include "dkimgeneralwidget.h"
0010 #include "dkimkeyrecordwidget.h"
0011 #include "dkimpolicywidget.h"
0012 #include <KLocalizedString>
0013 #include <KSharedConfig>
0014 #include <QHBoxLayout>
0015 #include <QTabWidget>
0016 
0017 DKIMConfigureTab::DKIMConfigureTab(QWidget *parent)
0018     : QWidget(parent)
0019     , mGeneralWidget(new DKIMGeneralWidget(this))
0020     , mRecordWidget(new DKIMKeyRecordWidget(this))
0021     , mAdvancedWidget(new DKIMAdvancedWidget(this))
0022     , mPolicyWidget(new DKIMPolicyWidget(this))
0023     , mTabWidget(new QTabWidget(this))
0024 {
0025     auto mainLayout = new QHBoxLayout(this);
0026     mainLayout->setObjectName(QLatin1StringView("mainlayout"));
0027     mainLayout->setContentsMargins({});
0028 
0029     mTabWidget->setObjectName(QLatin1StringView("tabwidget"));
0030     mainLayout->addWidget(mTabWidget);
0031     initTab();
0032 }
0033 
0034 DKIMConfigureTab::~DKIMConfigureTab() = default;
0035 
0036 void DKIMConfigureTab::initTab()
0037 {
0038     mTabWidget->addTab(mGeneralWidget, i18n("General"));
0039 
0040     mTabWidget->addTab(mRecordWidget, i18n("Record Keys"));
0041 
0042     mTabWidget->addTab(mPolicyWidget, i18n("Policy"));
0043 
0044     mTabWidget->addTab(mAdvancedWidget, i18n("Advanced"));
0045 }
0046 
0047 void DKIMConfigureTab::loadSettings()
0048 {
0049     mRecordWidget->loadSettings();
0050 }
0051 
0052 void DKIMConfigureTab::saveSettings()
0053 {
0054     mGeneralWidget->saveSettings();
0055     mRecordWidget->saveSettings();
0056 }
0057 
0058 void DKIMConfigureTab::resetSettings()
0059 {
0060     mRecordWidget->resetSettings();
0061 }
0062 
0063 #include "moc_dkimconfiguretab.cpp"