summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateravatarpicker.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-30 14:09:50 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-30 14:09:50 +0300
commit198cd4df09d4d6aa9c5bbb6be9c4395d134f9f13 (patch)
treed4b87f39ab6353138594ca153ddadd5b217def00 /indra/newview/llfloateravatarpicker.cpp
parente161b128c7eac6df63b6d9210f3bca6c3cbc77ea (diff)
parentc7053a6928fd5eafdc935453742e92951ae4e0c1 (diff)
Merge branch 'main' into DRTVWR-567
# Conflicts: # indra/newview/llinventoryfunctions.cpp # indra/newview/llpanelmaininventory.h # indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml # indra/newview/skins/default/xui/en/sidepanel_item_info.xml
Diffstat (limited to 'indra/newview/llfloateravatarpicker.cpp')
-rw-r--r--indra/newview/llfloateravatarpicker.cpp131
1 files changed, 72 insertions, 59 deletions
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 0186c4aebe..2422596f60 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -428,13 +428,18 @@ void LLFloaterAvatarPicker::findCoro(std::string url, LLUUID queryID, std::strin
if (status || (status == LLCore::HttpStatus(HTTP_BAD_REQUEST)))
{
- LLFloaterAvatarPicker* floater =
- LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", name);
- if (floater)
- {
- result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
- floater->processResponse(queryID, result);
- }
+ result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
+ }
+ else
+ {
+ result["failure_reason"] = status.toString();
+ }
+
+ LLFloaterAvatarPicker* floater =
+ LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", name);
+ if (floater)
+ {
+ floater->processResponse(queryID, result);
}
}
@@ -672,59 +677,67 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
{
LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("SearchResults");
- LLSD agents = content["agents"];
-
- // clear "Searching" label on first results
- search_results->deleteAllItems();
-
- LLSD item;
- LLSD::array_const_iterator it = agents.beginArray();
- for ( ; it != agents.endArray(); ++it)
- {
- const LLSD& row = *it;
- if (row["id"].asUUID() != gAgent.getID() || !mExcludeAgentFromSearchResults)
- {
- item["id"] = row["id"];
- LLSD& columns = item["columns"];
- columns[0]["column"] = "name";
- columns[0]["value"] = row["display_name"];
- columns[1]["column"] = "username";
- columns[1]["value"] = row["username"];
- search_results->addElement(item);
-
- // add the avatar name to our list
- LLAvatarName avatar_name;
- avatar_name.fromLLSD(row);
- sAvatarNameMap[row["id"].asUUID()] = avatar_name;
- }
- }
+ // clear "Searching" label on first results
+ search_results->deleteAllItems();
- if (search_results->isEmpty())
- {
- std::string name = "'" + getChild<LLUICtrl>("Edit")->getValue().asString() + "'";
- LLSD item;
- item["id"] = LLUUID::null;
- item["columns"][0]["column"] = "name";
- item["columns"][0]["value"] = name;
- item["columns"][1]["column"] = "username";
- item["columns"][1]["value"] = getString("not_found_text");
- search_results->addElement(item);
- search_results->setEnabled(false);
- getChildView("ok_btn")->setEnabled(false);
- }
- else
- {
- getChildView("ok_btn")->setEnabled(true);
- search_results->setEnabled(true);
- search_results->sortByColumnIndex(1, TRUE);
- std::string text = getChild<LLUICtrl>("Edit")->getValue().asString();
- if (!search_results->selectItemByLabel(text, TRUE, 1))
- {
- search_results->selectFirstItem();
- }
- onList();
- search_results->setFocus(TRUE);
- }
+ if (content.has("failure_reason"))
+ {
+ getChild<LLScrollListCtrl>("SearchResults")->setCommentText(content["failure_reason"].asString());
+ getChildView("ok_btn")->setEnabled(false);
+ }
+ else
+ {
+ LLSD agents = content["agents"];
+
+ LLSD item;
+ LLSD::array_const_iterator it = agents.beginArray();
+ for (; it != agents.endArray(); ++it)
+ {
+ const LLSD& row = *it;
+ if (row["id"].asUUID() != gAgent.getID() || !mExcludeAgentFromSearchResults)
+ {
+ item["id"] = row["id"];
+ LLSD& columns = item["columns"];
+ columns[0]["column"] = "name";
+ columns[0]["value"] = row["display_name"];
+ columns[1]["column"] = "username";
+ columns[1]["value"] = row["username"];
+ search_results->addElement(item);
+
+ // add the avatar name to our list
+ LLAvatarName avatar_name;
+ avatar_name.fromLLSD(row);
+ sAvatarNameMap[row["id"].asUUID()] = avatar_name;
+ }
+ }
+
+ if (search_results->isEmpty())
+ {
+ std::string name = "'" + getChild<LLUICtrl>("Edit")->getValue().asString() + "'";
+ LLSD item;
+ item["id"] = LLUUID::null;
+ item["columns"][0]["column"] = "name";
+ item["columns"][0]["value"] = name;
+ item["columns"][1]["column"] = "username";
+ item["columns"][1]["value"] = getString("not_found_text");
+ search_results->addElement(item);
+ search_results->setEnabled(false);
+ getChildView("ok_btn")->setEnabled(false);
+ }
+ else
+ {
+ getChildView("ok_btn")->setEnabled(true);
+ search_results->setEnabled(true);
+ search_results->sortByColumnIndex(1, TRUE);
+ std::string text = getChild<LLUICtrl>("Edit")->getValue().asString();
+ if (!search_results->selectItemByLabel(text, TRUE, 1))
+ {
+ search_results->selectFirstItem();
+ }
+ onList();
+ search_results->setFocus(TRUE);
+ }
+ }
}
}