aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:04 -0500
committerJacek Antonelli2008-08-15 23:45:04 -0500
commit117e22047c5752352342d64e3fb7ce00a4eb8113 (patch)
treee32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/newview/llpanelavatar.cpp
parentSecond Life viewer sources 1.18.0.6 (diff)
downloadmeta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index 0180bb3..b79993f 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -91,6 +91,7 @@ BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
91// RN: move these to lldbstrings.h 91// RN: move these to lldbstrings.h
92static const S32 DB_USER_FAVORITES_STR_LEN = 254; 92static const S32 DB_USER_FAVORITES_STR_LEN = 254;
93 93
94const char LOADING_MSG[] = "Loading...";
94static const char IM_DISABLED_TOOLTIP[] = "Instant Message (IM).\nDisabled because you do not have their card."; 95static const char IM_DISABLED_TOOLTIP[] = "Instant Message (IM).\nDisabled because you do not have their card.";
95static const char IM_ENABLED_TOOLTIP[] = "Instant Message (IM)"; 96static const char IM_ENABLED_TOOLTIP[] = "Instant Message (IM)";
96static const S32 LEFT = HPAD; 97static const S32 LEFT = HPAD;
@@ -830,7 +831,7 @@ void LLPanelAvatarNotes::refresh()
830 831
831void LLPanelAvatarNotes::clearControls() 832void LLPanelAvatarNotes::clearControls()
832{ 833{
833 childSetText("notes edit", "Loading..."); 834 childSetText("notes edit", LOADING_MSG);
834 childSetEnabled("notes edit", false); 835 childSetEnabled("notes edit", false);
835} 836}
836 837
@@ -1271,6 +1272,8 @@ LLPanelAvatar::LLPanelAvatar(
1271 mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID' 1272 mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID'
1272 mHaveProperties(FALSE), 1273 mHaveProperties(FALSE),
1273 mHaveStatistics(FALSE), 1274 mHaveStatistics(FALSE),
1275 mHaveNotes(false),
1276 mLastNotes(),
1274 mAllowEdit(allow_edit) 1277 mAllowEdit(allow_edit)
1275{ 1278{
1276 1279
@@ -1415,6 +1418,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1415 setOnlineStatus(online_status); 1418 setOnlineStatus(online_status);
1416 1419
1417 BOOL own_avatar = (mAvatarID == gAgent.getID() ); 1420 BOOL own_avatar = (mAvatarID == gAgent.getID() );
1421 BOOL avatar_is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL;
1418 1422
1419 mPanelSecondLife->enableControls(own_avatar && mAllowEdit); 1423 mPanelSecondLife->enableControls(own_avatar && mAllowEdit);
1420 mPanelWeb->enableControls(own_avatar && mAllowEdit); 1424 mPanelWeb->enableControls(own_avatar && mAllowEdit);
@@ -1460,6 +1464,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1460 1464
1461 mPanelNotes->clearControls(); 1465 mPanelNotes->clearControls();
1462 mPanelNotes->setDataRequested(false); 1466 mPanelNotes->setDataRequested(false);
1467 mHaveNotes = false;
1468 mLastNotes.clear();
1463 1469
1464 // Request just the first two pages of data. The picks, 1470 // Request just the first two pages of data. The picks,
1465 // classifieds, and notes will be requested when that panel 1471 // classifieds, and notes will be requested when that panel
@@ -1471,8 +1477,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1471 if (mAllowEdit) 1477 if (mAllowEdit)
1472 { 1478 {
1473 // OK button disabled until properties data arrives 1479 // OK button disabled until properties data arrives
1474 childSetVisible("OK",TRUE); 1480 childSetVisible("OK", true);
1475 childSetEnabled("OK",TRUE); 1481 childSetEnabled("OK", false);
1476 childSetVisible("Cancel",TRUE); 1482 childSetVisible("Cancel",TRUE);
1477 childSetEnabled("Cancel",TRUE); 1483 childSetEnabled("Cancel",TRUE);
1478 } 1484 }
@@ -1530,7 +1536,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1530 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString()); 1536 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString());
1531 } 1537 }
1532 childSetVisible("Add Friend...", true); 1538 childSetVisible("Add Friend...", true);
1533 childSetEnabled("Add Friend...", true); 1539 childSetEnabled("Add Friend...", !avatar_is_friend);
1534 childSetVisible("Pay...",TRUE); 1540 childSetVisible("Pay...",TRUE);
1535 childSetEnabled("Pay...",FALSE); 1541 childSetEnabled("Pay...",FALSE);
1536 } 1542 }
@@ -1604,12 +1610,12 @@ void LLPanelAvatar::resetGroupList()
1604void LLPanelAvatar::onClickIM(void* userdata) 1610void LLPanelAvatar::onClickIM(void* userdata)
1605{ 1611{
1606 LLPanelAvatar* self = (LLPanelAvatar*) userdata; 1612 LLPanelAvatar* self = (LLPanelAvatar*) userdata;
1607 gIMView->setFloaterOpen(TRUE); 1613 gIMMgr->setFloaterOpen(TRUE);
1608 1614
1609 std::string name; 1615 std::string name;
1610 LLNameEditor* nameedit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); 1616 LLNameEditor* nameedit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name");
1611 if (nameedit) name = nameedit->getText(); 1617 if (nameedit) name = nameedit->getText();
1612 gIMView->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); 1618 gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID);
1613} 1619}
1614 1620
1615 1621
@@ -1639,7 +1645,7 @@ void LLPanelAvatar::onClickAddFriend(void* userdata)
1639 LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); 1645 LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name");
1640 if (name_edit) 1646 if (name_edit)
1641 { 1647 {
1642 LLFloaterFriends::requestFriendshipDialog(self->getAvatarID(), 1648 LLPanelFriends::requestFriendshipDialog(self->getAvatarID(),
1643 name_edit->getText()); 1649 name_edit->getText());
1644 } 1650 }
1645} 1651}
@@ -1767,7 +1773,19 @@ void LLPanelAvatar::sendAvatarPropertiesRequest()
1767void LLPanelAvatar::sendAvatarNotesUpdate() 1773void LLPanelAvatar::sendAvatarNotesUpdate()
1768{ 1774{
1769 std::string notes = mPanelNotes->childGetValue("notes edit").asString(); 1775 std::string notes = mPanelNotes->childGetValue("notes edit").asString();
1770 1776
1777 if (!mHaveNotes
1778 && (notes.empty() || notes == LOADING_MSG))
1779 {
1780 // no notes from server and no user updates
1781 return;
1782 }
1783 if (notes == mLastNotes)
1784 {
1785 // Avatar notes unchanged
1786 return;
1787 }
1788
1771 LLMessageSystem *msg = gMessageSystem; 1789 LLMessageSystem *msg = gMessageSystem;
1772 1790
1773 msg->newMessage("AvatarNotesUpdate"); 1791 msg->newMessage("AvatarNotesUpdate");
@@ -2175,6 +2193,8 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
2175 msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text); 2193 msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text);
2176 self->childSetValue("notes edit", text); 2194 self->childSetValue("notes edit", text);
2177 self->childSetEnabled("notes edit", true); 2195 self->childSetEnabled("notes edit", true);
2196 self->mHaveNotes = true;
2197 self->mLastNotes = text;
2178 } 2198 }
2179} 2199}
2180 2200