Commit 7c51f6dc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add own subjectlineeditwithautocorrection

parent b2dab8be
Pipeline #145007 failed with stage
in 3 minutes and 48 seconds
......@@ -87,6 +87,8 @@ target_sources(kmailprivate PRIVATE
identity/identityinvalidfolder.cpp
identity/identityfolderrequester.cpp
editor/kmcomposereditorng.cpp
editor/subjectlineeditwithautocorrection.cpp
editor/subjectlineeditwithautocorrection.h
editor/composer.cpp
editor/codec/codecaction.cpp
editor/codec/codecmanager.cpp
......
......@@ -10,6 +10,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kmcomposerwin.h"
#include "subjectlineeditwithautocorrection.h"
// KMail includes
#include "attachment/attachmentcontroller.h"
#include "attachment/attachmentview.h"
......@@ -331,10 +332,8 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg,
connect(recipientsEditor, &MessageComposer::RecipientsEditor::focusInRecipientLineEdit, this, &KMComposerWin::slotRecipientEditorLineFocused);
mComposerBase->setRecipientsEditor(recipientsEditor);
mEdtSubject = new PimCommon::LineEditWithAutoCorrection(mHeadersArea, QStringLiteral("kmail2rc"));
mEdtSubject = new SubjectLineEditWithAutoCorrection(mHeadersArea, QStringLiteral("kmail2rc"));
mEdtSubject->installEventFilter(this);
mEdtSubject->setActivateLanguageMenu(false);
mEdtSubject->setToolTip(i18n("Set a subject for this message"));
mEdtSubject->setAutocorrection(KMKernel::self()->composerAutoCorrection());
mLblIdentity = new QLabel(i18n("&Identity:"), mHeadersArea);
mDictionaryLabel = new QLabel(i18n("&Dictionary:"), mHeadersArea);
......
......@@ -61,6 +61,7 @@ class KMailPluginGrammarEditorManagerInterface;
class AttachmentAddedFromExternalWarning;
class KHamburgerMenu;
class TooManyRecipientsWarning;
class SubjectLineEditWithAutoCorrection;
namespace MailTransport
{
class Transport;
......@@ -591,7 +592,7 @@ private:
QWidget *mMainWidget = nullptr;
MessageComposer::ComposerLineEdit *mEdtFrom = nullptr;
PimCommon::LineEditWithAutoCorrection *mEdtSubject = nullptr;
SubjectLineEditWithAutoCorrection *mEdtSubject = nullptr;
QLabel *mLblIdentity = nullptr;
QLabel *mLblTransport = nullptr;
QLabel *mLblFcc = nullptr;
......
/*
* This file is part of KMail.
* SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "subjectlineeditwithautocorrection.h"
#include <KLocalizedString>
SubjectLineEditWithAutoCorrection::SubjectLineEditWithAutoCorrection(QWidget *parent, const QString &configFile)
: PimCommon::LineEditWithAutoCorrection(parent, configFile)
{
setActivateLanguageMenu(false);
setToolTip(i18n("Set a subject for this message"));
}
SubjectLineEditWithAutoCorrection::~SubjectLineEditWithAutoCorrection()
{
}
/*
* This file is part of KMail.
* SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "kmail_private_export.h"
#include <PimCommon/LineEditWithAutoCorrection>
class KMAILTESTS_TESTS_EXPORT SubjectLineEditWithAutoCorrection : public PimCommon::LineEditWithAutoCorrection
{
Q_OBJECT
public:
explicit SubjectLineEditWithAutoCorrection(QWidget *parent, const QString &configFile);
~SubjectLineEditWithAutoCorrection() override;
};
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