Commit 66c78855 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Reply/forward based on display format in viewer

parent 557c2328
Pipeline #21378 failed with stage
in 4 minutes and 47 seconds
......@@ -66,7 +66,7 @@ option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
set(LIBGRAVATAR_VERSION_LIB "5.14.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.14.43")
set(MESSAGELIB_LIB_VERSION_LIB "5.14.44")
set(MESSAGELIB_LIB_VERSION_LIB "5.14.45")
set(LIBKLEO_LIB_VERSION_LIB "5.14.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.14.41")
set(LIBKDEPIM_LIB_VERSION_LIB "5.14.42")
......
......@@ -259,15 +259,15 @@ ComposerPageGeneralTab::ComposerPageGeneralTab(QWidget *parent)
++row;
// "Reply/Forward using HTML if present" checkbox
mReplyUsingHtml = new QCheckBox(TemplateParser::TemplateParserSettings::self()->replyUsingHtmlItem()->label(), this);
mReplyUsingVisualFormat = new QCheckBox(TemplateParser::TemplateParserSettings::self()->replyUsingVisualFormatItem()->label(), this);
helpText = i18n("When replying or forwarding, quote the message\n"
"in the original format it was received.\n"
"If unchecked, the reply will be as plain text by default.");
mReplyUsingHtml->setToolTip(helpText);
mReplyUsingHtml->setWhatsThis(helpText);
mReplyUsingVisualFormat->setToolTip(helpText);
mReplyUsingVisualFormat->setWhatsThis(helpText);
connect(mReplyUsingHtml, &QCheckBox::stateChanged, this, &ConfigModuleTab::slotEmitChanged);
groupGridLayout->addWidget(mReplyUsingHtml, row, 0, 1, -1);
connect(mReplyUsingVisualFormat, &QCheckBox::stateChanged, this, &ConfigModuleTab::slotEmitChanged);
groupGridLayout->addWidget(mReplyUsingVisualFormat, row, 0, 1, -1);
++row;
// "Improve plain text of HTML" checkbox
......@@ -519,7 +519,7 @@ void ComposerPage::GeneralTab::doLoadFromGlobalSettings()
loadWidget(mSmartQuoteCheck, TemplateParser::TemplateParserSettings::self()->smartQuoteItem());
loadWidget(mQuoteSelectionOnlyCheck, MessageComposer::MessageComposerSettings::self()->quoteSelectionOnlyItem());
loadWidget(mReplyUsingHtml, TemplateParser::TemplateParserSettings::self()->replyUsingHtmlItem());
loadWidget(mReplyUsingVisualFormat, TemplateParser::TemplateParserSettings::self()->replyUsingVisualFormatItem());
loadWidget(mStripSignatureCheck, TemplateParser::TemplateParserSettings::self()->stripSignatureItem());
loadWidget(mAutoRequestMDNCheck, KMailSettings::self()->requestMDNItem());
loadWidget(mWordWrapCheck, MessageComposer::MessageComposerSettings::self()->wordWrapItem());
......@@ -551,7 +551,7 @@ void ComposerPage::GeneralTab::save()
saveCheckBox(mSmartQuoteCheck, TemplateParser::TemplateParserSettings::self()->smartQuoteItem());
saveCheckBox(mQuoteSelectionOnlyCheck, MessageComposer::MessageComposerSettings::self()->quoteSelectionOnlyItem());
saveCheckBox(mReplyUsingHtml, TemplateParser::TemplateParserSettings::self()->replyUsingHtmlItem());
saveCheckBox(mReplyUsingVisualFormat, TemplateParser::TemplateParserSettings::self()->replyUsingVisualFormatItem());
saveCheckBox(mStripSignatureCheck, TemplateParser::TemplateParserSettings::self()->stripSignatureItem());
saveCheckBox(mAutoRequestMDNCheck, KMailSettings::self()->requestMDNItem());
saveCheckBox(mWordWrapCheck, MessageComposer::MessageComposerSettings::self()->wordWrapItem());
......
......@@ -60,7 +60,7 @@ private:
QCheckBox *mAutoAppSignFileCheck = nullptr;
QCheckBox *mTopQuoteCheck = nullptr;
QCheckBox *mDashDashCheck = nullptr;
QCheckBox *mReplyUsingHtml = nullptr;
QCheckBox *mReplyUsingVisualFormat = nullptr;
QCheckBox *mSmartQuoteCheck = nullptr;
QCheckBox *mStripSignatureCheck = nullptr;
QCheckBox *mQuoteSelectionOnlyCheck = nullptr;
......
......@@ -870,6 +870,7 @@ KMCommand::Result KMReplyCommand::execute()
settings.templateStr = mTemplate;
settings.noQuote = mNoQuote;
settings.replyAsHtml = mReplyAsHtml;
qDebug() << " settings " << mReplyAsHtml;
CreateReplyMessageJob *job = new CreateReplyMessageJob;
job->setSettings(settings);
......@@ -885,6 +886,7 @@ bool KMReplyCommand::replyAsHtml() const
void KMReplyCommand::setReplyAsHtml(bool replyAsHtml)
{
qDebug() << " void KMReplyCommand::setReplyAsHtml(bool replyAsHtml)"<<replyAsHtml;
mReplyAsHtml = replyAsHtml;
}
......
......@@ -493,7 +493,8 @@ void MessageActions::replyCommand(MessageComposer::ReplyStrategy strategy)
}
const QString text = mMessageView ? mMessageView->copyText() : QString();
KMCommand *command = new KMReplyCommand(mParent, mCurrentItem, strategy, text);
KMReplyCommand *command = new KMReplyCommand(mParent, mCurrentItem, strategy, text);
command->setReplyAsHtml(mMessageView ? mMessageView->viewer()->htmlMail() : false);
connect(command, &KMCommand::completed, this, &MessageActions::replyActionFinished);
command->start();
}
......@@ -566,7 +567,9 @@ void MessageActions::slotNoQuoteReplyToMsg()
if (!mCurrentItem.hasPayload<KMime::Message::Ptr>()) {
return;
}
KMCommand *command = new KMReplyCommand(mParent, mCurrentItem, MessageComposer::ReplySmart, QString(), true);
KMReplyCommand *command = new KMReplyCommand(mParent, mCurrentItem, MessageComposer::ReplySmart, QString(), true);
command->setReplyAsHtml(mMessageView ? mMessageView->viewer()->htmlMail() : false);
command->start();
}
......
......@@ -802,6 +802,7 @@ void SearchWindow::slotClearSelection()
void SearchWindow::slotReplyToMsg()
{
KMCommand *command = new KMReplyCommand(this, selectedMessage(), MessageComposer::ReplySmart);
command->start();
}
......
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