From 8f8371f148bf5c90c3c45cdd06c3fdcc5d2f4ef5 Mon Sep 17 00:00:00 2001 From: Gleb Petrovicev Date: Sun, 13 Oct 2024 14:11:38 +0200 Subject: [PATCH] Added a confirmation message box before forgetting a room --- client/roomlistdock.cpp | 13 ++++++---- client/translations/quaternion_en.ts | 36 ++++++++++++++++++---------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/client/roomlistdock.cpp b/client/roomlistdock.cpp index 0520ae7b..e7c8fc51 100644 --- a/client/roomlistdock.cpp +++ b/client/roomlistdock.cpp @@ -11,6 +11,7 @@ #include "logging_categories.h" #include +#include #include #include #include @@ -194,10 +195,14 @@ RoomListDock::RoomListDock(MainWindow* parent) forgetAction = roomContextMenu->addAction(QIcon::fromTheme("irc-remove-operator"), tr("Forget room"), this, [this] { - if (auto room = getSelectedRoom()) - { - Q_ASSERT(room->connection()); - room->connection()->forgetRoom(room->id()); + if (auto room = getSelectedRoom()) { + QMessageBox::StandardButton confirmation = QMessageBox::question( + this, tr("Forget this room?"), + tr("Are you sure you want to forget room %1?").arg(room->name())); + if (confirmation == QMessageBox::Yes) { + Q_ASSERT(room->connection()); + room->connection()->forgetRoom(room->id()); + } } }); diff --git a/client/translations/quaternion_en.ts b/client/translations/quaternion_en.ts index 9394cc3e..8f35e718 100644 --- a/client/translations/quaternion_en.ts +++ b/client/translations/quaternion_en.ts @@ -1656,68 +1656,78 @@ or alias (starting with #) RoomListDock - + Mark room as read Mark room as read - + Add tags... Add tags... - + Change room &settings... Change room &settings... - + Copy room link to clipboard Copy room link to clipboard - + Join room Join room - + Forget room Forget room - + + Forget this room? + + + + + Are you sure you want to forget room %1? + + + + Remove tag Remove tag - + Reject invitation Reject invitation - + Leave room Leave room - + Enter new tags for the room Enter new tags for the room - + Add A caption on a button to add tags Add - + Enter tags to add to this room, one tag per line Enter tags to add to this room, one tag per line - + Rooms (%L1) Rooms (%L1)