aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llpanelavatar.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp98
1 files changed, 36 insertions, 62 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index b79993f..dc2f14f 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -2,6 +2,8 @@
2 * @file llpanelavatar.cpp 2 * @file llpanelavatar.cpp
3 * @brief LLPanelAvatar and related class implementations 3 * @brief LLPanelAvatar and related class implementations
4 * 4 *
5 * $LicenseInfo:firstyear=2004&license=viewergpl$
6 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 7 * Copyright (c) 2004-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -84,36 +87,6 @@
84std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; 87std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
85BOOL LLPanelAvatar::sAllowFirstLife = FALSE; 88BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
86 89
87//-----------------------------------------------------------------------------
88// Constants
89//-----------------------------------------------------------------------------
90
91// RN: move these to lldbstrings.h
92static const S32 DB_USER_FAVORITES_STR_LEN = 254;
93
94const char LOADING_MSG[] = "Loading...";
95static const char IM_DISABLED_TOOLTIP[] = "Instant Message (IM).\nDisabled because you do not have their card.";
96static const char IM_ENABLED_TOOLTIP[] = "Instant Message (IM)";
97static const S32 LEFT = HPAD;
98
99static const S32 RULER0 = 65;
100static const S32 RULER1 = RULER0 + 5;
101static const S32 RULER2 = RULER1 + 90;
102static const S32 RULER3 = RULER2 + 90;
103static const S32 RULER4 = RULER3 + 10;
104
105static const S32 PICT_WIDTH = 180;
106static const S32 PICT_HEIGHT = 135;
107
108static const S32 RULER5 = RULER4 + 140;
109static const S32 WIDTH = RULER5 + 16;
110
111static const S32 MAX_CHARS = 254;
112
113static const LLColor4 WHITE(1,1,1,1);
114static const LLColor4 BLACK(0,0,0,1);
115static const LLColor4 CLEAR(0,0,0,0);
116
117extern void handle_lure(const LLUUID& invitee); 90extern void handle_lure(const LLUUID& invitee);
118extern void handle_pay_by_id(const LLUUID& payee); 91extern void handle_pay_by_id(const LLUUID& payee);
119 92
@@ -314,8 +287,8 @@ void LLPanelAvatarSecondLife::updatePartnerName()
314 BOOL found = gCacheName->getName(mPartnerID, first, last); 287 BOOL found = gCacheName->getName(mPartnerID, first, last);
315 if (found) 288 if (found)
316 { 289 {
317 childSetTextArg("partner_edit", "[FIRST]", first); 290 childSetTextArg("partner_edit", "[FIRST]", LLString(first));
318 childSetTextArg("partner_edit", "[LAST]", last); 291 childSetTextArg("partner_edit", "[LAST]", LLString(last));
319 } 292 }
320 } 293 }
321} 294}
@@ -336,8 +309,8 @@ void LLPanelAvatarSecondLife::clearControls()
336 childSetValue("born", ""); 309 childSetValue("born", "");
337 childSetValue("acct", ""); 310 childSetValue("acct", "");
338 311
339 childSetTextArg("partner_edit", "[FIRST]", ""); 312 childSetTextArg("partner_edit", "[FIRST]", LLString::null);
340 childSetTextArg("partner_edit", "[LAST]", ""); 313 childSetTextArg("partner_edit", "[LAST]", LLString::null);
341 314
342 mPartnerID = LLUUID::null; 315 mPartnerID = LLUUID::null;
343 316
@@ -373,7 +346,7 @@ void LLPanelAvatarSecondLife::enableControls(BOOL self)
373 // appears to reset the read only background color when 346 // appears to reset the read only background color when
374 // setEnable is called, for some reason 347 // setEnable is called, for some reason
375 LLTextEditor* about = LLUICtrlFactory::getTextEditorByName(this,"about"); 348 LLTextEditor* about = LLUICtrlFactory::getTextEditorByName(this,"about");
376 if (about) about->setReadOnlyBgColor(CLEAR); 349 if (about) about->setReadOnlyBgColor(LLColor4::transparent);
377 } 350 }
378} 351}
379 352
@@ -466,7 +439,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
466 childSetVisible("online_unknown",FALSE); 439 childSetVisible("online_unknown",FALSE);
467 childSetVisible("online_no",FALSE); 440 childSetVisible("online_no",FALSE);
468 441
469 childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); 442 childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar());
470 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); 443 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar());
471 444
472 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); 445 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar());
@@ -753,10 +726,10 @@ void LLPanelAvatarAdvanced::enableControls(BOOL self)
753 // This is because the LLTextEditor 726 // This is because the LLTextEditor
754 // appears to reset the read only background color when 727 // appears to reset the read only background color when
755 // setEnable is called, for some reason 728 // setEnable is called, for some reason
756 if (mWantToEdit) mWantToEdit->setReadOnlyBgColor(CLEAR); 729 if (mWantToEdit) mWantToEdit->setReadOnlyBgColor(LLColor4::transparent);
757 if (mSkillsEdit) mSkillsEdit->setReadOnlyBgColor(CLEAR); 730 if (mSkillsEdit) mSkillsEdit->setReadOnlyBgColor(LLColor4::transparent);
758 LLLineEditor* languages_edit = (LLLineEditor*)getChildByName("languages_edit"); 731 LLLineEditor* languages_edit = (LLLineEditor*)getChildByName("languages_edit");
759 languages_edit->setReadOnlyBgColor(CLEAR); 732 languages_edit->setReadOnlyBgColor(LLColor4::transparent);
760 } 733 }
761} 734}
762 735
@@ -831,7 +804,7 @@ void LLPanelAvatarNotes::refresh()
831 804
832void LLPanelAvatarNotes::clearControls() 805void LLPanelAvatarNotes::clearControls()
833{ 806{
834 childSetText("notes edit", LOADING_MSG); 807 childSetText("notes edit", childGetText("Loading"));
835 childSetEnabled("notes edit", false); 808 childSetEnabled("notes edit", false);
836} 809}
837 810
@@ -1495,8 +1468,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1495 childSetEnabled("Offer Teleport...",FALSE); 1468 childSetEnabled("Offer Teleport...",FALSE);
1496 childSetVisible("drop target",FALSE); 1469 childSetVisible("drop target",FALSE);
1497 childSetEnabled("drop target",FALSE); 1470 childSetEnabled("drop target",FALSE);
1498 childSetVisible("Show on Map",FALSE); 1471 childSetVisible("Find on Map",FALSE);
1499 childSetEnabled("Show on Map",FALSE); 1472 childSetEnabled("Find on Map",FALSE);
1500 childSetVisible("Add Friend...",FALSE); 1473 childSetVisible("Add Friend...",FALSE);
1501 childSetEnabled("Add Friend...",FALSE); 1474 childSetEnabled("Add Friend...",FALSE);
1502 childSetVisible("Pay...",FALSE); 1475 childSetVisible("Pay...",FALSE);
@@ -1512,28 +1485,27 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1512 1485
1513 childSetVisible("Instant Message...",TRUE); 1486 childSetVisible("Instant Message...",TRUE);
1514 childSetEnabled("Instant Message...",FALSE); 1487 childSetEnabled("Instant Message...",FALSE);
1515 childSetToolTip("Instant Message...",IM_ENABLED_TOOLTIP);
1516 childSetVisible("Mute",TRUE); 1488 childSetVisible("Mute",TRUE);
1517 childSetEnabled("Mute",FALSE); 1489 childSetEnabled("Mute",FALSE);
1518 1490
1519 childSetVisible("drop target",TRUE); 1491 childSetVisible("drop target",TRUE);
1520 childSetEnabled("drop target",FALSE); 1492 childSetEnabled("drop target",FALSE);
1521 1493
1522 childSetVisible("Show on Map",TRUE); 1494 childSetVisible("Find on Map",TRUE);
1523 // Note: we don't always know online status, so always allow gods to try to track 1495 // Note: we don't always know online status, so always allow gods to try to track
1524 BOOL enable_track = gAgent.isGodlike() || is_agent_mappable(mAvatarID); 1496 BOOL enable_track = gAgent.isGodlike() || is_agent_mappable(mAvatarID);
1525 childSetEnabled("Show on Map",enable_track); 1497 childSetEnabled("Find on Map",enable_track);
1526 if (!mIsFriend) 1498 if (!mIsFriend)
1527 { 1499 {
1528 childSetToolTip("Show on Map",childGetValue("ShowOnMapNonFriend").asString()); 1500 childSetToolTip("Find on Map",childGetValue("ShowOnMapNonFriend").asString());
1529 } 1501 }
1530 else if (ONLINE_STATUS_YES != online_status) 1502 else if (ONLINE_STATUS_YES != online_status)
1531 { 1503 {
1532 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOffline").asString()); 1504 childSetToolTip("Find on Map",childGetValue("ShowOnMapFriendOffline").asString());
1533 } 1505 }
1534 else 1506 else
1535 { 1507 {
1536 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString()); 1508 childSetToolTip("Find on Map",childGetValue("ShowOnMapFriendOnline").asString());
1537 } 1509 }
1538 childSetVisible("Add Friend...", true); 1510 childSetVisible("Add Friend...", true);
1539 childSetEnabled("Add Friend...", !avatar_is_friend); 1511 childSetEnabled("Add Friend...", !avatar_is_friend);
@@ -1775,7 +1747,7 @@ void LLPanelAvatar::sendAvatarNotesUpdate()
1775 std::string notes = mPanelNotes->childGetValue("notes edit").asString(); 1747 std::string notes = mPanelNotes->childGetValue("notes edit").asString();
1776 1748
1777 if (!mHaveNotes 1749 if (!mHaveNotes
1778 && (notes.empty() || notes == LOADING_MSG)) 1750 && (notes.empty() || notes == childGetText("Loading")))
1779 { 1751 {
1780 // no notes from server and no user updates 1752 // no notes from server and no user updates
1781 return; 1753 return;
@@ -1856,11 +1828,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1856 allow_publish = (flags & AVATAR_ALLOW_PUBLISH); 1828 allow_publish = (flags & AVATAR_ALLOW_PUBLISH);
1857 online = (flags & AVATAR_ONLINE); 1829 online = (flags & AVATAR_ONLINE);
1858 1830
1859 EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO;
1860
1861 self->setOnlineStatus(online_status);
1862
1863 self->mPanelWeb->setWebURL(std::string(profile_url));
1864 U8 caption_index = 0; 1831 U8 caption_index = 0;
1865 LLString caption_text; 1832 LLString caption_text;
1866 charter_member_size = msg->getSize("PropertiesData", "CharterMember"); 1833 charter_member_size = msg->getSize("PropertiesData", "CharterMember");
@@ -1875,12 +1842,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1875 caption_text = caption; 1842 caption_text = caption;
1876 } 1843 }
1877 1844
1878 LLTextureCtrl* image_ctrl = LLUICtrlFactory::getTexturePickerByName(self->mPanelSecondLife,"img");
1879 if(image_ctrl)
1880 {
1881 image_ctrl->setImageAssetID(image_id);
1882 }
1883 self->childSetValue("about", about_text);
1884 1845
1885 if(caption_text.empty()) 1846 if(caption_text.empty())
1886 { 1847 {
@@ -1923,10 +1884,23 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1923 1884
1924 self->mPanelSecondLife->childSetValue("acct", caption_text); 1885 self->mPanelSecondLife->childSetValue("acct", caption_text);
1925 self->mPanelSecondLife->childSetValue("born", born_on); 1886 self->mPanelSecondLife->childSetValue("born", born_on);
1926 1887
1888 EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO;
1889
1890 self->setOnlineStatus(online_status);
1891
1892 self->mPanelWeb->setWebURL(std::string(profile_url));
1893
1894 LLTextureCtrl* image_ctrl = LLUICtrlFactory::getTexturePickerByName(self->mPanelSecondLife,"img");
1895 if(image_ctrl)
1896 {
1897 image_ctrl->setImageAssetID(image_id);
1898 }
1899 self->childSetValue("about", about_text);
1900
1927 self->mPanelSecondLife->setPartnerID(partner_id); 1901 self->mPanelSecondLife->setPartnerID(partner_id);
1928 self->mPanelSecondLife->updatePartnerName(); 1902 self->mPanelSecondLife->updatePartnerName();
1929 1903
1930 if (self->mPanelFirstLife) 1904 if (self->mPanelFirstLife)
1931 { 1905 {
1932 // Teens don't get these 1906 // Teens don't get these