summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-21 20:46:55 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-21 20:46:55 (GMT)
commit811aa9951613990956ad9027f4b969c8886b1123 (patch)
tree0b2c5628cc64796a68f2e2008d81290a59fdd687 /Swift/QtUI/QtContactEditWindow.cpp
parentba81a3d454db0abd0b8e00a34a9da3b720af454f (diff)
downloadswift-811aa9951613990956ad9027f4b969c8886b1123.zip
swift-811aa9951613990956ad9027f4b969c8886b1123.tar.bz2
Added "Remove" context menu.
Resolves: #768
Diffstat (limited to 'Swift/QtUI/QtContactEditWindow.cpp')
-rw-r--r--Swift/QtUI/QtContactEditWindow.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Swift/QtUI/QtContactEditWindow.cpp b/Swift/QtUI/QtContactEditWindow.cpp
index 543d39a..5affaef 100644
--- a/Swift/QtUI/QtContactEditWindow.cpp
+++ b/Swift/QtUI/QtContactEditWindow.cpp
@@ -72,16 +72,19 @@ void QtContactEditWindow::hide() {
}
void QtContactEditWindow::handleRemoveContact() {
+ if (confirmContactDeletion(jid_)) {
+ onRemoveContactRequest();
+ }
+}
+
+bool QtContactEditWindow::confirmContactDeletion(const JID& jid) {
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Confirm contact deletion"));
msgBox.setText(tr("Are you sure you want to delete this contact?"));
- msgBox.setInformativeText(QString(tr("This will remove the contact '%1' from all groups they may be in.")).arg(P2QSTRING(jid_.toString())));
+ msgBox.setInformativeText(QString(tr("This will remove the contact '%1' from all groups they may be in.")).arg(P2QSTRING(jid.toString())));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
- int ret = msgBox.exec();
- if (ret == QMessageBox::Yes) {
- onRemoveContactRequest();
- }
+ return msgBox.exec() == QMessageBox::Yes;
}
void QtContactEditWindow::handleUpdateContact() {