diff options
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 213 |
1 files changed, 102 insertions, 111 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 3314ec1..7b21a15 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -111,7 +111,7 @@ public: | |||
111 | EDragAndDropType cargo_type, | 111 | EDragAndDropType cargo_type, |
112 | void* cargo_data, | 112 | void* cargo_data, |
113 | EAcceptance* accept, | 113 | EAcceptance* accept, |
114 | LLString& tooltip_msg); | 114 | std::string& tooltip_msg); |
115 | void setAgentID(const LLUUID &agent_id) { mAgentID = agent_id; } | 115 | void setAgentID(const LLUUID &agent_id) { mAgentID = agent_id; } |
116 | protected: | 116 | protected: |
117 | LLUUID mAgentID; | 117 | LLUUID mAgentID; |
@@ -138,7 +138,7 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
138 | EDragAndDropType cargo_type, | 138 | EDragAndDropType cargo_type, |
139 | void* cargo_data, | 139 | void* cargo_data, |
140 | EAcceptance* accept, | 140 | EAcceptance* accept, |
141 | LLString& tooltip_msg) | 141 | std::string& tooltip_msg) |
142 | { | 142 | { |
143 | BOOL handled = FALSE; | 143 | BOOL handled = FALSE; |
144 | if(getParent()) | 144 | if(getParent()) |
@@ -234,7 +234,7 @@ void LLPanelAvatarTab::draw() | |||
234 | LLPanel::draw(); | 234 | LLPanel::draw(); |
235 | } | 235 | } |
236 | 236 | ||
237 | void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* method) | 237 | void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const std::string& method) |
238 | { | 238 | { |
239 | if (!mDataRequested) | 239 | if (!mDataRequested) |
240 | { | 240 | { |
@@ -292,8 +292,8 @@ void LLPanelAvatarSecondLife::clearControls() | |||
292 | childSetValue("born", ""); | 292 | childSetValue("born", ""); |
293 | childSetValue("acct", ""); | 293 | childSetValue("acct", ""); |
294 | 294 | ||
295 | childSetTextArg("partner_edit", "[FIRST]", LLString::null); | 295 | childSetTextArg("partner_edit", "[FIRST]", LLStringUtil::null); |
296 | childSetTextArg("partner_edit", "[LAST]", LLString::null); | 296 | childSetTextArg("partner_edit", "[LAST]", LLStringUtil::null); |
297 | 297 | ||
298 | mPartnerID = LLUUID::null; | 298 | mPartnerID = LLUUID::null; |
299 | 299 | ||
@@ -459,9 +459,9 @@ BOOL LLPanelAvatarNotes::postBuild(void) | |||
459 | 459 | ||
460 | BOOL LLPanelAvatarWeb::postBuild(void) | 460 | BOOL LLPanelAvatarWeb::postBuild(void) |
461 | { | 461 | { |
462 | childSetAction("load",onClickLoad,this); | 462 | childSetKeystrokeCallback("url_edit", onURLKeystroke, this); |
463 | childSetAction("open",onClickOpen,this); | 463 | childSetCommitCallback("load", onCommitLoad, this); |
464 | childSetAction("home",onClickLoad,this); | 464 | |
465 | childSetAction("web_profile_help",onClickWebProfileHelp,this); | 465 | childSetAction("web_profile_help",onClickWebProfileHelp,this); |
466 | 466 | ||
467 | childSetCommitCallback("url_edit",onCommitURL,this); | 467 | childSetCommitCallback("url_edit",onCommitURL,this); |
@@ -502,7 +502,7 @@ BOOL LLPanelAvatarAdvanced::postBuild() | |||
502 | mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8; | 502 | mWantToCount = (8>kArraySize(mWantToCheck))?kArraySize(mWantToCheck):8; |
503 | for(S32 tt=0; tt < mWantToCount; ++tt) | 503 | for(S32 tt=0; tt < mWantToCount; ++tt) |
504 | { | 504 | { |
505 | LLString ctlname = llformat("chk%d", tt); | 505 | std::string ctlname = llformat("chk%d", tt); |
506 | mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); | 506 | mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); |
507 | } | 507 | } |
508 | mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6; | 508 | mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6; |
@@ -510,7 +510,7 @@ BOOL LLPanelAvatarAdvanced::postBuild() | |||
510 | for(S32 tt=0; tt < mSkillsCount; ++tt) | 510 | for(S32 tt=0; tt < mSkillsCount; ++tt) |
511 | { | 511 | { |
512 | //Find the Skills checkboxes and save off thier controls | 512 | //Find the Skills checkboxes and save off thier controls |
513 | LLString ctlname = llformat("schk%d",tt); | 513 | std::string ctlname = llformat("schk%d",tt); |
514 | mSkillsCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); | 514 | mSkillsCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); |
515 | } | 515 | } |
516 | 516 | ||
@@ -544,31 +544,26 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb() | |||
544 | void LLPanelAvatarWeb::enableControls(BOOL self) | 544 | void LLPanelAvatarWeb::enableControls(BOOL self) |
545 | { | 545 | { |
546 | childSetEnabled("url_edit",self); | 546 | childSetEnabled("url_edit",self); |
547 | childSetVisible("status_text",!self && !mURL.empty()); | 547 | childSetVisible("status_text",!self && !mHome.empty()); |
548 | childSetText("status_text", LLString::null); | 548 | childSetText("status_text", LLStringUtil::null); |
549 | } | 549 | } |
550 | 550 | ||
551 | void LLPanelAvatarWeb::setWebURL(std::string url) | 551 | void LLPanelAvatarWeb::setWebURL(std::string url) |
552 | { | 552 | { |
553 | bool changed_url = (mURL != url); | 553 | bool changed_url = (mHome != url); |
554 | 554 | ||
555 | mURL = url; | 555 | mHome = url; |
556 | bool have_url = !mURL.empty(); | 556 | bool have_url = !mHome.empty(); |
557 | 557 | ||
558 | childSetText("url_edit",mURL); | 558 | childSetText("url_edit", mHome); |
559 | 559 | childSetEnabled("load", mHome.length() > 0); | |
560 | childSetEnabled("load",have_url); | ||
561 | childSetEnabled("open",have_url); | ||
562 | |||
563 | childSetVisible("home",false); | ||
564 | childSetVisible("load",true); | ||
565 | 560 | ||
566 | if (have_url | 561 | if (have_url |
567 | && gSavedSettings.getBOOL("AutoLoadWebProfiles")) | 562 | && gSavedSettings.getBOOL("AutoLoadWebProfiles")) |
568 | { | 563 | { |
569 | if (changed_url) | 564 | if (changed_url) |
570 | { | 565 | { |
571 | load(); | 566 | load(mHome); |
572 | } | 567 | } |
573 | } | 568 | } |
574 | else | 569 | else |
@@ -577,7 +572,7 @@ void LLPanelAvatarWeb::setWebURL(std::string url) | |||
577 | } | 572 | } |
578 | 573 | ||
579 | BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); | 574 | BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); |
580 | childSetVisible("status_text",!own_avatar && !mURL.empty()); | 575 | childSetVisible("status_text",!own_avatar && !mHome.empty()); |
581 | 576 | ||
582 | } | 577 | } |
583 | 578 | ||
@@ -607,47 +602,45 @@ void LLPanelAvatarWeb::load(std::string url) | |||
607 | mWebBrowser->navigateTo( url ); | 602 | mWebBrowser->navigateTo( url ); |
608 | } | 603 | } |
609 | 604 | ||
610 | // If we have_url then we loaded so use the home button | 605 | childSetVisible("profile_html", have_url); |
611 | // Or if the url in address bar is not the home url show the home button. | ||
612 | bool use_home = (have_url | ||
613 | || url != mURL); | ||
614 | |||
615 | childSetVisible("profile_html",have_url); | ||
616 | childSetVisible("load",!use_home); | ||
617 | childSetVisible("home",use_home); | ||
618 | |||
619 | childSetEnabled("load",!use_home); | ||
620 | childSetEnabled("home",use_home); | ||
621 | childSetEnabled("open",have_url); | ||
622 | |||
623 | } | 606 | } |
624 | 607 | ||
625 | void LLPanelAvatarWeb::load() | 608 | //static |
626 | { | 609 | void LLPanelAvatarWeb::onURLKeystroke(LLLineEditor* editor, void* data) |
627 | load(mURL); | ||
628 | } | ||
629 | |||
630 | // static | ||
631 | void LLPanelAvatarWeb::onClickLoad(void* data) | ||
632 | { | 610 | { |
633 | LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; | 611 | LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; |
634 | |||
635 | if (!self) return; | 612 | if (!self) return; |
636 | 613 | LLSD::String url = editor->getText(); | |
637 | self->load(); | 614 | self->childSetEnabled("load", url.length() > 0); |
615 | return; | ||
638 | } | 616 | } |
639 | 617 | ||
640 | // static | 618 | // static |
641 | void LLPanelAvatarWeb::onClickOpen(void* data) | 619 | void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data) |
642 | { | 620 | { |
643 | LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; | 621 | LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; |
644 | 622 | ||
645 | if (!self) return; | 623 | if (!self) return; |
646 | 624 | ||
647 | std::string url = self->childGetText("url_edit"); | 625 | LLSD::String valstr = ctrl->getValue().asString(); |
648 | if (!url.empty()) | 626 | LLSD::String urlstr = self->childGetText("url_edit"); |
627 | if (valstr == "") // load url string into browser panel | ||
649 | { | 628 | { |
650 | LLWeb::loadURLExternal(url); | 629 | self->load(urlstr); |
630 | } | ||
631 | else if (valstr == "open") // open in user's external browser | ||
632 | { | ||
633 | if (!urlstr.empty()) | ||
634 | { | ||
635 | LLWeb::loadURLExternal(urlstr); | ||
636 | } | ||
637 | } | ||
638 | else if (valstr == "home") // reload profile owner's home page | ||
639 | { | ||
640 | if (!self->mHome.empty()) | ||
641 | { | ||
642 | self->load(self->mHome); | ||
643 | } | ||
651 | } | 644 | } |
652 | } | 645 | } |
653 | 646 | ||
@@ -780,7 +773,7 @@ void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata) | |||
780 | //----------------------------------------------------------------------------- | 773 | //----------------------------------------------------------------------------- |
781 | // LLPanelAvatarClassified() | 774 | // LLPanelAvatarClassified() |
782 | //----------------------------------------------------------------------------- | 775 | //----------------------------------------------------------------------------- |
783 | LLPanelAvatarClassified::LLPanelAvatarClassified(const LLString& name, const LLRect& rect, | 776 | LLPanelAvatarClassified::LLPanelAvatarClassified(const std::string& name, const LLRect& rect, |
784 | LLPanelAvatar* panel_avatar) | 777 | LLPanelAvatar* panel_avatar) |
785 | : LLPanelAvatarTab(name, rect, panel_avatar) | 778 | : LLPanelAvatarTab(name, rect, panel_avatar) |
786 | { | 779 | { |
@@ -885,7 +878,7 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, | |||
885 | S32 block = 0; | 878 | S32 block = 0; |
886 | S32 block_count = 0; | 879 | S32 block_count = 0; |
887 | LLUUID classified_id; | 880 | LLUUID classified_id; |
888 | char classified_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/ | 881 | std::string classified_name; |
889 | LLPanelClassified* panel_classified = NULL; | 882 | LLPanelClassified* panel_classified = NULL; |
890 | 883 | ||
891 | LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); | 884 | LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); |
@@ -897,7 +890,7 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, | |||
897 | for (block = 0; block < block_count; block++) | 890 | for (block = 0; block < block_count; block++) |
898 | { | 891 | { |
899 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id, block); | 892 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id, block); |
900 | msg->getStringFast(_PREHASH_Data, _PREHASH_Name, DB_PICK_NAME_SIZE, classified_name, block); | 893 | msg->getStringFast(_PREHASH_Data, _PREHASH_Name, classified_name, block); |
901 | 894 | ||
902 | panel_classified = new LLPanelClassified(false, false); | 895 | panel_classified = new LLPanelClassified(false, false); |
903 | 896 | ||
@@ -969,7 +962,7 @@ void LLPanelAvatarClassified::onClickDelete(void* data) | |||
969 | } | 962 | } |
970 | if (!panel_classified) return; | 963 | if (!panel_classified) return; |
971 | 964 | ||
972 | LLStringBase<char>::format_map_t args; | 965 | LLStringUtil::format_map_t args; |
973 | args["[NAME]"] = panel_classified->getClassifiedName(); | 966 | args["[NAME]"] = panel_classified->getClassifiedName(); |
974 | gViewerWindow->alertXml("DeleteClassified", args, callbackDelete, self); | 967 | gViewerWindow->alertXml("DeleteClassified", args, callbackDelete, self); |
975 | 968 | ||
@@ -1054,7 +1047,7 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) | |||
1054 | S32 block = 0; | 1047 | S32 block = 0; |
1055 | S32 block_count = 0; | 1048 | S32 block_count = 0; |
1056 | LLUUID pick_id; | 1049 | LLUUID pick_id; |
1057 | char pick_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/ | 1050 | std::string pick_name; |
1058 | LLPanelPick* panel_pick = NULL; | 1051 | LLPanelPick* panel_pick = NULL; |
1059 | 1052 | ||
1060 | LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); | 1053 | LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); |
@@ -1070,7 +1063,7 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) | |||
1070 | for (block = 0; block < block_count; block++) | 1063 | for (block = 0; block < block_count; block++) |
1071 | { | 1064 | { |
1072 | msg->getUUID("Data", "PickID", pick_id, block); | 1065 | msg->getUUID("Data", "PickID", pick_id, block); |
1073 | msg->getString("Data", "PickName", DB_PICK_NAME_SIZE, pick_name, block); | 1066 | msg->getString("Data", "PickName", pick_name, block); |
1074 | 1067 | ||
1075 | panel_pick = new LLPanelPick(FALSE); | 1068 | panel_pick = new LLPanelPick(FALSE); |
1076 | 1069 | ||
@@ -1127,7 +1120,7 @@ void LLPanelAvatarPicks::onClickDelete(void* data) | |||
1127 | 1120 | ||
1128 | if (!panel_pick) return; | 1121 | if (!panel_pick) return; |
1129 | 1122 | ||
1130 | LLString::format_map_t args; | 1123 | LLStringUtil::format_map_t args; |
1131 | args["[PICK]"] = panel_pick->getPickName(); | 1124 | args["[PICK]"] = panel_pick->getPickName(); |
1132 | 1125 | ||
1133 | gViewerWindow->alertXml("DeleteAvatarPick", args, | 1126 | gViewerWindow->alertXml("DeleteAvatarPick", args, |
@@ -1275,7 +1268,7 @@ void LLPanelAvatar::setAvatar(LLViewerObject *avatarp) | |||
1275 | LLNameValue *firstname = avatarp->getNVPair("FirstName"); | 1268 | LLNameValue *firstname = avatarp->getNVPair("FirstName"); |
1276 | LLNameValue *lastname = avatarp->getNVPair("LastName"); | 1269 | LLNameValue *lastname = avatarp->getNVPair("LastName"); |
1277 | 1270 | ||
1278 | LLString name; | 1271 | std::string name; |
1279 | if (firstname && lastname) | 1272 | if (firstname && lastname) |
1280 | { | 1273 | { |
1281 | name.assign( firstname->getString() ); | 1274 | name.assign( firstname->getString() ); |
@@ -1330,7 +1323,7 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status) | |||
1330 | } | 1323 | } |
1331 | } | 1324 | } |
1332 | 1325 | ||
1333 | void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, | 1326 | void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name, |
1334 | EOnlineStatus online_status) | 1327 | EOnlineStatus online_status) |
1335 | { | 1328 | { |
1336 | if (avatar_id.isNull()) return; | 1329 | if (avatar_id.isNull()) return; |
@@ -1532,7 +1525,7 @@ void LLPanelAvatar::resetGroupList() | |||
1532 | row["columns"][0]["width"] = 0; | 1525 | row["columns"][0]["width"] = 0; |
1533 | group_list->addElement(row); | 1526 | group_list->addElement(row); |
1534 | } | 1527 | } |
1535 | group_list->sortByColumn(0, TRUE); | 1528 | group_list->sortByColumnIndex(0, TRUE); |
1536 | } | 1529 | } |
1537 | } | 1530 | } |
1538 | } | 1531 | } |
@@ -1742,9 +1735,9 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1742 | LLUUID image_id; | 1735 | LLUUID image_id; |
1743 | LLUUID fl_image_id; | 1736 | LLUUID fl_image_id; |
1744 | LLUUID partner_id; | 1737 | LLUUID partner_id; |
1745 | char about_text[DB_USER_ABOUT_BUF_SIZE]; /*Flawfinder: ignore*/ | 1738 | std::string about_text; |
1746 | char fl_about_text[DB_USER_FL_ABOUT_BUF_SIZE]; /*Flawfinder: ignore*/ | 1739 | std::string fl_about_text; |
1747 | char born_on[DB_BORN_BUF_SIZE]; /*Flawfinder: ignore*/ | 1740 | std::string born_on; |
1748 | S32 charter_member_size = 0; | 1741 | S32 charter_member_size = 0; |
1749 | BOOL allow_publish = FALSE; | 1742 | BOOL allow_publish = FALSE; |
1750 | //BOOL mature = FALSE; | 1743 | //BOOL mature = FALSE; |
@@ -1752,7 +1745,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1752 | BOOL transacted = FALSE; | 1745 | BOOL transacted = FALSE; |
1753 | BOOL age_verified = FALSE; | 1746 | BOOL age_verified = FALSE; |
1754 | BOOL online = FALSE; | 1747 | BOOL online = FALSE; |
1755 | char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; /*Flawfinder: ignore*/ | 1748 | std::string profile_url; |
1756 | 1749 | ||
1757 | U32 flags = 0x0; | 1750 | U32 flags = 0x0; |
1758 | 1751 | ||
@@ -1780,10 +1773,10 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1780 | msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_ImageID, image_id ); | 1773 | msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_ImageID, image_id ); |
1781 | msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_FLImageID, fl_image_id ); | 1774 | msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_FLImageID, fl_image_id ); |
1782 | msg->getUUIDFast(_PREHASH_PropertiesData, _PREHASH_PartnerID, partner_id); | 1775 | msg->getUUIDFast(_PREHASH_PropertiesData, _PREHASH_PartnerID, partner_id); |
1783 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_AboutText, DB_USER_ABOUT_BUF_SIZE, about_text ); | 1776 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_AboutText, about_text ); |
1784 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_FLAboutText, DB_USER_FL_ABOUT_BUF_SIZE, fl_about_text ); | 1777 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_FLAboutText, fl_about_text ); |
1785 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, DB_BORN_BUF_SIZE, born_on); | 1778 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, born_on); |
1786 | msg->getString("PropertiesData","ProfileURL", DB_USER_PROFILE_URL_BUF_SIZE, profile_url); | 1779 | msg->getString("PropertiesData","ProfileURL", profile_url); |
1787 | msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); | 1780 | msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); |
1788 | 1781 | ||
1789 | identified = (flags & AVATAR_IDENTIFIED); | 1782 | identified = (flags & AVATAR_IDENTIFIED); |
@@ -1793,7 +1786,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1793 | online = (flags & AVATAR_ONLINE); | 1786 | online = (flags & AVATAR_ONLINE); |
1794 | 1787 | ||
1795 | U8 caption_index = 0; | 1788 | U8 caption_index = 0; |
1796 | LLString caption_text; | 1789 | std::string caption_text; |
1797 | charter_member_size = msg->getSize("PropertiesData", "CharterMember"); | 1790 | charter_member_size = msg->getSize("PropertiesData", "CharterMember"); |
1798 | if(1 == charter_member_size) | 1791 | if(1 == charter_member_size) |
1799 | { | 1792 | { |
@@ -1801,15 +1794,13 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1801 | } | 1794 | } |
1802 | else if(1 < charter_member_size) | 1795 | else if(1 < charter_member_size) |
1803 | { | 1796 | { |
1804 | char caption[MAX_STRING]; /*Flawfinder: ignore*/ | 1797 | msg->getString("PropertiesData", "CharterMember", caption_text); |
1805 | msg->getString("PropertiesData", "CharterMember", MAX_STRING, caption); | ||
1806 | caption_text = caption; | ||
1807 | } | 1798 | } |
1808 | 1799 | ||
1809 | 1800 | ||
1810 | if(caption_text.empty()) | 1801 | if(caption_text.empty()) |
1811 | { | 1802 | { |
1812 | LLString::format_map_t args; | 1803 | LLStringUtil::format_map_t args; |
1813 | caption_text = self->mPanelSecondLife->getString("CaptionTextAcctInfo"); | 1804 | caption_text = self->mPanelSecondLife->getString("CaptionTextAcctInfo"); |
1814 | 1805 | ||
1815 | const char* ACCT_TYPE[] = { | 1806 | const char* ACCT_TYPE[] = { |
@@ -1821,7 +1812,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1821 | caption_index = llclamp(caption_index, (U8)0, (U8)(sizeof(ACCT_TYPE)/sizeof(ACCT_TYPE[0])-1)); | 1812 | caption_index = llclamp(caption_index, (U8)0, (U8)(sizeof(ACCT_TYPE)/sizeof(ACCT_TYPE[0])-1)); |
1822 | args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]); | 1813 | args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]); |
1823 | 1814 | ||
1824 | LLString payment_text = " "; | 1815 | std::string payment_text = " "; |
1825 | const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; | 1816 | const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; |
1826 | if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) | 1817 | if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) |
1827 | { | 1818 | { |
@@ -1838,7 +1829,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1838 | payment_text = "NoPaymentInfoOnFile"; | 1829 | payment_text = "NoPaymentInfoOnFile"; |
1839 | } | 1830 | } |
1840 | args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); | 1831 | args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); |
1841 | LLString age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; | 1832 | std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; |
1842 | // Do not display age verification status at this time | 1833 | // Do not display age verification status at this time |
1843 | //args["[AGEVERIFICATION]"] = self->mPanelSecondLife->getString(age_text); | 1834 | //args["[AGEVERIFICATION]"] = self->mPanelSecondLife->getString(age_text); |
1844 | args["[AGEVERIFICATION]"] = " "; | 1835 | args["[AGEVERIFICATION]"] = " "; |
@@ -1848,7 +1839,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1848 | args["[PAYMENTINFO]"] = " "; | 1839 | args["[PAYMENTINFO]"] = " "; |
1849 | args["[AGEVERIFICATION]"] = " "; | 1840 | args["[AGEVERIFICATION]"] = " "; |
1850 | } | 1841 | } |
1851 | LLString::format(caption_text, args); | 1842 | LLStringUtil::format(caption_text, args); |
1852 | } | 1843 | } |
1853 | 1844 | ||
1854 | self->mPanelSecondLife->childSetValue("acct", caption_text); | 1845 | self->mPanelSecondLife->childSetValue("acct", caption_text); |
@@ -1858,7 +1849,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1858 | 1849 | ||
1859 | self->setOnlineStatus(online_status); | 1850 | self->setOnlineStatus(online_status); |
1860 | 1851 | ||
1861 | self->mPanelWeb->setWebURL(std::string(profile_url)); | 1852 | self->mPanelWeb->setWebURL(profile_url); |
1862 | 1853 | ||
1863 | LLTextureCtrl* image_ctrl = self->mPanelSecondLife->getChild<LLTextureCtrl>("img"); | 1854 | LLTextureCtrl* image_ctrl = self->mPanelSecondLife->getChild<LLTextureCtrl>("img"); |
1864 | if(image_ctrl) | 1855 | if(image_ctrl) |
@@ -1893,10 +1884,10 @@ void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**) | |||
1893 | LLUUID avatar_id; // target of this panel | 1884 | LLUUID avatar_id; // target of this panel |
1894 | 1885 | ||
1895 | U32 want_to_mask; | 1886 | U32 want_to_mask; |
1896 | char want_to_text[DB_USER_WANT_TO_BUF_SIZE]; /*Flawfinder: ignore*/ | 1887 | std::string want_to_text; |
1897 | U32 skills_mask; | 1888 | U32 skills_mask; |
1898 | char skills_text[DB_USER_SKILLS_BUF_SIZE]; /*Flawfinder: ignore*/ | 1889 | std::string skills_text; |
1899 | char languages_text[DB_USER_SKILLS_BUF_SIZE]; /*Flawfinder: ignore*/ | 1890 | std::string languages_text; |
1900 | 1891 | ||
1901 | //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; | 1892 | //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; |
1902 | 1893 | ||
@@ -1912,10 +1903,10 @@ void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**) | |||
1912 | } | 1903 | } |
1913 | 1904 | ||
1914 | msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_WantToMask, want_to_mask ); | 1905 | msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_WantToMask, want_to_mask ); |
1915 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_WantToText, DB_USER_WANT_TO_BUF_SIZE, want_to_text ); | 1906 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_WantToText, want_to_text ); |
1916 | msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_SkillsMask, skills_mask ); | 1907 | msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_SkillsMask, skills_mask ); |
1917 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_SkillsText, DB_USER_SKILLS_BUF_SIZE, skills_text ); | 1908 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_SkillsText, skills_text ); |
1918 | msg->getString(_PREHASH_PropertiesData, "LanguagesText", DB_USER_SKILLS_BUF_SIZE, languages_text ); | 1909 | msg->getString(_PREHASH_PropertiesData, "LanguagesText", languages_text ); |
1919 | 1910 | ||
1920 | self->mPanelAdvanced->setWantSkills(want_to_mask, want_to_text, skills_mask, skills_text, languages_text); | 1911 | self->mPanelAdvanced->setWantSkills(want_to_mask, want_to_text, skills_mask, skills_text, languages_text); |
1921 | } | 1912 | } |
@@ -1929,9 +1920,9 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) | |||
1929 | LLUUID agent_id; // your id | 1920 | LLUUID agent_id; // your id |
1930 | LLUUID avatar_id; // target of this panel | 1921 | LLUUID avatar_id; // target of this panel |
1931 | U64 group_powers; | 1922 | U64 group_powers; |
1932 | char group_title[DB_GROUP_TITLE_BUF_SIZE]; /*Flawfinder: ignore*/ | 1923 | std::string group_title; |
1933 | LLUUID group_id; | 1924 | LLUUID group_id; |
1934 | char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ | 1925 | std::string group_name; |
1935 | LLUUID group_insignia_id; | 1926 | LLUUID group_insignia_id; |
1936 | 1927 | ||
1937 | llinfos << "groups packet size " << msg->getReceiveSize() << llendl; | 1928 | llinfos << "groups packet size " << msg->getReceiveSize() << llendl; |
@@ -1956,19 +1947,19 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) | |||
1956 | S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData); | 1947 | S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData); |
1957 | if (0 == group_count) | 1948 | if (0 == group_count) |
1958 | { | 1949 | { |
1959 | if(group_list) group_list->addCommentText("None"); | 1950 | if(group_list) group_list->addCommentText(std::string("None")); // *TODO: Translate |
1960 | } | 1951 | } |
1961 | else | 1952 | else |
1962 | { | 1953 | { |
1963 | for(S32 i = 0; i < group_count; ++i) | 1954 | for(S32 i = 0; i < group_count; ++i) |
1964 | { | 1955 | { |
1965 | msg->getU64( _PREHASH_GroupData, "GroupPowers", group_powers, i ); | 1956 | msg->getU64( _PREHASH_GroupData, "GroupPowers", group_powers, i ); |
1966 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupTitle, DB_GROUP_TITLE_BUF_SIZE, group_title, i ); | 1957 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupTitle, group_title, i ); |
1967 | msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupID, group_id, i); | 1958 | msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupID, group_id, i); |
1968 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupName, DB_GROUP_NAME_BUF_SIZE, group_name, i ); | 1959 | msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupName, group_name, i ); |
1969 | msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupInsigniaID, group_insignia_id, i ); | 1960 | msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupInsigniaID, group_insignia_id, i ); |
1970 | 1961 | ||
1971 | LLString group_string; | 1962 | std::string group_string; |
1972 | if (group_id.notNull()) | 1963 | if (group_id.notNull()) |
1973 | { | 1964 | { |
1974 | group_string.assign(group_name); | 1965 | group_string.assign(group_name); |
@@ -1999,7 +1990,7 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) | |||
1999 | } | 1990 | } |
2000 | } | 1991 | } |
2001 | } | 1992 | } |
2002 | if(group_list) group_list->sortByColumn(0, TRUE); | 1993 | if(group_list) group_list->sortByColumnIndex(0, TRUE); |
2003 | } | 1994 | } |
2004 | } | 1995 | } |
2005 | 1996 | ||
@@ -2036,7 +2027,7 @@ void LLPanelAvatar::sendAvatarPropertiesUpdate() | |||
2036 | mPanelAdvanced->getWantSkills(&want_to_mask, want_to_text, &skills_mask, skills_text, languages_text); | 2027 | mPanelAdvanced->getWantSkills(&want_to_mask, want_to_text, &skills_mask, skills_text, languages_text); |
2037 | 2028 | ||
2038 | LLUUID first_life_image_id; | 2029 | LLUUID first_life_image_id; |
2039 | LLString first_life_about_text; | 2030 | std::string first_life_about_text; |
2040 | if (mPanelFirstLife) | 2031 | if (mPanelFirstLife) |
2041 | { | 2032 | { |
2042 | first_life_about_text = mPanelFirstLife->childGetValue("about").asString(); | 2033 | first_life_about_text = mPanelFirstLife->childGetValue("about").asString(); |
@@ -2047,7 +2038,7 @@ void LLPanelAvatar::sendAvatarPropertiesUpdate() | |||
2047 | } | 2038 | } |
2048 | } | 2039 | } |
2049 | 2040 | ||
2050 | LLString about_text = mPanelSecondLife->childGetValue("about").asString(); | 2041 | std::string about_text = mPanelSecondLife->childGetValue("about").asString(); |
2051 | 2042 | ||
2052 | LLMessageSystem *msg = gMessageSystem; | 2043 | LLMessageSystem *msg = gMessageSystem; |
2053 | 2044 | ||
@@ -2131,8 +2122,8 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**) | |||
2131 | continue; | 2122 | continue; |
2132 | } | 2123 | } |
2133 | 2124 | ||
2134 | char text[DB_USER_NOTE_SIZE]; /*Flawfinder: ignore*/ | 2125 | std::string text; |
2135 | msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text); | 2126 | msg->getString("Data", "Notes", text); |
2136 | self->childSetValue("notes edit", text); | 2127 | self->childSetValue("notes edit", text); |
2137 | self->childSetEnabled("notes edit", true); | 2128 | self->childSetEnabled("notes edit", true); |
2138 | self->mHaveNotes = true; | 2129 | self->mHaveNotes = true; |
@@ -2192,13 +2183,13 @@ void LLPanelAvatar::onClickKick(void* userdata) | |||
2192 | gFloaterView->getNewFloaterPosition(&left, &top); | 2183 | gFloaterView->getNewFloaterPosition(&left, &top); |
2193 | LLRect rect(left, top, left+400, top-300); | 2184 | LLRect rect(left, top, left+400, top-300); |
2194 | 2185 | ||
2195 | gViewerWindow->alertXmlEditText("KickUser", LLString::format_map_t(), | 2186 | gViewerWindow->alertXmlEditText("KickUser", LLStringUtil::format_map_t(), |
2196 | NULL, NULL, | 2187 | NULL, NULL, |
2197 | LLPanelAvatar::finishKick, self); | 2188 | LLPanelAvatar::finishKick, self); |
2198 | } | 2189 | } |
2199 | 2190 | ||
2200 | // static | 2191 | // static |
2201 | void LLPanelAvatar::finishKick(S32 option, const LLString& text, void* userdata) | 2192 | void LLPanelAvatar::finishKick(S32 option, const std::string& text, void* userdata) |
2202 | { | 2193 | { |
2203 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2194 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; |
2204 | 2195 | ||
@@ -2220,13 +2211,13 @@ void LLPanelAvatar::finishKick(S32 option, const LLString& text, void* userdata) | |||
2220 | // static | 2211 | // static |
2221 | void LLPanelAvatar::onClickFreeze(void* userdata) | 2212 | void LLPanelAvatar::onClickFreeze(void* userdata) |
2222 | { | 2213 | { |
2223 | gViewerWindow->alertXmlEditText("FreezeUser", LLString::format_map_t(), | 2214 | gViewerWindow->alertXmlEditText("FreezeUser", LLStringUtil::format_map_t(), |
2224 | NULL, NULL, | 2215 | NULL, NULL, |
2225 | LLPanelAvatar::finishFreeze, userdata); | 2216 | LLPanelAvatar::finishFreeze, userdata); |
2226 | } | 2217 | } |
2227 | 2218 | ||
2228 | // static | 2219 | // static |
2229 | void LLPanelAvatar::finishFreeze(S32 option, const LLString& text, void* userdata) | 2220 | void LLPanelAvatar::finishFreeze(S32 option, const std::string& text, void* userdata) |
2230 | { | 2221 | { |
2231 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2222 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; |
2232 | 2223 | ||
@@ -2248,13 +2239,13 @@ void LLPanelAvatar::finishFreeze(S32 option, const LLString& text, void* userdat | |||
2248 | // static | 2239 | // static |
2249 | void LLPanelAvatar::onClickUnfreeze(void* userdata) | 2240 | void LLPanelAvatar::onClickUnfreeze(void* userdata) |
2250 | { | 2241 | { |
2251 | gViewerWindow->alertXmlEditText("UnFreezeUser", LLString::format_map_t(), | 2242 | gViewerWindow->alertXmlEditText("UnFreezeUser", LLStringUtil::format_map_t(), |
2252 | NULL, NULL, | 2243 | NULL, NULL, |
2253 | LLPanelAvatar::finishUnfreeze, userdata); | 2244 | LLPanelAvatar::finishUnfreeze, userdata); |
2254 | } | 2245 | } |
2255 | 2246 | ||
2256 | // static | 2247 | // static |
2257 | void LLPanelAvatar::finishUnfreeze(S32 option, const LLString& text, void* userdata) | 2248 | void LLPanelAvatar::finishUnfreeze(S32 option, const std::string& text, void* userdata) |
2258 | { | 2249 | { |
2259 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; | 2250 | LLPanelAvatar* self = (LLPanelAvatar*) userdata; |
2260 | 2251 | ||
@@ -2282,10 +2273,10 @@ void LLPanelAvatar::onClickCSR(void* userdata) | |||
2282 | LLNameEditor* name_edit = self->getChild<LLNameEditor>("name"); | 2273 | LLNameEditor* name_edit = self->getChild<LLNameEditor>("name"); |
2283 | if (!name_edit) return; | 2274 | if (!name_edit) return; |
2284 | 2275 | ||
2285 | LLString name = name_edit->getText(); | 2276 | std::string name = name_edit->getText(); |
2286 | if (name.empty()) return; | 2277 | if (name.empty()) return; |
2287 | 2278 | ||
2288 | LLString url = "http://csr.lindenlab.com/agent/"; | 2279 | std::string url = "http://csr.lindenlab.com/agent/"; |
2289 | 2280 | ||
2290 | // slow and stupid, but it's late | 2281 | // slow and stupid, but it's late |
2291 | S32 len = name.length(); | 2282 | S32 len = name.length(); |
@@ -2308,21 +2299,21 @@ void LLPanelAvatar::onClickCSR(void* userdata) | |||
2308 | void* LLPanelAvatar::createPanelAvatarSecondLife(void* data) | 2299 | void* LLPanelAvatar::createPanelAvatarSecondLife(void* data) |
2309 | { | 2300 | { |
2310 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2301 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2311 | self->mPanelSecondLife = new LLPanelAvatarSecondLife("2nd Life",LLRect(),self); | 2302 | self->mPanelSecondLife = new LLPanelAvatarSecondLife(std::string("2nd Life"),LLRect(),self); |
2312 | return self->mPanelSecondLife; | 2303 | return self->mPanelSecondLife; |
2313 | } | 2304 | } |
2314 | 2305 | ||
2315 | void* LLPanelAvatar::createPanelAvatarWeb(void* data) | 2306 | void* LLPanelAvatar::createPanelAvatarWeb(void* data) |
2316 | { | 2307 | { |
2317 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2308 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2318 | self->mPanelWeb = new LLPanelAvatarWeb("Web",LLRect(),self); | 2309 | self->mPanelWeb = new LLPanelAvatarWeb(std::string("Web"),LLRect(),self); |
2319 | return self->mPanelWeb; | 2310 | return self->mPanelWeb; |
2320 | } | 2311 | } |
2321 | 2312 | ||
2322 | void* LLPanelAvatar::createPanelAvatarInterests(void* data) | 2313 | void* LLPanelAvatar::createPanelAvatarInterests(void* data) |
2323 | { | 2314 | { |
2324 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2315 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2325 | self->mPanelAdvanced = new LLPanelAvatarAdvanced("Interests",LLRect(),self); | 2316 | self->mPanelAdvanced = new LLPanelAvatarAdvanced(std::string("Interests"),LLRect(),self); |
2326 | return self->mPanelAdvanced; | 2317 | return self->mPanelAdvanced; |
2327 | } | 2318 | } |
2328 | 2319 | ||
@@ -2330,27 +2321,27 @@ void* LLPanelAvatar::createPanelAvatarInterests(void* data) | |||
2330 | void* LLPanelAvatar::createPanelAvatarPicks(void* data) | 2321 | void* LLPanelAvatar::createPanelAvatarPicks(void* data) |
2331 | { | 2322 | { |
2332 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2323 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2333 | self->mPanelPicks = new LLPanelAvatarPicks("Picks",LLRect(),self); | 2324 | self->mPanelPicks = new LLPanelAvatarPicks(std::string("Picks"),LLRect(),self); |
2334 | return self->mPanelPicks; | 2325 | return self->mPanelPicks; |
2335 | } | 2326 | } |
2336 | 2327 | ||
2337 | void* LLPanelAvatar::createPanelAvatarClassified(void* data) | 2328 | void* LLPanelAvatar::createPanelAvatarClassified(void* data) |
2338 | { | 2329 | { |
2339 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2330 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2340 | self->mPanelClassified = new LLPanelAvatarClassified("Classified",LLRect(),self); | 2331 | self->mPanelClassified = new LLPanelAvatarClassified(std::string("Classified"),LLRect(),self); |
2341 | return self->mPanelClassified; | 2332 | return self->mPanelClassified; |
2342 | } | 2333 | } |
2343 | 2334 | ||
2344 | void* LLPanelAvatar::createPanelAvatarFirstLife(void* data) | 2335 | void* LLPanelAvatar::createPanelAvatarFirstLife(void* data) |
2345 | { | 2336 | { |
2346 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2337 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2347 | self->mPanelFirstLife = new LLPanelAvatarFirstLife("1st Life", LLRect(), self); | 2338 | self->mPanelFirstLife = new LLPanelAvatarFirstLife(std::string("1st Life"), LLRect(), self); |
2348 | return self->mPanelFirstLife; | 2339 | return self->mPanelFirstLife; |
2349 | } | 2340 | } |
2350 | 2341 | ||
2351 | void* LLPanelAvatar::createPanelAvatarNotes(void* data) | 2342 | void* LLPanelAvatar::createPanelAvatarNotes(void* data) |
2352 | { | 2343 | { |
2353 | LLPanelAvatar* self = (LLPanelAvatar*)data; | 2344 | LLPanelAvatar* self = (LLPanelAvatar*)data; |
2354 | self->mPanelNotes = new LLPanelAvatarNotes("My Notes",LLRect(),self); | 2345 | self->mPanelNotes = new LLPanelAvatarNotes(std::string("My Notes"),LLRect(),self); |
2355 | return self->mPanelNotes; | 2346 | return self->mPanelNotes; |
2356 | } | 2347 | } |