Commit 6e82716a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix enable/disable update key

parent b6d1ebbe
......@@ -39,14 +39,19 @@ QMenu *DKIMViewerMenu::menu() const
return mMenu;
}
void DKIMViewerMenu::setEnableUpdateDkimKeyMenu(bool enabled)
{
mUpdateDKIMKey->setEnabled(enabled);
}
void DKIMViewerMenu::initialize()
{
mMenu = new QMenu(i18n("DKIM"));
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);
mUpdateDKIMKey = mMenu->addAction(i18n("Update DKIM key"));
connect(mUpdateDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::updateDkimKey);
QAction *manageDKIMRuleDKIMKey = mMenu->addAction(i18n("Rules..."));
connect(manageDKIMRuleDKIMKey, &QAction::triggered, this, &DKIMViewerMenu::showDkimRules);
......
......@@ -23,6 +23,7 @@
#include <QObject>
#include "messageviewer_export.h"
class QMenu;
class QAction;
namespace MessageViewer {
class MESSAGEVIEWER_EXPORT DKIMViewerMenu : public QObject
{
......@@ -32,6 +33,7 @@ public:
~DKIMViewerMenu();
QMenu *menu() const;
void setEnableUpdateDkimKeyMenu(bool enabled);
Q_SIGNALS:
void recheckSignature();
void updateDkimKey();
......@@ -40,6 +42,7 @@ Q_SIGNALS:
private:
void initialize();
QMenu *mMenu = nullptr;
QAction *mUpdateDKIMKey = nullptr;
};
}
......
......@@ -3135,6 +3135,7 @@ DKIMViewerMenu *ViewerPrivate::dkimViewerMenu()
delete dlg;
});
}
mDkimViewerMenu->setEnableUpdateDkimKeyMenu(MessageViewer::MessageViewerSettings::saveKey() == MessageViewer::MessageViewerSettings::EnumSaveKey::Save);
return mDkimViewerMenu;
}
}
......
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