Continue to implement using converttext plugin

wilder
Laurent Montel 8 years ago
parent b6bf46e025
commit 52d1028483
  1. 5
      src/editor/kmcomposereditorng.cpp
  2. 5
      src/editor/kmcomposerwin.cpp
  3. 1
      src/editor/kmcomposerwin.h
  4. 6
      src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp
  5. 2
      src/editor/plugininterface/kmailplugineditorconverttextmanagerinterface.h

@ -157,7 +157,8 @@ void KMComposerEditorNg::showSpellConfigDialog(const QString &configFileName)
bool KMComposerEditorNg::convertPlainText(MessageComposer::TextPart *textPart)
{
Q_UNUSED(textPart);
//TODO implement it
if (mComposerWin->convertPlainText(textPart)) {
return true;
}
return false;
}

@ -3352,6 +3352,11 @@ void KMComposerWin::addExtraCustomHeaders(const QMap<QByteArray, QString> &heade
mExtraHeaders = headers;
}
bool KMComposerWin::convertPlainText(MessageComposer::TextPart *textPart)
{
return mPluginEditorConvertTextManagerInterface->convertTextToFormat(textPart);
}
void KMComposerWin::slotExternalEditorStarted()
{
mComposerBase->identityCombo()->setEnabled(false);

@ -215,6 +215,7 @@ public: // kmkernel, kmcommands, callback
void addExtraCustomHeaders(const QMap<QByteArray, QString> &header) override;
bool convertPlainText(MessageComposer::TextPart *textPart);
private:
/**
* Write settings to app's config file.

@ -44,14 +44,18 @@ void KMailPluginEditorConvertTextManagerInterface::reformatText()
Q_EMIT reformatingTextDone();
}
void KMailPluginEditorConvertTextManagerInterface::convertTextToFormat(MessageComposer::TextPart *textPart)
bool KMailPluginEditorConvertTextManagerInterface::convertTextToFormat(MessageComposer::TextPart *textPart)
{
bool converted = false;
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
if (interface->convertTextToFormat(textPart)) {
//TODO signal that it was reformating.
//Stop it.?
} else {
converted = true;
}
}
return converted;
}
void KMailPluginEditorConvertTextManagerInterface::setInitialData(const MessageComposer::PluginEditorConverterInitialData &data)

@ -49,7 +49,7 @@ public:
QList<QAction *> actionsType(MessageComposer::PluginActionType::Type type);
void reformatText();
void convertTextToFormat(MessageComposer::TextPart *textPart);
bool convertTextToFormat(MessageComposer::TextPart *textPart);
void setInitialData(const MessageComposer::PluginEditorConverterInitialData &data);
void setDataBeforeConvertingText(const MessageComposer::PluginEditorConverterBeforeConvertingData &data);

Loading…
Cancel
Save