Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
51d8d92c
Commit
51d8d92c
authored
Oct 15, 2022
by
Laurent Montel
Browse files
Adapt to new api (scripted)
parent
0e2afa42
Pipeline
#248493
failed with stage
in 8 minutes and 18 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/composer-ng/richtextexternalcomposer.cpp
View file @
51d8d92c
...
...
@@ -13,6 +13,7 @@
#include
<KProcess>
#include
<KShell>
#include
<QTemporaryFile>
#include
<kwidgetsaddons_version.h>
using
namespace
KPIMTextEdit
;
...
...
@@ -152,21 +153,33 @@ bool RichTextExternalComposer::checkExternalEditorFinished()
return
true
;
}
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
ret
=
KMessageBox
::
warningTwoActionsCancel
(
d
->
richTextComposer
,
#else
const
int
ret
=
KMessageBox
::
warningYesNoCancel
(
d
->
richTextComposer
,
xi18nc
(
"@info"
,
"The external editor is still running.<nl/>"
"Do you want to stop the editor or keep it running?<nl/>"
"<warning>Stopping the editor will cause all your "
"unsaved changes to be lost.</warning>"
),
i18nc
(
"@title:window"
,
"External Editor Running"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Stop Editor"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Keep Editor Running"
)));
#endif
xi18nc
(
"@info"
,
"The external editor is still running.<nl/>"
"Do you want to stop the editor or keep it running?<nl/>"
"<warning>Stopping the editor will cause all your "
"unsaved changes to be lost.</warning>"
),
i18nc
(
"@title:window"
,
"External Editor Running"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Stop Editor"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Keep Editor Running"
)));
switch
(
ret
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
case
KMessageBox
::
ButtonCode
::
PrimaryAction
:
#else
case
KMessageBox
::
Yes
:
#endif
killExternalEditor
();
return
true
;
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
case
KMessageBox
::
ButtonCode
::
SecondaryAction
:
#else
case
KMessageBox
::
No
:
#endif
return
true
;
default:
return
false
;
...
...
src/texteditor/richtexteditor/richtexteditor.cpp
View file @
51d8d92c
...
...
@@ -41,6 +41,7 @@
#include
<QScrollBar>
#include
<QTextCursor>
#include
<QTextDocumentFragment>
#include
<kwidgetsaddons_version.h>
using
namespace
KPIMTextEdit
;
class
Q_DECL_HIDDEN
RichTextEditor
::
RichTextEditorPrivate
...
...
@@ -456,12 +457,20 @@ void RichTextEditor::checkSpelling(bool force)
auto
backgroundSpellCheck
=
new
Sonnet
::
BackgroundChecker
;
if
(
backgroundSpellCheck
->
speller
().
availableBackends
().
isEmpty
())
{
if
(
force
)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
const
int
answer
=
KMessageBox
::
questionTwoActions
(
this
,
#else
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"No backend available for spell checking. Do you want to send the email anyways?"
),
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Send"
),
QStringLiteral
(
"mail-send"
)),
KStandardGuiItem
::
cancel
());
#endif
i18n
(
"No backend available for spell checking. Do you want to send the email anyways?"
),
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Send"
),
QStringLiteral
(
"mail-send"
)),
KStandardGuiItem
::
cancel
());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if
(
answer
==
KMessageBox
::
ButtonCode
::
PrimaryAction
)
{
#else
if
(
answer
==
KMessageBox
::
Yes
)
{
#endif
Q_EMIT
spellCheckingFinished
();
}
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment