Messagelib

dkimviewermenu.cpp
1 /*
2  SPDX-FileCopyrightText: 2019-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "dkimviewermenu.h"
8 #include <KLocalizedString>
9 #include <QMenu>
10 
11 using namespace MessageViewer;
12 DKIMViewerMenu::DKIMViewerMenu(QObject *parent)
13  : QObject(parent)
14  , mMenu(new QMenu(i18n("DKIM")))
15 {
16  initialize();
17 }
18 
19 DKIMViewerMenu::~DKIMViewerMenu()
20 {
21  delete mMenu;
22 }
23 
24 QMenu *DKIMViewerMenu::menu() const
25 {
26  return mMenu;
27 }
28 
29 void DKIMViewerMenu::setEnableUpdateDkimKeyMenu(bool enabled)
30 {
31  mUpdateDKIMKey->setEnabled(enabled);
32 }
33 
34 void DKIMViewerMenu::initialize()
35 {
36  QAction *checkSignature = mMenu->addAction(i18n("Recheck DKIM Signature"));
37  connect(checkSignature, &QAction::triggered, this, &DKIMViewerMenu::recheckSignature);
38 
39  mUpdateDKIMKey = mMenu->addAction(i18n("Update DKIM key"));
40  connect(mUpdateDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::updateDkimKey);
41 
42  mMenu->addSeparator();
43  QAction *manageDKIMRuleDKIMKey = mMenu->addAction(i18n("Rules..."));
44  connect(manageDKIMRuleDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::showDkimRules);
45 }
void triggered(bool checked)
KCRASH_EXPORT void initialize()
void setEnabled(bool)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Nov 28 2021 23:05:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.