From 99a4559973559a82fd844113fe2bd7ef9676d2de Mon Sep 17 00:00:00 2001 From: nowrep Date: Sun, 29 Dec 2013 11:59:30 +0100 Subject: [PATCH] [ClearPrivateData] Ask user before actually deleting data. --- src/lib/other/clearprivatedata.cpp | 8 ++++++++ src/lib/other/clearprivatedata.ui | 16 ---------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/lib/other/clearprivatedata.cpp b/src/lib/other/clearprivatedata.cpp index 838af3b16..dc21484d1 100644 --- a/src/lib/other/clearprivatedata.cpp +++ b/src/lib/other/clearprivatedata.cpp @@ -104,6 +104,14 @@ void ClearPrivateData::closeEvent(QCloseEvent* e) void ClearPrivateData::dialogAccepted() { + QMessageBox::StandardButton b = QMessageBox::question(this, tr("Clear Private Data"), + tr("Are you sure to clear selected private data?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + + if (b != QMessageBox::Yes) { + return; + } + QApplication::setOverrideCursor(Qt::WaitCursor); if (ui->history->isChecked()) { diff --git a/src/lib/other/clearprivatedata.ui b/src/lib/other/clearprivatedata.ui index 1c4b428d9..d340896bc 100644 --- a/src/lib/other/clearprivatedata.ui +++ b/src/lib/other/clearprivatedata.ui @@ -190,22 +190,6 @@ - - buttonBox - accepted() - ClearPrivateData - accept() - - - 248 - 254 - - - 157 - 274 - - - buttonBox rejected()