Commit 7d1ff526 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement mdnwarningwidget

parent 9cbdd973
Pipeline #195004 passed with stage
in 4 minutes and 9 seconds
......@@ -69,7 +69,7 @@ option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branc
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngineWidgets)
set(LIBGRAVATAR_VERSION "5.20.40")
set(MAILCOMMON_LIB_VERSION "5.20.42")
set(MESSAGELIB_LIB_VERSION "5.20.45")
set(MESSAGELIB_LIB_VERSION "5.20.47")
set(LIBKLEO_LIB_VERSION "5.20.40")
set(PIMCOMMON_LIB_VERSION "5.20.41")
set(LIBKDEPIM_LIB_VERSION "5.20.40")
......
......@@ -45,6 +45,8 @@
#include <MailCommon/MailKernel>
#include <MailCommon/MailUtil>
#include <MailCommon/SearchRuleStatus>
#include <MessageComposer/MDNWarningWidgetJob>
#include <MessageViewer/MDNWarningWidget>
#include "collectionpage/collectionmailinglistpage.h"
#include "collectionpage/collectionquotapage.h"
......@@ -120,6 +122,7 @@
#include <Akonadi/ItemFetchJob>
#include <Akonadi/ItemFetchScope>
#include <Akonadi/ItemModifyJob>
#include <Akonadi/MDNStateAttribute>
#include <Akonadi/MessageFlags>
#include <Akonadi/Session>
#include <Akonadi/StandardActionManager>
......@@ -4460,6 +4463,19 @@ void KMMainWidget::slotMessageSelected(const Akonadi::Item &item)
}
}
void KMMainWidget::slotShowMdnInfo(const QPair<QString, bool> &mdnInfo)
{
qDebug() << "mdnInfo " << mdnInfo;
if (mMsgView) {
if (!mdnInfo.first.isEmpty()) {
mMsgView->viewer()->mdnWarning()->setCanDeny(mdnInfo.second);
mMsgView->viewer()->mdnWarning()->setInformation(mdnInfo.first);
} else {
mMsgView->viewer()->mdnWarning()->animatedHide();
}
}
}
void KMMainWidget::itemsReceived(const Akonadi::Item::List &list)
{
qCDebug(KMAIL_LOG) << " list count " << list.count();
......@@ -4487,6 +4503,24 @@ void KMMainWidget::itemsReceived(const Akonadi::Item::List &list)
}
return;
}
if (item.hasAttribute<Akonadi::MDNStateAttribute>()
&& item.attribute<Akonadi::MDNStateAttribute>()->mdnState() == Akonadi::MDNStateAttribute::MDNStateUnknown) {
auto job = new MessageComposer::MDNWarningWidgetJob(this);
job->setItem(item);
connect(job, &MessageComposer::MDNWarningWidgetJob::showMdnInfo, this, &KMMainWidget::slotShowMdnInfo);
if (!job->start()) {
qCWarning(KMAIL_LOG) << "Impossible to start MDNWarningWidgetJob";
}
} else if (!item.hasAttribute<Akonadi::MDNStateAttribute>()) {
auto job = new MessageComposer::MDNWarningWidgetJob(this);
job->setItem(item);
connect(job, &MessageComposer::MDNWarningWidgetJob::showMdnInfo, this, &KMMainWidget::slotShowMdnInfo);
if (!job->start()) {
qCWarning(KMAIL_LOG) << "Impossible to start MDNWarningWidgetJob";
}
} else {
mMsgView->viewer()->mdnWarning()->animatedHide();
}
}
Akonadi::Item copyItem(item);
......
......@@ -533,6 +533,7 @@ private:
void redoSwitchFolder();
void undoSwitchFolder();
void updateMoveAllToTrash();
void slotShowMdnInfo(const QPair<QString, bool> &mdnInfo);
// Message actions
QAction *mDeleteAction = nullptr;
......
Supports Markdown
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