From 1f77e1c810ad8b47cb40cb59e52b01fe534652b7 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 6 Nov 2022 01:06:01 +0100 Subject: Prompt before deleting the database --- src/ChatPage.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/ChatPage.cpp') diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index f87c2738..8edaa1cf 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -378,6 +378,20 @@ ChatPage::dropToLoginPage(const QString &msg) http::client()->shutdown(); connectivityTimer_.stop(); + auto btn = QMessageBox::warning( + nullptr, + tr("Confirm logout"), + tr("Because of the following reason Nheko wants to drop you to the login page:\n%1\nIf you " + "think this is a mistake, you can close Nheko instead to possibly recover your encrpytion " + "keys. After you have been dropped to the login page, you can sign in again using your " + "usual methods."), + QMessageBox::StandardButton::Close | QMessageBox::StandardButton::Ok, + QMessageBox::StandardButton::Ok); + if (btn == QMessageBox::StandardButton::Close) { + QCoreApplication::exit(1); + exit(1); + } + resetUI(); deleteConfigs(); -- cgit 1.5.1