Commit 77961bb3 authored by Laurent Montel's avatar Laurent Montel 😁

Adapt to new api

parent f4f66664
......@@ -66,7 +66,7 @@ find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widget
set(LIBGRAVATAR_VERSION_LIB "5.5.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.5.40")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.5.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.5.41")
set(MESSAGELIB_LIB_VERSION_LIB "5.5.42")
set(LIBKLEO_LIB_VERSION_LIB "5.5.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.5.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.5.40")
......
......@@ -373,32 +373,32 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
QVBoxLayout *vbox = new QVBoxLayout(editorAndCryptoStateIndicators);
vbox->setMargin(0);
KMComposerEditorNg *editor = new KMComposerEditorNg(this, mCryptoStateIndicatorWidget);
mRichTextEditorwidget = new KPIMTextEdit::RichTextEditorWidget(editor, mCryptoStateIndicatorWidget);
KMComposerEditorNg *composerEditorNg = new KMComposerEditorNg(this, mCryptoStateIndicatorWidget);
mRichTextEditorwidget = new KPIMTextEdit::RichTextEditorWidget(composerEditorNg, mCryptoStateIndicatorWidget);
//Don't use new connect api here. It crashs
connect(editor, SIGNAL(textChanged()), this, SLOT(slotEditorTextChanged()));
connect(composerEditorNg, SIGNAL(textChanged()), this, SLOT(slotEditorTextChanged()));
//connect(editor, &KMComposerEditor::textChanged, this, &KMComposeWin::slotEditorTextChanged);
mComposerBase->setEditor(editor);
mComposerBase->setEditor(composerEditorNg);
vbox->addWidget(mCryptoStateIndicatorWidget);
vbox->addWidget(mRichTextEditorwidget);
mSnippetSplitter->insertWidget(0, editorAndCryptoStateIndicators);
mSnippetSplitter->setOpaqueResize(true);
sigController->setEditor(editor);
sigController->setEditor(composerEditorNg);
mHeadersToEditorSplitter->addWidget(mSplitter);
editor->setAcceptDrops(true);
composerEditorNg->setAcceptDrops(true);
connect(sigController, &MessageComposer::SignatureController::signatureAdded,
mComposerBase->editor()->externalComposer(), &KPIMTextEdit::RichTextExternalComposer::startExternalEditor);
connect(dictionaryCombo, &Sonnet::DictionaryComboBox::dictionaryChanged, this, &KMComposerWin::slotSpellCheckingLanguage);
connect(editor, &KMComposerEditorNg::languageChanged, this, &KMComposerWin::slotDictionaryLanguageChanged);
connect(editor, &KMComposerEditorNg::spellCheckStatus, this, &KMComposerWin::slotSpellCheckingStatus);
connect(editor, &KMComposerEditorNg::insertModeChanged, this, &KMComposerWin::slotOverwriteModeChanged);
connect(editor, &KMComposerEditorNg::spellCheckingFinished, this, &KMComposerWin::slotDelayedCheckSendNow);
mSnippetWidget = new SnippetWidget(editor, actionCollection(), mSnippetSplitter);
connect(composerEditorNg, &KMComposerEditorNg::languageChanged, this, &KMComposerWin::slotDictionaryLanguageChanged);
connect(composerEditorNg, &KMComposerEditorNg::spellCheckStatus, this, &KMComposerWin::slotSpellCheckingStatus);
connect(composerEditorNg, &KMComposerEditorNg::insertModeChanged, this, &KMComposerWin::slotOverwriteModeChanged);
connect(composerEditorNg, &KMComposerEditorNg::spellCheckingFinished, this, &KMComposerWin::slotDelayedCheckSendNow);
mSnippetWidget = new SnippetWidget(composerEditorNg, actionCollection(), mSnippetSplitter);
mSnippetWidget->setVisible(KMailSettings::self()->showSnippetManager());
mSnippetSplitter->addWidget(mSnippetWidget);
mSnippetSplitter->setCollapsible(0, false);
......@@ -450,7 +450,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mPluginEditorCheckBeforeSendManagerInterface->setParentWidget(this);
mPluginEditorInitManagerInterface->setParent(this);
mPluginEditorInitManagerInterface->setRichTextEditor(mRichTextEditorwidget->editor());
mPluginEditorInitManagerInterface->setRichTextEditor(composerEditorNg);
setupStatusBar(attachmentView->widget());
setupActions();
......@@ -482,8 +482,8 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
}
if (KMailSettings::self()->useExternalEditor()) {
editor->setUseExternalEditor(true);
editor->setExternalEditorPath(KMailSettings::self()->externalEditor());
composerEditorNg->setUseExternalEditor(true);
composerEditorNg->setExternalEditorPath(KMailSettings::self()->externalEditor());
}
const QList<KPIM::MultiplyingLine *> lstLines = recipientsEditor->lines();
......@@ -496,7 +496,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
}
mComposerBase->recipientsEditor()->setFocus();
editor->composerActions()->updateActionStates(); // set toolbar buttons to correct values
composerEditorNg->composerActions()->updateActionStates(); // set toolbar buttons to correct values
mDone = true;
......
......@@ -33,12 +33,12 @@ KMailPluginEditorInitManagerInterface::KMailPluginEditorInitManagerInterface(QOb
}
KPIMTextEdit::RichTextEditor *KMailPluginEditorInitManagerInterface::richTextEditor() const
KPIMTextEdit::RichTextComposer *KMailPluginEditorInitManagerInterface::richTextEditor() const
{
return mRichTextEditor;
}
void KMailPluginEditorInitManagerInterface::setRichTextEditor(KPIMTextEdit::RichTextEditor *richTextEditor)
void KMailPluginEditorInitManagerInterface::setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor)
{
mRichTextEditor = richTextEditor;
}
......
......@@ -24,7 +24,7 @@
#include <QObject>
namespace KPIMTextEdit
{
class RichTextEditor;
class RichTextComposer;
}
class KMailPluginEditorInitManagerInterface : public QObject
......@@ -34,18 +34,17 @@ public:
explicit KMailPluginEditorInitManagerInterface(QObject *parent = nullptr);
~KMailPluginEditorInitManagerInterface() = default;
KPIMTextEdit::RichTextEditor *richTextEditor() const;
void setRichTextEditor(KPIMTextEdit::RichTextEditor *richTextEditor);
KPIMTextEdit::RichTextComposer *richTextEditor() const;
void setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor);
QWidget *parentWidget() const;
void setParentWidget(QWidget *parentWidget);
void initializePlugins();
private:
KPIMTextEdit::RichTextEditor *mRichTextEditor;
KPIMTextEdit::RichTextComposer *mRichTextEditor;
QWidget *mParentWidget;
bool mWasInitialized;
//QList<MessageComposer::PluginEditorInterface *> mListPluginInterface;
};
#endif // KMAILPLUGINEDITORINITMANAGERINTERFACE_H
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