Commit 65b22a65 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve dkim menu

parent 9ce865a6
......@@ -18,6 +18,7 @@
*/
#include "dkimviewermenutest.h"
#include "dkim-verify/dkimviewermenu.h"
#include <QTest>
QTEST_MAIN(DKIMViewerMenuTest)
DKIMViewerMenuTest::DKIMViewerMenuTest(QObject *parent)
......@@ -25,3 +26,9 @@ DKIMViewerMenuTest::DKIMViewerMenuTest(QObject *parent)
{
}
void DKIMViewerMenuTest::shouldHaveDefaultValues()
{
MessageViewer::DKIMViewerMenu menu;
QVERIFY(menu.menu());
}
......@@ -28,6 +28,8 @@ class DKIMViewerMenuTest : public QObject
public:
explicit DKIMViewerMenuTest(QObject *parent = nullptr);
~DKIMViewerMenuTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
#endif // DKIMVIEWERMENUTEST_H
......@@ -19,14 +19,33 @@
#include "dkimviewermenu.h"
#include <QMenu>
#include <KLocalizedString>
using namespace MessageViewer;
DKIMViewerMenu::DKIMViewerMenu(QObject *parent)
: QObject(parent)
{
initialize();
}
DKIMViewerMenu::~DKIMViewerMenu()
{
delete mMenu;
}
QMenu *DKIMViewerMenu::menu() const
{
return mMenu;
}
void DKIMViewerMenu::initialize()
{
mMenu = new QMenu;
QAction *checkSignature = mMenu->addAction(i18n("Recheck DKIM Signature"));
connect(checkSignature, &QAction::triggered, this, &DKIMViewerMenu::recheckSignature);
QAction *updateDKIMKey = mMenu->addAction(i18n("Update DKIM key"));
connect(updateDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::updateDKimKey);
//TODO add more
}
......@@ -22,6 +22,7 @@
#include <QObject>
#include "messageviewer_private_export.h"
class QMenu;
namespace MessageViewer {
class MESSAGEVIEWER_TESTS_EXPORT DKIMViewerMenu : public QObject
{
......@@ -29,6 +30,15 @@ class MESSAGEVIEWER_TESTS_EXPORT DKIMViewerMenu : public QObject
public:
explicit DKIMViewerMenu(QObject *parent = nullptr);
~DKIMViewerMenu();
QMenu *menu() const;
Q_SIGNALS:
void recheckSignature();
void updateDKimKey();
private:
void initialize();
QMenu *mMenu = nullptr;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment