Continue to implement processkeyevent

wilder
Laurent Montel 7 years ago
parent 45dbb909f7
commit 20e08e1cc5
  1. 2
      CMakeLists.txt
  2. 4
      src/editor/kmcomposerwin.cpp
  3. 14
      src/editor/plugininterface/kmailplugineditormanagerinterface.cpp
  4. 2
      src/editor/plugininterface/kmailplugineditormanagerinterface.h

@ -69,7 +69,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget
set(LIBGRAVATAR_VERSION_LIB "5.12.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.12.43")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.12.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.12.56")
set(MESSAGELIB_LIB_VERSION_LIB "5.12.57")
set(LIBKLEO_LIB_VERSION_LIB "5.12.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.12.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.12.40")

@ -3336,9 +3336,7 @@ void KMComposerWin::addExtraCustomHeaders(const QMap<QByteArray, QString> &heade
bool KMComposerWin::processModifyText(QKeyEvent *event)
{
Q_UNUSED(event);
//TODO
return false;
return mPluginEditorManagerInterface->processProcessKeyEvent(event);
}
MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus KMComposerWin::convertPlainText(MessageComposer::TextPart *textPart)

@ -103,6 +103,20 @@ void KMailPluginEditorManagerInterface::setComposerInterface(MessageComposer::Co
mComposerInterface = composerInterface;
}
bool KMailPluginEditorManagerInterface::processProcessKeyEvent(QKeyEvent *event)
{
if (!mListPluginInterface.isEmpty()) {
for (MessageComposer::PluginEditorInterface *interface : qAsConst(mListPluginInterface)) {
if (static_cast<MessageComposer::PluginEditor *>(interface->plugin())->canProcessKeyEvent()) {
if (interface->processProcessKeyEvent(event)) {
return true;
}
}
}
}
return false;
}
KActionCollection *KMailPluginEditorManagerInterface::actionCollection() const
{
return mActionCollection;

@ -56,6 +56,8 @@ public:
MessageComposer::ComposerViewBase *composerInterface() const;
void setComposerInterface(MessageComposer::ComposerViewBase *composerInterface);
Q_REQUIRED_RESULT bool processProcessKeyEvent(QKeyEvent *event);
Q_SIGNALS:
void textSelectionChanged(bool hasSelection);
void message(const QString &str);

Loading…
Cancel
Save