dkimviewermenu.cpp 1.11 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   SPDX-FileCopyrightText: 2019-2021 Laurent Montel <montel@kde.org>
3
4

   SPDX-License-Identifier: LGPL-2.0-or-later
Laurent Montel's avatar
Laurent Montel committed
5
6
7
*/

#include "dkimviewermenu.h"
Laurent Montel's avatar
Laurent Montel committed
8
#include <KLocalizedString>
Laurent Montel's avatar
Laurent Montel committed
9
#include <QMenu>
Laurent Montel's avatar
Laurent Montel committed
10

Laurent Montel's avatar
Laurent Montel committed
11
12
13
14
using namespace MessageViewer;
DKIMViewerMenu::DKIMViewerMenu(QObject *parent)
    : QObject(parent)
{
Laurent Montel's avatar
Laurent Montel committed
15
    initialize();
Laurent Montel's avatar
Laurent Montel committed
16
17
18
19
}

DKIMViewerMenu::~DKIMViewerMenu()
{
Laurent Montel's avatar
Laurent Montel committed
20
21
22
23
24
25
26
27
    delete mMenu;
}

QMenu *DKIMViewerMenu::menu() const
{
    return mMenu;
}

Laurent Montel's avatar
Laurent Montel committed
28
29
30
31
32
void DKIMViewerMenu::setEnableUpdateDkimKeyMenu(bool enabled)
{
    mUpdateDKIMKey->setEnabled(enabled);
}

Laurent Montel's avatar
Laurent Montel committed
33
34
void DKIMViewerMenu::initialize()
{
Laurent Montel's avatar
Laurent Montel committed
35
    mMenu = new QMenu(i18n("DKIM"));
Laurent Montel's avatar
Laurent Montel committed
36
37
    QAction *checkSignature = mMenu->addAction(i18n("Recheck DKIM Signature"));
    connect(checkSignature, &QAction::triggered, this, &DKIMViewerMenu::recheckSignature);
Laurent Montel's avatar
Laurent Montel committed
38

Laurent Montel's avatar
Laurent Montel committed
39
40
    mUpdateDKIMKey = mMenu->addAction(i18n("Update DKIM key"));
    connect(mUpdateDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::updateDkimKey);
Laurent Montel's avatar
Laurent Montel committed
41

Laurent Montel's avatar
Laurent Montel committed
42
    mMenu->addSeparator();
Laurent Montel's avatar
Laurent Montel committed
43
44
    QAction *manageDKIMRuleDKIMKey = mMenu->addAction(i18n("Rules..."));
    connect(manageDKIMRuleDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::showDkimRules);
Laurent Montel's avatar
Laurent Montel committed
45
}