From 4898220e571529081af5cb8fd56e005c0f8b9c2a Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 15 Oct 2018 13:42:17 +0200 Subject: [PATCH] Update plugin converter text action --- CMakeLists.txt | 2 +- src/editor/kmcomposerwin.cpp | 6 ++++++ src/editor/kmcomposerwin.h | 1 + .../kmailplugineditorconverttextmanagerinterface.cpp | 7 +++++++ .../kmailplugineditorconverttextmanagerinterface.h | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86142291e..924b448e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget set(LIBGRAVATAR_VERSION_LIB "5.9.40") set(MAILCOMMON_LIB_VERSION_LIB "5.9.41") set(KDEPIM_APPS_LIB_VERSION_LIB "5.9.40") -set(MESSAGELIB_LIB_VERSION_LIB "5.9.53") +set(MESSAGELIB_LIB_VERSION_LIB "5.9.55") set(LIBKLEO_LIB_VERSION_LIB "5.9.40") set(PIMCOMMON_LIB_VERSION_LIB "5.9.42") set(LIBKDEPIM_LIB_VERSION_LIB "5.9.40") diff --git a/src/editor/kmcomposerwin.cpp b/src/editor/kmcomposerwin.cpp index cb0fec3bb..defe6197b 100644 --- a/src/editor/kmcomposerwin.cpp +++ b/src/editor/kmcomposerwin.cpp @@ -2982,6 +2982,12 @@ void KMComposerWin::slotTextModeChanged(MessageComposer::RichTextComposerNg::Mod } else { enableHtml(); } + enableDisablePluginActions(mode == MessageComposer::RichTextComposerNg::Rich); +} + +void KMComposerWin::enableDisablePluginActions(bool richText) +{ + mPluginEditorConvertTextManagerInterface->enableDisablePluginActions(richText); } void KMComposerWin::htmlToolBarVisibilityChanged(bool visible) diff --git a/src/editor/kmcomposerwin.h b/src/editor/kmcomposerwin.h index 6a4c022e0..fe31759ee 100644 --- a/src/editor/kmcomposerwin.h +++ b/src/editor/kmcomposerwin.h @@ -413,6 +413,7 @@ public: // kmcommand QList customToolsList() const; QList pluginToolsActionListForPopupMenu() const; private: + void enableDisablePluginActions(bool richText); /** * Read settings from app's config file. */ diff --git a/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp b/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp index 6b6d0af85..998177fbd 100644 --- a/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp +++ b/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp @@ -33,6 +33,13 @@ KMailPluginEditorConvertTextManagerInterface::~KMailPluginEditorConvertTextManag { } +void KMailPluginEditorConvertTextManagerInterface::enableDisablePluginActions(bool richText) +{ + for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) { + interface->enableDisablePluginActions(richText); + } +} + void KMailPluginEditorConvertTextManagerInterface::reformatText() { for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) { diff --git a/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.h b/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.h index c9f00e5aa..33bdd8131 100644 --- a/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.h +++ b/src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.h @@ -53,6 +53,7 @@ public: void setInitialData(const MessageComposer::PluginEditorConverterInitialData &data); void setDataBeforeConvertingText(const MessageComposer::PluginEditorConverterBeforeConvertingData &data); + void enableDisablePluginActions(bool richText); Q_SIGNALS: void reformatingTextDone();