aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-18 17:58:27 -0700
committerMcCabe Maxsted2009-10-18 17:58:27 -0700
commite4b0e7c82d670081c071d8a3da31b5ec407b8e07 (patch)
tree9410962bbb582eedbec448139e217f2714050777 /linden/indra/newview/llpanelavatar.cpp
parentStarted 1.3.0 branch (diff)
parentUpdated and added some Linux libs. (diff)
downloadmeta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.zip
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.gz
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.bz2
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.xz
Merged working branch of 1.2 into LL 1.23 merge
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp172
1 files changed, 138 insertions, 34 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index ed7a71b..489f0d3 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -52,6 +52,7 @@
52 52
53#include "llfloaterfriends.h" 53#include "llfloaterfriends.h"
54#include "llfloatergroupinfo.h" 54#include "llfloatergroupinfo.h"
55#include "llfloatergroups.h"
55#include "llfloaterworldmap.h" 56#include "llfloaterworldmap.h"
56#include "llfloatermute.h" 57#include "llfloatermute.h"
57#include "llfloateravatarinfo.h" 58#include "llfloateravatarinfo.h"
@@ -84,6 +85,7 @@
84std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; 85std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
85BOOL LLPanelAvatar::sAllowFirstLife = FALSE; 86BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
86 87
88extern void callback_invite_to_group(LLUUID group_id, void *user_data);
87extern void handle_lure(const LLUUID& invitee); 89extern void handle_lure(const LLUUID& invitee);
88extern void handle_pay_by_id(const LLUUID& payee); 90extern void handle_pay_by_id(const LLUUID& payee);
89 91
@@ -365,6 +367,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
365 367
366 childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); 368 childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar());
367 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); 369 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar());
370 childSetAction("Invite to Group...", LLPanelAvatar::onClickGroupInvite, getPanelAvatar());
368 371
369 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); 372 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar());
370 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); 373 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar());
@@ -731,6 +734,9 @@ void LLPanelAvatarClassified::refresh()
731 S32 tab_count = tabs ? tabs->getTabCount() : 0; 734 S32 tab_count = tabs ? tabs->getTabCount() : 0;
732 735
733 bool allow_new = tab_count < MAX_CLASSIFIEDS; 736 bool allow_new = tab_count < MAX_CLASSIFIEDS;
737// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
738 allow_new &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC);
739// [/RLVa:KB]
734 bool allow_delete = (tab_count > 0); 740 bool allow_delete = (tab_count > 0);
735 bool show_help = (tab_count == 0); 741 bool show_help = (tab_count == 0);
736 742
@@ -866,6 +872,12 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg,
866// static 872// static
867void LLPanelAvatarClassified::onClickNew(void* data) 873void LLPanelAvatarClassified::onClickNew(void* data)
868{ 874{
875// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a)
876 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
877 {
878 return;
879 }
880// [/RLVa:KB]
869 LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; 881 LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data;
870 882
871 LLNotifications::instance().add("AddClassified", LLSD(), LLSD(), boost::bind(&LLPanelAvatarClassified::callbackNew, self, _1, _2)); 883 LLNotifications::instance().add("AddClassified", LLSD(), LLSD(), boost::bind(&LLPanelAvatarClassified::callbackNew, self, _1, _2));
@@ -961,7 +973,10 @@ void LLPanelAvatarPicks::refresh()
961 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); 973 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID());
962 LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); 974 LLTabContainer* tabs = getChild<LLTabContainer>("picks tab");
963 S32 tab_count = tabs ? tabs->getTabCount() : 0; 975 S32 tab_count = tabs ? tabs->getTabCount() : 0;
964 childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); 976// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
977 childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) );
978// [/RLVa:KB]
979 //childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS);
965 childSetEnabled("Delete...", self && tab_count > 0); 980 childSetEnabled("Delete...", self && tab_count > 0);
966 childSetVisible("New...", self && getPanelAvatar()->isEditable()); 981 childSetVisible("New...", self && getPanelAvatar()->isEditable());
967 childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); 982 childSetVisible("Delete...", self && getPanelAvatar()->isEditable());
@@ -1039,6 +1054,12 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1039// static 1054// static
1040void LLPanelAvatarPicks::onClickNew(void* data) 1055void LLPanelAvatarPicks::onClickNew(void* data)
1041{ 1056{
1057// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
1058 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1059 {
1060 return;
1061 }
1062// [/RLVa:KB]
1042 LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; 1063 LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data;
1043 LLPanelPick* panel_pick = new LLPanelPick(FALSE); 1064 LLPanelPick* panel_pick = new LLPanelPick(FALSE);
1044 LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); 1065 LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab");
@@ -1238,14 +1259,6 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
1238 1259
1239 mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES)); 1260 mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES));
1240 1261
1241 // Since setOnlineStatus gets called after setAvatarID
1242 // need to make sure that "Offer Teleport" doesn't get set
1243 // to TRUE again for yourself
1244 if (mAvatarID != gAgent.getID())
1245 {
1246 childSetVisible("Offer Teleport...",TRUE);
1247 }
1248
1249 BOOL in_prelude = gAgent.inPrelude(); 1262 BOOL in_prelude = gAgent.inPrelude();
1250 if(gAgent.isGodlike()) 1263 if(gAgent.isGodlike())
1251 { 1264 {
@@ -1262,6 +1275,18 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
1262 childSetEnabled("Offer Teleport...", TRUE); 1275 childSetEnabled("Offer Teleport...", TRUE);
1263 childSetToolTip("Offer Teleport...", childGetValue("TeleportNormal").asString()); 1276 childSetToolTip("Offer Teleport...", childGetValue("TeleportNormal").asString());
1264 } 1277 }
1278
1279 // Since setOnlineStatus gets called after setAvatarID
1280 // need to make sure that "Offer Teleport" doesn't get set
1281 // to TRUE again for yourself
1282 if (mAvatarID != gAgent.getID())
1283 {
1284 childSetVisible("Offer Teleport...",TRUE);
1285 }
1286 else
1287 {
1288 childSetEnabled("Offer Teleport...", FALSE);
1289 }
1265} 1290}
1266 1291
1267void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name, 1292void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name,
@@ -1354,20 +1379,30 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1354 childSetVisible("Cancel",FALSE); 1379 childSetVisible("Cancel",FALSE);
1355 childSetEnabled("Cancel",FALSE); 1380 childSetEnabled("Cancel",FALSE);
1356 } 1381 }
1357 childSetVisible("Instant Message...",FALSE); 1382 //childSetVisible("Instant Message...",FALSE);
1358 childSetEnabled("Instant Message...",FALSE); 1383 childSetEnabled("Instant Message...",FALSE);
1359 childSetVisible("Mute",FALSE); 1384 //childSetVisible("Invite to Group...",FALSE);
1385 childSetEnabled("Invite to Group...",FALSE);
1386 //childSetVisible("Mute",FALSE);
1360 childSetEnabled("Mute",FALSE); 1387 childSetEnabled("Mute",FALSE);
1361 childSetVisible("Offer Teleport...",FALSE); 1388 //childSetVisible("Offer Teleport...",FALSE);
1362 childSetEnabled("Offer Teleport...",FALSE); 1389 childSetEnabled("Offer Teleport...",FALSE);
1363 childSetVisible("drop target",FALSE); 1390 //childSetVisible("drop target",FALSE);
1364 childSetEnabled("drop target",FALSE); 1391 childSetEnabled("drop target",FALSE);
1365 childSetVisible("Find on Map",FALSE); 1392 //childSetVisible("Find on Map",FALSE);
1366 childSetEnabled("Find on Map",FALSE); 1393 childSetEnabled("Find on Map",FALSE);
1367 childSetVisible("Add Friend...",FALSE); 1394 //childSetVisible("Add Friend...",FALSE);
1368 childSetEnabled("Add Friend...",FALSE); 1395 childSetEnabled("Add Friend...",FALSE);
1369 childSetVisible("Pay...",FALSE); 1396 //childSetVisible("Pay...",FALSE);
1370 childSetEnabled("Pay...",FALSE); 1397 childSetEnabled("Pay...",FALSE);
1398 childSetVisible("Kick",FALSE);
1399 childSetEnabled("Kick",FALSE);
1400 childSetVisible("Freeze",FALSE);
1401 childSetEnabled("Freeze",FALSE);
1402 childSetVisible("Unfreeze",FALSE);
1403 childSetEnabled("Unfreeze",FALSE);
1404 childSetVisible("csr_btn", FALSE);
1405 childSetEnabled("csr_btn", FALSE);
1371 } 1406 }
1372 else 1407 else
1373 { 1408 {
@@ -1379,6 +1414,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1379 1414
1380 childSetVisible("Instant Message...",TRUE); 1415 childSetVisible("Instant Message...",TRUE);
1381 childSetEnabled("Instant Message...",FALSE); 1416 childSetEnabled("Instant Message...",FALSE);
1417 childSetVisible("Invite to Group...",TRUE);
1418 childSetEnabled("Invite to Group...",FALSE);
1382 childSetVisible("Mute",TRUE); 1419 childSetVisible("Mute",TRUE);
1383 childSetEnabled("Mute",FALSE); 1420 childSetEnabled("Mute",FALSE);
1384 1421
@@ -1405,20 +1442,20 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1405 childSetEnabled("Add Friend...", !avatar_is_friend); 1442 childSetEnabled("Add Friend...", !avatar_is_friend);
1406 childSetVisible("Pay...",TRUE); 1443 childSetVisible("Pay...",TRUE);
1407 childSetEnabled("Pay...",FALSE); 1444 childSetEnabled("Pay...",FALSE);
1445
1446 BOOL is_god = FALSE;
1447 if (gAgent.isGodlike()) is_god = TRUE;
1448
1449 childSetVisible("Kick", is_god);
1450 childSetEnabled("Kick", is_god);
1451 childSetVisible("Freeze", is_god);
1452 childSetEnabled("Freeze", is_god);
1453 childSetVisible("Unfreeze", is_god);
1454 childSetEnabled("Unfreeze", is_god);
1455 childSetVisible("csr_btn", is_god);
1456 childSetEnabled("csr_btn", is_god);
1408 } 1457 }
1409 } 1458 }
1410
1411 BOOL is_god = FALSE;
1412 if (gAgent.isGodlike()) is_god = TRUE;
1413
1414 childSetVisible("Kick", is_god);
1415 childSetEnabled("Kick", is_god);
1416 childSetVisible("Freeze", is_god);
1417 childSetEnabled("Freeze", is_god);
1418 childSetVisible("Unfreeze", is_god);
1419 childSetEnabled("Unfreeze", is_god);
1420 childSetVisible("csr_btn", is_god);
1421 childSetEnabled("csr_btn", is_god);
1422} 1459}
1423 1460
1424 1461
@@ -1461,9 +1498,18 @@ void LLPanelAvatar::resetGroupList()
1461 LLSD row; 1498 LLSD row;
1462 1499
1463 row["id"] = id ; 1500 row["id"] = id ;
1464 row["columns"][0]["value"] = group_string;
1465 row["columns"][0]["font"] = "SANSSERIF_SMALL"; 1501 row["columns"][0]["font"] = "SANSSERIF_SMALL";
1466 row["columns"][0]["width"] = 0; 1502 row["columns"][0]["width"] = 0;
1503 if (group_data.mListInProfile)
1504 {
1505 row["columns"][0]["value"] = group_string;
1506 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue();
1507 }
1508 else
1509 {
1510 row["columns"][0]["value"] = group_string + " " + getString("HiddenLabel");
1511 row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue();
1512 }
1467 group_list->addElement(row); 1513 group_list->addElement(row);
1468 } 1514 }
1469 group_list->sortByColumnIndex(0, TRUE); 1515 group_list->sortByColumnIndex(0, TRUE);
@@ -1486,6 +1532,22 @@ void LLPanelAvatar::onClickIM(void* userdata)
1486 gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); 1532 gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID);
1487} 1533}
1488 1534
1535void LLPanelAvatar::onClickGroupInvite(void* userdata)
1536{
1537 LLPanelAvatar* self = (LLPanelAvatar*) userdata;
1538 if (self->getAvatarID().notNull())
1539 {
1540 LLFloaterGroupPicker* widget;
1541 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
1542 if (widget)
1543 {
1544 widget->center();
1545 widget->setPowersMask(GP_MEMBER_INVITE);
1546 widget->setSelectCallback(callback_invite_to_group, (void *)&(self->getAvatarID()));
1547 }
1548 }
1549}
1550
1489 1551
1490// static 1552// static
1491//----------------------------------------------------------------------------- 1553//-----------------------------------------------------------------------------
@@ -1702,11 +1764,27 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1702 { 1764 {
1703 continue; 1765 continue;
1704 } 1766 }
1705 self->childSetEnabled("Instant Message...",TRUE);
1706 self->childSetEnabled("Pay...",TRUE);
1707 self->childSetEnabled("Mute",TRUE);
1708 1767
1709 self->childSetEnabled("drop target",TRUE); 1768 if (self->mAvatarID == agent_id)
1769 {
1770 self->childSetEnabled("Instant Message...",FALSE);
1771 self->childSetEnabled("Invite to Group...",FALSE);
1772 self->childSetEnabled("Pay...",FALSE);
1773 self->childSetEnabled("Mute",FALSE);
1774
1775 self->childSetVisible("drop target",FALSE);
1776 self->childSetEnabled("drop target",FALSE);
1777 }
1778 else
1779 {
1780 self->childSetEnabled("Instant Message...",TRUE);
1781 self->childSetEnabled("Invite to Group...",TRUE);
1782 self->childSetEnabled("Pay...",TRUE);
1783 self->childSetEnabled("Mute",TRUE);
1784
1785 self->childSetVisible("drop target",TRUE);
1786 self->childSetEnabled("drop target",TRUE);
1787 }
1710 1788
1711 self->mHaveProperties = TRUE; 1789 self->mHaveProperties = TRUE;
1712 self->enableOKIfReady(); 1790 self->enableOKIfReady();
@@ -1923,8 +2001,34 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
1923 2001
1924 LLSD row; 2002 LLSD row;
1925 row["id"] = group_id; 2003 row["id"] = group_id;
1926 row["columns"][0]["value"] = group_string;
1927 row["columns"][0]["font"] = "SANSSERIF_SMALL"; 2004 row["columns"][0]["font"] = "SANSSERIF_SMALL";
2005
2006 LLGroupData *group_data = NULL;
2007
2008 if (avatar_id == agent_id) // own avatar
2009 {
2010 // Search for this group in the agent's groups list
2011 LLDynamicArray<LLGroupData>::iterator i;
2012 for (i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); i++)
2013 {
2014 if (i->mID == group_id)
2015 {
2016 group_data = &*i;
2017 break;
2018 }
2019 }
2020 }
2021 // Set normal color if not found or if group is visible in profile
2022 if (!group_data || group_data->mListInProfile)
2023 {
2024 row["columns"][0]["value"] = group_string;
2025 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue();
2026 }
2027 else
2028 {
2029 row["columns"][0]["value"] = group_string + " " + self->getString("HiddenLabel");
2030 row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue();
2031 }
1928 if (group_list) 2032 if (group_list)
1929 { 2033 {
1930 group_list->addElement(row); 2034 group_list->addElement(row);