summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-03-24 15:11:14 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-04-08 20:17:23 (GMT)
commitfe477c0da80c2e5799a1841ce7fcf4e023ad57bb (patch)
tree6aedfd75c47c64dee7fcf282e84ebafb6722c65d /Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
parent36eaae275b39340f44d8225a73ea129bc0c47464 (diff)
downloadswift-fe477c0da80c2e5799a1841ce7fcf4e023ad57bb.zip
swift-fe477c0da80c2e5799a1841ce7fcf4e023ad57bb.tar.bz2
'Add contact' from MUC right-click menu
This patch allows to add a contact from a MUC, by right clicking a contact in the rooster. The action is only available if the JID of the user is also available License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchWindow.cpp')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 949d65c..b8a44e5 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -236,6 +236,15 @@ void QtUserSearchWindow::setNameSuggestions(const std::vector<std::string>& sugg
}
}
+void QtUserSearchWindow::prepopulateJIDAndName(const JID& jid, const std::string& name) {
+ firstPage_->jid_->setText(P2QSTRING(jid.toBare().toString()));
+ detailsPage_->setJID(jid);
+ lastPage_ = 1;
+ restart();
+ next();
+ detailsPage_->setName(name);
+}
+
void QtUserSearchWindow::setResults(const std::vector<UserSearchResult>& results) {
UserSearchModel *newModel = new UserSearchModel();
newModel->setResults(results);