#include <KWindowSystem>
#include <KXMLGUIFactory>
+#include <kwidgetsaddons_version.h>
#include <kio_version.h>
#include <QApplication>
if (urls.count() > 5) {
QString question = i18np("Are you sure you want to open 1 terminal window?",
"Are you sure you want to open %1 terminal windows?", urls.count());
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ const int answer = KMessageBox::warningTwoActions(this, question, {},
+#else
const int answer = KMessageBox::warningYesNo(this, question, {},
+#endif
KGuiItem(i18ncp("@action:button", "Open %1 Terminal", "Open %1 Terminals", urls.count()),
QStringLiteral("utilities-terminal")),
KStandardGuiItem::cancel());
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (answer != KMessageBox::PrimaryAction) {
+#else
if (answer != KMessageBox::Yes) {
+#endif
return;
}
}
#include <kio_version.h>
#include <kiocore_export.h>
#include <kservice_export.h>
+#include <kwidgetsaddons_version.h>
#include <QtGlobal>
#include <KNSWidgets/Button>
VersionControlSettings::self()->save();
if (!laterSelected) {
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ KMessageBox::ButtonCode promptRestart = KMessageBox::questionTwoActions(window(),
+#else
KMessageBox::ButtonCode promptRestart = KMessageBox::questionYesNo(window(),
+#endif
i18nc("@info", "Dolphin must be restarted to apply the "
"updated version control system settings."),
i18nc("@info", "Restart now?"),
KGuiItem(QApplication::translate("KStandardGuiItem", "&Restart"), QStringLiteral("dialog-restart")),
KGuiItem(QApplication::translate("KStandardGuiItem", "&Later"), QStringLiteral("dialog-later"))
);
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (promptRestart == KMessageBox::ButtonCode::PrimaryAction) {
+#else
if (promptRestart == KMessageBox::ButtonCode::Yes) {
+#endif
Dolphin::openNewWindow();
qApp->quit();
} else {
#include <KWindowConfig>
#include <KMessageBox>
+#include <kwidgetsaddons_version.h>
+
#include <QCloseEvent>
#include <QPushButton>
return;
}
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ const auto response = KMessageBox::warningTwoActionsCancel(this,
+#else
const auto response = KMessageBox::warningYesNoCancel(this,
+#endif
i18n("You have unsaved changes. Do you want to apply the changes or discard them?"),
i18n("Warning"),
KStandardGuiItem::save(),
KStandardGuiItem::discard(),
KStandardGuiItem::cancel());
switch (response) {
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ case KMessageBox::PrimaryAction:
+#else
case KMessageBox::Yes:
+#endif
applySettings();
Q_FALLTHROUGH();
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ case KMessageBox::SecondaryAction:
+#else
case KMessageBox::No:
+#endif
event->accept();
break;
case KMessageBox::Cancel:
#include <KMessageBox>
#include <KWindowConfig>
+#include <kwidgetsaddons_version.h>
+
#if HAVE_BALOO
#include <Baloo/IndexerConfig>
#endif
const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
if (applyToSubFolders) {
const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (KMessageBox::questionTwoActions(this, text, {},
+ KStandardGuiItem::cont(),
+ KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) {
+#else
if (KMessageBox::questionYesNo(this, text, {},
KStandardGuiItem::cont(),
KStandardGuiItem::cancel()) == KMessageBox::No) {
+#endif
return;
}
if (applyToAllFolders) {
const QString text(i18nc("@info", "The view properties of all folders will be changed. Do you want to continue?"));
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (KMessageBox::questionTwoActions(this, text, {},
+ KStandardGuiItem::cont(),
+ KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) {
+#else
if (KMessageBox::questionYesNo(this, text, {},
KStandardGuiItem::cont(),
KStandardGuiItem::cancel()) == KMessageBox::No) {
+#endif
return;
}
#include <KProtocolManager>
#include <KUrlMimeData>
+#include <kwidgetsaddons_version.h>
+
#include <QAbstractItemView>
#include <QActionGroup>
#include <QApplication>
if (indexes.count() > 5) {
QString question = i18np("Are you sure you want to open 1 item?", "Are you sure you want to open %1 items?", indexes.count());
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ const int answer = KMessageBox::warningTwoActions(this, question, {},
+#else
const int answer = KMessageBox::warningYesNo(this, question, {},
+#endif
KGuiItem(i18ncp("@action:button", "Open %1 Item", "Open %1 Items", indexes.count()),
QStringLiteral("document-open")),
KStandardGuiItem::cancel());
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (answer != KMessageBox::PrimaryAction) {
+#else
if (answer != KMessageBox::Yes) {
+#endif
return;
}
}
KGuiItem yesGuiItem(KStandardGuiItem::yes());
yesGuiItem.setText(i18nc("@action:button", "Rename and Hide"));
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ const auto code = KMessageBox::questionTwoActions(this,
+#else
const auto code = KMessageBox::questionYesNo(this,
+#endif
oldItem.isFile() ? i18n("Adding a dot to the beginning of this file's name will hide it from view.\n"
"Do you still want to rename it?")
: i18n("Adding a dot to the beginning of this folder's name will hide it from view.\n"
QStringLiteral("ConfirmHide")
);
+#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ if (code == KMessageBox::SecondaryAction) {
+#else
if (code == KMessageBox::No) {
+#endif
return;
}
}