Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a confirmation message box before forgetting a room #907

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions client/roomlistdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "logging_categories.h"

#include <QtWidgets/QMenu>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QStyledItemDelegate>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPlainTextEdit>
Expand Down Expand Up @@ -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());
}
}
});

Expand Down
36 changes: 23 additions & 13 deletions client/translations/quaternion_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1656,68 +1656,78 @@ or alias (starting with #)</translation>
<context>
<name>RoomListDock</name>
<message>
<location filename="../roomlistdock.cpp" line="160"/>
<location filename="../roomlistdock.cpp" line="161"/>
<source>Mark room as read</source>
<translation>Mark room as read</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="167"/>
<location filename="../roomlistdock.cpp" line="168"/>
<source>Add tags...</source>
<translation>Add tags...</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="170"/>
<location filename="../roomlistdock.cpp" line="171"/>
<source>Change room &amp;settings...</source>
<translation>Change room &amp;settings...</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="173"/>
<location filename="../roomlistdock.cpp" line="174"/>
<source>Copy room link to clipboard</source>
<translation>Copy room link to clipboard</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="180"/>
<location filename="../roomlistdock.cpp" line="181"/>
<source>Join room</source>
<translation>Join room</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="196"/>
<location filename="../roomlistdock.cpp" line="197"/>
<source>Forget room</source>
<translation>Forget room</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="207"/>
<location filename="../roomlistdock.cpp" line="200"/>
<source>Forget this room?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="201"/>
<source>Are you sure you want to forget room %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="212"/>
<source>Remove tag</source>
<translation>Remove tag</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="283"/>
<location filename="../roomlistdock.cpp" line="288"/>
<source>Reject invitation</source>
<translation>Reject invitation</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="283"/>
<location filename="../roomlistdock.cpp" line="288"/>
<source>Leave room</source>
<translation>Leave room</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="308"/>
<location filename="../roomlistdock.cpp" line="313"/>
<source>Enter new tags for the room</source>
<translation>Enter new tags for the room</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="309"/>
<location filename="../roomlistdock.cpp" line="314"/>
<source>Add</source>
<comment>A caption on a button to add tags</comment>
<translation>Add</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="312"/>
<location filename="../roomlistdock.cpp" line="317"/>
<source>Enter tags to add to this room, one tag per line</source>
<translation>Enter tags to add to this room, one tag per line</translation>
</message>
<message>
<location filename="../roomlistdock.cpp" line="331"/>
<location filename="../roomlistdock.cpp" line="336"/>
<source>Rooms (%L1)</source>
<translation>Rooms (%L1)</translation>
</message>
Expand Down