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
Education
KmPlot
Commits
4f8805f8
Commit
4f8805f8
authored
Oct 17, 2022
by
Nicolas Fella
Browse files
Port away from deprecated KMessageBox API
parent
7ea5c2b2
Pipeline
#249681
passed with stage
in 4 minutes and 13 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
kmplot/kparametereditor.cpp
View file @
4f8805f8
...
...
@@ -27,6 +27,7 @@
#include
<KIO/StoredTransferJob>
#include
<KJobWidgets>
#include
<KMessageBox>
#include
<kwidgetsaddons_version.h>
#include
"maindlg.h"
...
...
@@ -245,12 +246,20 @@ void KParameterEditor::cmdImport_clicked()
file
.
close
();
QFile
::
remove
(
file
.
fileName
());
return
;
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 100, 0)
}
else
if
(
KMessageBox
::
warningYesNo
(
this
,
#else
}
else
if
(
KMessageBox
::
warningTwoActions
(
this
,
#endif
i18n
(
"Would you like to be informed about other lines that cannot be read?"
),
QString
(),
KGuiItem
(
i18n
(
"Get Informed"
)),
KGuiItem
(
i18n
(
"Ignore Information"
)))
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 100, 0)
==
KMessageBox
::
No
)
#else
==
KMessageBox
::
SecondaryAction
)
#endif
verbose
=
true
;
}
}
...
...
kmplot/maindlg.cpp
View file @
4f8805f8
...
...
@@ -40,6 +40,7 @@
#include
<KMessageBox>
#include
<KStandardAction>
#include
<KToolBar>
#include
<kwidgetsaddons_version.h>
// local includes
#include
"calculator.h"
...
...
@@ -456,14 +457,22 @@ void MainDlg::resetUndoRedo()
bool
MainDlg
::
checkModified
()
{
if
(
m_modified
)
{
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 100, 0)
int
saveit
=
KMessageBox
::
warningYesNoCancel
(
m_parent
,
#else
int
saveit
=
KMessageBox
::
warningTwoActionsCancel
(
m_parent
,
#endif
i18n
(
"The plot has been modified.
\n
"
"Do you want to save it?"
),
QString
(),
KStandardGuiItem
::
save
(),
KStandardGuiItem
::
discard
());
switch
(
saveit
)
{
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 100, 0)
case
KMessageBox
::
Yes
:
#else
case
KMessageBox
::
PrimaryAction
:
#endif
slotSave
();
if
(
m_modified
)
// the user didn't saved the file
return
false
;
...
...
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