Skip to content

Commit

Permalink
feat: add confirmation box before forgetting a room
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdeop committed Mar 18, 2018
1 parent 45b50fc commit 4e29f50
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions client/roomlistdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QtWidgets/QMenu>
#include <QtWidgets/QStyledItemDelegate>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QMessageBox>

#include "models/roomlistmodel.h"
#include "quaternionroom.h"
Expand Down Expand Up @@ -181,8 +182,16 @@ void RoomListDock::menuLeaveSelected()

void RoomListDock::menuForgetSelected()
{
if (auto room = getSelectedRoom())
room->connection()->forgetRoom(room->id());
if (auto room = getSelectedRoom()) {
QMessageBox confirmBox(QMessageBox::Question,
tr("Are you sure?"),
tr("Do you want to forget the room %1").arg(room->displayName()),
QMessageBox::Yes|QMessageBox::No, this);
if (confirmBox.exec() == QMessageBox::No)
;
else
room->connection()->forgetRoom(room->id());
}
}

void RoomListDock::menuMarkReadSelected()
Expand Down

0 comments on commit 4e29f50

Please sign in to comment.