Commit 6dad1030 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Use KMessageBox instead of QMessageBox

This allow us to use the "don't show again" thingy
parent 6a892085
......@@ -33,6 +33,8 @@
#include <QRegularExpressionValidator>
#include <QSortFilterProxyModel>
#include <KMessageBox>
struct SSHManagerTreeWidget::Private {
SSHManagerModel *model = nullptr;
SSHManagerFilterModel *filterModel = nullptr;
......@@ -161,9 +163,19 @@ void SSHManagerTreeWidget::triggerRemove()
: "You are about to remove %1, are you sure?")
.arg(selection.at(0).data(Qt::DisplayRole).toString());
int result = QMessageBox::warning(this, i18n("Remove SSH Configurations"), dialogMessage, QMessageBox::Ok, QMessageBox::Cancel);
const QString dontShorAgainKey =
ui->treeView->model()->rowCount(selection.at(0)) ? QStringLiteral("remove_ssh_folder") : QStringLiteral("remove_ssh_config");
KMessageBox::ButtonCode result = KMessageBox::messageBox(this,
KMessageBox::DialogType::WarningYesNo,
i18n("Remove SSH Configurations"),
i18n("Remove SSH Configurations"),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KStandardGuiItem::cancel(),
dontShorAgainKey);
if (result == QMessageBox::Cancel) {
if (result == KMessageBox::ButtonCode::No) {
return;
}
......
Markdown is supported
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