Messagelib

dkimviewermenu.cpp
1 /*
2  SPDX-FileCopyrightText: 2019-2023 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 }
QAction * addSeparator()
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QAction * addAction(const QString &text)
void initialize(StandardShortcut id)
QString i18n(const char *text, const TYPE &arg...)
void triggered(bool checked)
void setEnabled(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.