Commit f0fda6c4 authored by Laurent Montel's avatar Laurent Montel
Browse files

Adapt to new api (scripted)

parent df943c4b
Pipeline #248513 passed with stage
in 1 minute and 3 seconds
......@@ -35,6 +35,7 @@
#include <QPushButton>
#include <QResizeEvent>
#include <QVBoxLayout>
#include <kwidgetsaddons_version.h>
class TextDialog : public QDialog
{
......@@ -194,7 +195,12 @@ void AgentWidget::removeAgent()
{
const AgentInstance::List list = ui.instanceWidget->selectedAgentInstances();
if (!list.isEmpty()) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(
#else
if (KMessageBox::questionYesNo(
#endif
this,
i18np("Do you really want to delete the selected agent instance?", "Do you really want to delete these %1 agent instances?", list.size()),
list.size() == 1 ? QStringLiteral("Agent Deletion") : QStringLiteral("Multiple Agent Deletion"),
......@@ -202,7 +208,11 @@ void AgentWidget::removeAgent()
KStandardGuiItem::cancel(),
QString(),
KMessageBox::Dangerous)
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
== KMessageBox::ButtonCode::PrimaryAction) {
#else
== KMessageBox::Yes) {
#endif
for (const AgentInstance &agent : list) {
AgentManager::self()->removeInstance(agent);
}
......
......@@ -68,6 +68,7 @@
#include <Akonadi/ContactViewer>
#include <CalendarSupport/IncidenceViewer>
#include <MessageViewer/Viewer>
#include <kwidgetsaddons_version.h>
#endif
using namespace Akonadi;
......@@ -615,14 +616,23 @@ void BrowserWidget::tagViewDoubleClicked(const QModelIndex &index)
void BrowserWidget::removeTagRequested()
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(this,
#else
if (KMessageBox::questionYesNo(this,
QStringLiteral("Do you really want to remove selected tag?"),
QStringLiteral("Delete tag?"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel(),
QString(),
KMessageBox::Dangerous)
#endif
QStringLiteral("Do you really want to remove selected tag?"),
QStringLiteral("Delete tag?"),
KStandardGuiItem::del(),
KStandardGuiItem::cancel(),
QString(),
KMessageBox::Dangerous)
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
== KMessageBox::ButtonCode::SecondaryAction) {
#else
== KMessageBox::No) {
#endif
return;
}
......
Supports Markdown
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