summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-11-06 01:06:01 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-11-06 01:06:41 +0100
commit1f77e1c810ad8b47cb40cb59e52b01fe534652b7 (patch)
tree6e780523096afb3da0b814ec5434149d677ebb17 /src
parentMerge pull request #1223 from Nheko-Reborn/dbusVersion (diff)
downloadnheko-1f77e1c810ad8b47cb40cb59e52b01fe534652b7.tar.xz
Prompt before deleting the database
Diffstat (limited to 'src')
-rw-r--r--src/Cache.cpp3
-rw-r--r--src/ChatPage.cpp14
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index b577f201..09e3fe5c 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -361,7 +361,8 @@ fatalSecretError() "have multiple reasons. Check if your D-Bus service is running and you have configured a " "service like KWallet, Gnome Keyring, KeePassXC or the equivalent for your platform. If " "you are having trouble, feel free to open an issue here: " - "https://github.com/Nheko-Reborn/nheko/issues")); + "https://github.com/Nheko-Reborn/nheko/issues"), + QMessageBox::StandardButton::Close); QCoreApplication::exit(1); exit(1); 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();