summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/UserSearch')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchDetailsPage.cpp4
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h1
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp9
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.h1
4 files changed, 15 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.cpp b/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.cpp
index da89a8d..f4189e7 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.cpp
@@ -36,6 +36,10 @@ void QtUserSearchDetailsPage::setNameSuggestions(const std::vector<std::string>&
editWidget->setNameSuggestions(nameSuggestions);
}
+void QtUserSearchDetailsPage::setName(const std::string& name) {
+ editWidget->setName(name);
+}
+
std::set<std::string> QtUserSearchDetailsPage::getSelectedGroups() {
return editWidget->getSelectedGroups();
}
diff --git a/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h b/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h
index 9409493..63fd241 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h
+++ b/Swift/QtUI/UserSearch/QtUserSearchDetailsPage.h
@@ -27,6 +27,7 @@ namespace Swift {
void setJID(const JID& jid);
void setNameSuggestions(const std::vector<std::string>& nameSuggestions);
+ void setName(const std::string& name);
std::set<std::string> getSelectedGroups();
std::string getName();
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);
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.h b/Swift/QtUI/UserSearch/QtUserSearchWindow.h
index 9173ba9..32e851a 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.h
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.h
@@ -40,6 +40,7 @@ namespace Swift {
virtual void setSearchError(bool error);
virtual void setSearchFields(boost::shared_ptr<SearchPayload> fields);
virtual void setNameSuggestions(const std::vector<std::string>& suggestions);
+ virtual void prepopulateJIDAndName(const JID& jid, const std::string& name);
protected:
virtual int nextId() const;