From bc8aac1ca64c9effb31a321b643a85d5041898ea Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 2 Feb 2017 17:15:32 +0100 Subject: [PATCH] Added warn messagebox before send invite --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 10 +++++++--- retroshare-gui/src/gui/feeds/MsgItem.cpp | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 239a6b592..eda2290f2 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2463,10 +2463,14 @@ void IdDialog::sendInvite() RsGxsId id(ui->lineEdit_KeyId->text().toStdString()); - MessageComposer::sendInvite(id); + if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) + { + MessageComposer::sendInvite(id); + ui->inviteFrame->show(); + ui->inviteButton->setEnabled(false); + } - ui->inviteFrame->show(); - ui->inviteButton->setEnabled(false); + } void IdDialog::negativePerson() diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 21ecdb321..9c219eb77 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -19,6 +19,7 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ +#include #include #include @@ -365,7 +366,9 @@ void MsgItem::sendInvite() if (!rsMail->getMessage(mMsgId, mi)) return; - - MessageComposer::sendInvite(mi.rsgxsid_srcId); + if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) + { + MessageComposer::sendInvite(mi.rsgxsid_srcId); + } }