diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8081b4b30..8e81695ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,424 +1,425 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kmail\") qt5_generate_dbus_interface(kmkernel.h org.kde.kmail.kmail.xml OPTIONS -a) qt5_generate_dbus_interface(editor/kmcomposerwin.h org.kde.kmail.mailcomposer.xml OPTIONS -a) add_custom_target(kmail_xml ALL DEPENDS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml DEPENDS ${kmail_BINARY_DIR}/src/org.kde.kmail.mailcomposer.xml COMMENT "Helper target for XML stuff. The Kontact plugin, KOrganizer and others depend on it." ) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${GPGME_INCLUDES} ${AKONADI_INCLUDE_DIR} ) add_subdirectory(pics) add_subdirectory(icons) add_subdirectory(kconf_update) add_subdirectory(kontactplugin) ########### kmailprivate ############### set(kmailprivate_attributes_LIB_SRCS attributes/taskattribute.cpp ) set(kmailprivate_folderarchive_LIB_SRCS folderarchive/folderarchiveaccountinfo.cpp folderarchive/folderarchiveutil.cpp folderarchive/folderarchivecache.cpp folderarchive/folderarchiveagentcheckcollection.cpp folderarchive/folderarchivemanager.cpp folderarchive/folderarchiveagentjob.cpp ) set(kmailprivate_collectionpage_LIB_SRCS collectionpage/collectiontemplatespage.cpp collectionpage/collectionviewpage.cpp collectionpage/collectionquotapage.cpp collectionpage/collectionquotawidget.cpp collectionpage/collectionmailinglistpage.cpp collectionpage/collectionshortcutpage.cpp ) set(kmailprivate_configuredialog_LIB_SRCS configuredialog/configagentdelegate.cpp configuredialog/configuredialoglistview.cpp configuredialog/configuredialog.cpp configuredialog/configuredialog_p.cpp configuredialog/configuremiscpage.cpp configuredialog/configuresecuritypage.cpp configuredialog/configurecomposerpage.cpp configuredialog/configureappearancepage.cpp configuredialog/configureaccountpage.cpp configuredialog/configurepluginpage.cpp configuredialog/colorlistbox.cpp ) set(kmailprivate_configureplugins_LIB_SRCS configuredialog/configureplugins/configurepluginslistwidget.cpp ) set(kmailprivate_searchdialog_LIB_SRCS searchdialog/kmsearchmessagemodel.cpp searchdialog/searchpatternwarning.cpp searchdialog/kmailsearchpatternedit.cpp searchdialog/searchwindow.cpp searchdialog/searchdescriptionattribute.cpp searchdialog/incompleteindexdialog.cpp ) set(kmailprivate_identity_LIB_SRCS identity/identitylistview.cpp identity/identitydialog.cpp identity/xfaceconfigurator.cpp identity/identitypage.cpp identity/newidentitydialog.cpp identity/identityeditvcarddialog.cpp identity/identityaddvcarddialog.cpp identity/identityinvalidfolder.cpp identity/identityfolderrequester.cpp ) set(kmailprivate_editor_LIB_SRCS editor/widgets/snippetwidget.cpp editor/kmcomposereditorng.cpp editor/composer.cpp editor/codec/codecaction.cpp editor/codec/codecmanager.cpp editor/kmcomposerwin.cpp editor/attachment/attachmentcontroller.cpp editor/attachment/attachmentview.cpp editor/widgets/cryptostateindicatorwidget.cpp editor/validatesendmailshortcut.cpp editor/kmcomposerglobalaction.cpp editor/kmcomposerupdatetemplatejob.cpp editor/kmcomposercreatenewcomposerjob.cpp ) set(kmailprivate_warningwidgets_LIB_SRCS editor/warningwidgets/externaleditorwarning.cpp editor/warningwidgets/attachmentmissingwarning.cpp editor/warningwidgets/incorrectidentityfolderwarning.cpp ) set(kmailprivate_editor_potentialphishingemail_SRCS editor/potentialphishingemail/potentialphishingemailwarning.cpp editor/potentialphishingemail/potentialphishingemailjob.cpp editor/potentialphishingemail/potentialphishingdetaildialog.cpp editor/potentialphishingemail/potentialphishingdetailwidget.cpp ) set(kmailprivate_dialogs_LIB_SRCS dialog/archivefolderdialog.cpp dialog/addemailtoexistingcontactdialog.cpp dialog/kmknotify.cpp + dialog/spellcheckerconfigdialog.cpp ) set(kmailprivate_job_LIB_SRCS job/addressvalidationjob.cpp job/createnewcontactjob.cpp job/addemailtoexistingcontactjob.cpp job/createtaskjob.cpp job/savedraftjob.cpp job/removeduplicatemailjob.cpp job/createfollowupreminderonexistingmessagejob.cpp job/removecollectionjob.cpp job/saveasfilejob.cpp job/markallmessagesasreadinfolderandsubfolderjob.cpp job/removeduplicatemessageinfolderandsubfolderjob.cpp job/handleclickedurljob.cpp job/composenewmessagejob.cpp job/opencomposerjob.cpp job/newmessagejob.cpp job/opencomposerhiddenjob.cpp job/fillcomposerjob.cpp job/createreplymessagejob.cpp job/createforwardmessagejob.cpp job/dndfromarkjob.cpp ) set(kmailprivate_widgets_LIB_SRCS widgets/collectionpane.cpp widgets/vacationscriptindicatorwidget.cpp widgets/displaymessageformatactionmenu.cpp widgets/kactionmenutransport.cpp widgets/kactionmenuaccount.cpp widgets/zoomlabelwidget.cpp ) set(kmailprivate_tag_LIB_SRCS tag/tagactionmanager.cpp tag/tagselectdialog.cpp ) set(kmailprivate_plugininterface_LIB_SRCS plugininterface/kmailplugininterface.cpp ) set(kmailprivate_editor_plugininterface_LIB_SRCS editor/plugininterface/kmailplugineditormanagerinterface.cpp editor/plugininterface/kmailplugineditorcheckbeforesendmanagerinterface.cpp editor/plugininterface/kmailplugineditorinitmanagerinterface.cpp editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp editor/plugininterface/kmailplugingrammareditormanagerinterface.cpp ) set(kmailprivate_checkindexing_LIB_SRCS search/checkindexingmanager.cpp search/checkindexingjob.cpp ) set(kmailprivate_sieveimapinstanceinterface_LIB_SRCS sieveimapinterface/kmailsieveimapinstanceinterface.cpp sieveimapinterface/kmsieveimappasswordprovider.cpp ) set(kmail_common_SRCS) ecm_qt_declare_logging_category(kmail_common_SRCS HEADER kmail_debug.h IDENTIFIER KMAIL_LOG CATEGORY_NAME org.kde.pim.kmail) set(kmailprivate_LIB_SRCS ${kmail_common_SRCS} kmmainwin.cpp settings/kmailsettings.cpp kmreaderwin.cpp kmsystemtray.cpp unityservicemanager.cpp undostack.cpp kmkernel.cpp kmcommands.cpp kmreadermainwin.cpp kmstartup.cpp kmmainwidget.cpp aboutdata.cpp mailserviceimpl.cpp secondarywindow.cpp util.cpp messageactions.cpp foldershortcutactionmanager.cpp kmlaunchexternalcomponent.cpp manageshowcollectionproperties.cpp kmmigrateapplication.cpp ${kmailprivate_configureplugins_LIB_SRCS} ${kmailprivate_attributes_LIB_SRCS} ${kmailprivate_tag_LIB_SRCS} ${kmailprivate_job_LIB_SRCS} ${kmailprivate_widgets_LIB_SRCS} ${kmailprivate_dialogs_LIB_SRCS} ${kmailprivate_warningwidgets_LIB_SRCS} ${kmailprivate_folderarchive_LIB_SRCS} ${kmailprivate_collectionpage_LIB_SRCS} ${kmailprivate_configuredialog_LIB_SRCS} ${kmailprivate_searchdialog_LIB_SRCS} ${kmailprivate_identity_LIB_SRCS} ${kmailprivate_editor_LIB_SRCS} ${kmailprivate_editor_potentialphishingemail_SRCS} ${kmailprivate_plugininterface_LIB_SRCS} ${kmailprivate_editor_plugininterface_LIB_SRCS} ${kmailprivate_checkindexing_LIB_SRCS} ${kmailprivate_sieveimapinstanceinterface_LIB_SRCS} ) qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.mailcomposer.xml editor/kmcomposerwin.h KMComposerWin ) qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml kmkernel.h KMKernel ) qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS ${MAILTRANSPORT_DBUS_SERVICE} mailserviceimpl.h KMail::MailServiceImpl ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS ../agents/archivemailagent/org.freedesktop.Akonadi.ArchiveMailAgent.xml ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS ../agents/sendlateragent/org.freedesktop.Akonadi.SendLaterAgent.xml ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS dbusinterface/org.freedesktop.Akonadi.NewMailNotifier.xml ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS ../agents/followupreminderagent/org.freedesktop.Akonadi.FollowUpReminder.xml ) qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS ../agents/mailfilteragent/org.freedesktop.Akonadi.MailFilterAgent.xml ) ki18n_wrap_ui(kmailprivate_LIB_SRCS ui/composercryptoconfiguration.ui ui/warningconfiguration.ui ui/smimeconfiguration.ui ui/miscpagemaintab.ui ui/securitypagegeneraltab.ui ui/securitypagemdntab.ui ui/identitypage.ui ui/accountspagereceivingtab.ui ui/searchwindow.ui ui/incompleteindexdialog.ui ) qt5_add_resources(kmailprivate_LIB_SRCS kmail.qrc) # KCFG files. The main kmail.kcfg is configured by CMake and put # in the build directory. if(KDEPIM_ENTERPRISE_BUILD) set(WARN_TOOMANY_RECIPIENTS_DEFAULT true) else() set(WARN_TOOMANY_RECIPIENTS_DEFAULT false) endif() configure_file(settings/kmail.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg) kconfig_add_kcfg_files(kmailprivate_LIB_SRCS settings/globalsettings_kmail.kcfgc editor/custommimeheader/custommimeheader.kcfgc ) add_library(kmailprivate ${kmailprivate_LIB_SRCS}) generate_export_header(kmailprivate BASE_NAME kmail) target_link_libraries(kmailprivate PRIVATE KF5::TextWidgets KF5::I18n KF5::Gravatar KF5::Mime KF5::AkonadiCore KF5::AkonadiMime KF5::MessageCore KF5::MessageList KF5::MessageComposer KF5::PimCommon KF5::MailCommon KF5::TemplateParser KF5::IdentityManagement KF5::WindowSystem KF5::Notifications KF5::GuiAddons KF5::Crash KF5::KIOFileWidgets KF5::NotifyConfig KF5::MailTransportAkonadi KF5::KCMUtils KF5::Libkleo KF5::KSieveUi KF5::LibkdepimAkonadi KF5::KIOCore KF5::Contacts KF5::PimTextEdit KF5::MessageViewer KF5::SendLater KF5::FollowupReminder KF5::IconThemes KF5::XmlGui KF5::Completion KF5::Ldap KF5::AkonadiSearchDebug KF5::AkonadiSearchPIM KF5::WebEngineViewer KF5::SyntaxHighlighting ) target_include_directories(kmailprivate PUBLIC $) target_include_directories(kmailprivate PUBLIC $) target_include_directories(kmailprivate PUBLIC $) set_target_properties(kmailprivate PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION} ) ########### kcm_kmail ############### set(kcm_kmail_PART_SRCS kcm_kmail.cpp ) add_library(kcm_kmail MODULE ${kcm_kmail_PART_SRCS}) target_link_libraries(kcm_kmail kmailprivate KF5::KCMUtils KF5::Completion KF5::I18n KF5::TextWidgets) ########### kmailpart ############### set(kmailpart_PART_SRCS kmail_part.cpp ${kmail_common_SRCS}) qt5_generate_dbus_interface(kmail_part.h org.kde.kmail.kmailpart.xml OPTIONS -a) qt5_add_dbus_adaptor(kmailpart_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml kmail_part.h KMailPart ) qt5_add_dbus_interfaces(kmailpart_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml) add_library(kmailpart MODULE ${kmailpart_PART_SRCS}) target_link_libraries(kmailpart kmailprivate KF5::PimCommon KF5::LibkdepimAkonadi KF5::KCMUtils KF5::Parts KF5::IconThemes KF5::TemplateParser ) ########### KMail executable ############### set(kmail_SRCS main.cpp ${kmail_common_SRCS}) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kmail.png") ecm_add_app_icon(kmail_SRCS ICONS ${ICONS_SRCS}) add_executable(kmail ${kmail_SRCS}) target_link_libraries(kmail KF5::KontactInterface kmailprivate KF5::PimCommon KF5::I18n KF5::TemplateParser KF5::Libkdepim KF5::Crash ) if(BUILD_TESTING) add_subdirectory(autotests) add_subdirectory(tests) add_subdirectory(folderarchive/autotests/) add_subdirectory(editor/potentialphishingemail/autotests) add_subdirectory(editor/warningwidgets/autotests) add_subdirectory(sieveimapinterface/tests/) endif() ########### install files ############### install(TARGETS kmailprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) install(TARGETS kmail ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS data/org.kde.kmail2.desktop data/kmail_view.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} ) install(FILES data/org.kde.kmail2.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES data/kmail_config_misc.desktop data/kmail_config_appearance.desktop data/kmail_config_accounts.desktop data/kmail_config_composer.desktop data/kmail_config_security.desktop data/kmail_config_plugins.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} ) install(TARGETS kmailpart kcm_kmail DESTINATION ${KDE_INSTALL_PLUGINDIR} ) install(FILES ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} ) configure_file(data/org.kde.kmail.service.in org.kde.kmail.service) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.service DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}) diff --git a/src/dialog/spellcheckerconfigdialog.cpp b/src/dialog/spellcheckerconfigdialog.cpp new file mode 100644 index 000000000..69d46f66b --- /dev/null +++ b/src/dialog/spellcheckerconfigdialog.cpp @@ -0,0 +1,75 @@ +/* + Copyright (C) 2019 Montel Laurent + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "spellcheckerconfigdialog.h" +#include "kmkernel.h" +#include "kmail_debug.h" +#include +#include + +#include + +#include + +SpellCheckerConfigDialog::SpellCheckerConfigDialog(QWidget *parent) + : Sonnet::ConfigDialog(parent) +{ + // Hackish way to hide the "Enable spell check by default" checkbox + // Our highlighter ignores this setting, so we should not expose its UI + QCheckBox *enabledByDefaultCB = findChild(QStringLiteral("m_checkerEnabledByDefaultCB")); + if (enabledByDefaultCB) { + enabledByDefaultCB->hide(); + } else { + qCWarning(KMAIL_LOG) << "Could not find any checkbox named 'm_checkerEnabledByDefaultCB'. Sonnet::ConfigDialog must have changed!"; + } + QLabel *textLabel = findChild(QStringLiteral("textLabel1")); + if (textLabel) { + textLabel->hide(); + } else { + qCWarning(KMAIL_LOG) << "Could not find any label named 'textLabel'. Sonnet::ConfigDialog must have changed!"; + } + Sonnet::DictionaryComboBox *dictionaryComboBox = findChild(QStringLiteral("m_langCombo")); + if (dictionaryComboBox) { + dictionaryComboBox->hide(); + } else { + qCWarning(KMAIL_LOG) << "Could not find any Sonnet::DictionaryComboBox named 'dictionaryComboBox'. Sonnet::ConfigDialog must have changed!"; + } + readConfig(); +} + +SpellCheckerConfigDialog::~SpellCheckerConfigDialog() +{ + writeConfig(); +} + +void SpellCheckerConfigDialog::readConfig() +{ + KConfigGroup notifyDialog(KMKernel::self()->config(), "KMKnotifyDialog"); + const QSize size = notifyDialog.readEntry("Size", QSize(600, 400)); + if (size.isValid()) { + resize(size); + } +} + +void SpellCheckerConfigDialog::writeConfig() +{ + KConfigGroup notifyDialog(KMKernel::self()->config(), "KMKnotifyDialog"); + notifyDialog.writeEntry("Size", size()); + notifyDialog.sync(); +} diff --git a/src/dialog/spellcheckerconfigdialog.h b/src/dialog/spellcheckerconfigdialog.h new file mode 100644 index 000000000..e8f428e57 --- /dev/null +++ b/src/dialog/spellcheckerconfigdialog.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2019 Montel Laurent + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef SPELLCHECKERCONFIGDIALOG_H +#define SPELLCHECKERCONFIGDIALOG_H + +#include + + +class SpellCheckerConfigDialog : public Sonnet::ConfigDialog +{ + Q_OBJECT +public: + explicit SpellCheckerConfigDialog(QWidget *parent = nullptr); + ~SpellCheckerConfigDialog(); + +private: + void readConfig(); + void writeConfig(); +}; + +#endif // SPELLCHECKERCONFIGDIALOG_H diff --git a/src/editor/kmcomposereditorng.cpp b/src/editor/kmcomposereditorng.cpp index c98c98070..205e9275e 100644 --- a/src/editor/kmcomposereditorng.cpp +++ b/src/editor/kmcomposereditorng.cpp @@ -1,164 +1,145 @@ /* Copyright (c) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "kmcomposereditorng.h" #include "kmcomposerwin.h" #include "kmkernel.h" #include "util.h" #include "kmail_debug.h" #include "job/dndfromarkjob.h" +#include "dialog/spellcheckerconfigdialog.h" #include #include #include #include #include #include #include #include #include namespace { inline QString textSnippetMimeType() { return QStringLiteral("text/x-kmail-textsnippet"); } } KMComposerEditorNg::KMComposerEditorNg(KMComposerWin *win, QWidget *parent) : MessageComposer::RichTextComposerNg(parent) , mComposerWin(win) { setSpellCheckingConfigFileName(QStringLiteral("kmail2rc")); setAutocorrection(KMKernel::self()->composerAutoCorrection()); createHighlighter(); } KMComposerEditorNg::~KMComposerEditorNg() { } void KMComposerEditorNg::addExtraMenuEntry(QMenu *menu, QPoint pos) { Q_UNUSED(pos); const QList lstAct = mComposerWin->pluginToolsActionListForPopupMenu(); for (QAction *a : lstAct) { menu->addSeparator(); menu->addAction(a); } menu->addSeparator(); const QList lstTa = mComposerWin->customToolsList(); for (KToggleAction *ta : lstTa) { menu->addAction(ta); } } bool KMComposerEditorNg::canInsertFromMimeData(const QMimeData *source) const { if (source->hasImage() && source->hasFormat(QStringLiteral("image/png"))) { return true; } if (source->hasFormat(textSnippetMimeType())) { return true; } if (source->hasUrls()) { return true; } if (DndFromArkJob::dndFromArk(source)) { return true; } return MessageComposer::RichTextComposerNg::canInsertFromMimeData(source); } void KMComposerEditorNg::insertFromMimeData(const QMimeData *source) { if (source->hasFormat(textSnippetMimeType())) { Q_EMIT insertSnippet(); return; } if (!mComposerWin->insertFromMimeData(source, false)) { MessageComposer::RichTextComposerNg::insertFromMimeData(source); } } void KMComposerEditorNg::setHighlighterColors(KPIMTextEdit::RichTextComposerEmailQuoteHighlighter *highlighter) { QColor color1 = MessageCore::ColorUtil::self()->quoteLevel1DefaultTextColor(); QColor color2 = MessageCore::ColorUtil::self()->quoteLevel2DefaultTextColor(); QColor color3 = MessageCore::ColorUtil::self()->quoteLevel3DefaultTextColor(); QColor misspelled = MessageCore::ColorUtil::self()->misspelledDefaultTextColor(); if (!MessageCore::MessageCoreSettings::self()->useDefaultColors()) { color1 = MessageCore::MessageCoreSettings::self()->quotedText1(); color2 = MessageCore::MessageCoreSettings::self()->quotedText2(); color3 = MessageCore::MessageCoreSettings::self()->quotedText3(); } highlighter->setQuoteColor(Qt::black /* ignored anyway */, color1, color2, color3, misspelled); } QString KMComposerEditorNg::smartQuote(const QString &msg) { return mComposerWin->smartQuote(msg); } void KMComposerEditorNg::showSpellConfigDialog(const QString &configFileName) { Q_UNUSED(configFileName); - QPointer dialog = new Sonnet::ConfigDialog(this); + QPointer dialog = new SpellCheckerConfigDialog(this); if (!spellCheckingLanguage().isEmpty()) { dialog->setLanguage(spellCheckingLanguage()); } - // Hackish way to hide the "Enable spell check by default" checkbox - // Our highlighter ignores this setting, so we should not expose its UI - QCheckBox *enabledByDefaultCB = dialog->findChild(QStringLiteral("m_checkerEnabledByDefaultCB")); - if (enabledByDefaultCB) { - enabledByDefaultCB->hide(); - } else { - qCWarning(KMAIL_LOG) << "Could not find any checkbox named 'm_checkerEnabledByDefaultCB'. Sonnet::ConfigDialog must have changed!"; - } - QLabel *textLabel = dialog->findChild(QStringLiteral("textLabel1")); - if (textLabel) { - textLabel->hide(); - } else { - qCWarning(KMAIL_LOG) << "Could not find any label named 'textLabel'. Sonnet::ConfigDialog must have changed!"; - } - Sonnet::DictionaryComboBox *dictionaryComboBox = dialog->findChild(QStringLiteral("m_langCombo")); - if (dictionaryComboBox) { - dictionaryComboBox->hide(); - } else { - qCWarning(KMAIL_LOG) << "Could not find any Sonnet::DictionaryComboBox named 'dictionaryComboBox'. Sonnet::ConfigDialog must have changed!"; - } if (dialog->exec()) { setSpellCheckingLanguage(dialog->language()); } delete dialog; } MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus KMComposerEditorNg::convertPlainText(MessageComposer::TextPart *textPart) { if (mComposerWin->convertPlainText(textPart) == MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::Converted) { return MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::Converted; } return MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::NotConverted; }