From e958f99609ed33ffe340d42b49c2781c84b81aab Mon Sep 17 00:00:00 2001 From: PKEv Date: Sun, 28 Jun 2015 22:54:00 +0300 Subject: [PATCH] Add way to delete whole history #1871 --- src/widget/form/settings/privacyform.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/widget/form/settings/privacyform.cpp b/src/widget/form/settings/privacyform.cpp index 5eefcc87a..fca8d1c12 100644 --- a/src/widget/form/settings/privacyform.cpp +++ b/src/widget/form/settings/privacyform.cpp @@ -57,6 +57,19 @@ void PrivacyForm::onEnableLoggingUpdated() Settings::getInstance().setEnableLogging(bodyUI->cbKeepHistory->isChecked()); HistoryKeeper::resetInstance(); Widget::getInstance()->clearAllReceipts(); + if (!bodyUI->cbKeepHistory->isChecked()) + { + QMessageBox::StandardButton dialogDelHistory; + dialogDelHistory = QMessageBox::question(0, tr("Confirmation"), tr("Do you want to permanently delete all chat history?"), + QMessageBox::Yes|QMessageBox::No); + if (dialogDelHistory == QMessageBox::Yes) + { + if (!HistoryKeeper::removeHistory()) + { + QMessageBox::critical(0, tr("Error"), tr("Could not delete chat history"), QMessageBox::Ok); + } + } + } } void PrivacyForm::onTypingNotificationEnabledUpdated()