summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-08 10:54:23 -0800
committerJames Cook <james@lindenlab.com>2010-03-08 10:54:23 -0800
commit18ebacefcfb5909a58a213a97c6a687afe9b877e (patch)
tree5b48ebad64a253bd9aa50371c2308389cbec64bf /indra/newview/llviewermenu.cpp
parent34d1d34ca100fd137c2a85f0e0f330730fb70aba (diff)
parent42606dbbb5f452211e4fc30ee0ed41334fc14e8d (diff)
Merge with viewer 2 beta 4
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp84
1 files changed, 16 insertions, 68 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bc3b8ac9d6..cb6844f9df 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -34,6 +34,7 @@
#include "llviewermenu.h"
// linden library includes
+#include "llavatarnamecache.h" // IDEVO
#include "llfloaterreg.h"
#include "llcombobox.h"
#include "llinventorypanel.h"
@@ -2767,9 +2768,8 @@ class LLObjectMute : public view_listener_t
LLNameValue *lastname = avatar->getNVPair("LastName");
if (firstname && lastname)
{
- name = firstname->getString();
- name += " ";
- name += lastname->getString();
+ name = LLCacheName::buildFullName(
+ firstname->getString(), lastname->getString());
}
type = LLMute::AGENT;
@@ -3115,58 +3115,6 @@ bool enable_freeze_eject(const LLSD& avatar_id)
return new_value;
}
-class LLAvatarGiveCard : public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- llinfos << "handle_give_card()" << llendl;
- LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- if(dest && dest->isAvatar())
- {
- bool found_name = false;
- LLSD args;
- LLSD old_args;
- LLNameValue* nvfirst = dest->getNVPair("FirstName");
- LLNameValue* nvlast = dest->getNVPair("LastName");
- if(nvfirst && nvlast)
- {
- args["FIRST"] = nvfirst->getString();
- args["LAST"] = nvlast->getString();
- old_args["FIRST"] = nvfirst->getString();
- old_args["LAST"] = nvlast->getString();
- found_name = true;
- }
- LLViewerRegion* region = dest->getRegion();
- LLHost dest_host;
- if(region)
- {
- dest_host = region->getHost();
- }
- if(found_name && dest_host.isOk())
- {
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("OfferCallingCard");
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_AgentBlock);
- msg->addUUIDFast(_PREHASH_DestID, dest->getID());
- LLUUID transaction_id;
- transaction_id.generate();
- msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
- msg->sendReliable(dest_host);
- LLNotificationsUtil::add("OfferedCard", args);
- }
- else
- {
- LLNotificationsUtil::add("CantOfferCallingCard", old_args);
- }
- }
- return true;
- }
-};
-
-
void login_done(S32 which, void *user)
{
@@ -3584,21 +3532,17 @@ void request_friendship(const LLUUID& dest_id)
LLViewerObject* dest = gObjectList.findObject(dest_id);
if(dest && dest->isAvatar())
{
- std::string fullname;
- LLSD args;
+ std::string full_name;
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
- args["FIRST"] = nvfirst->getString();
- args["LAST"] = nvlast->getString();
- fullname = nvfirst->getString();
- fullname += " ";
- fullname += nvlast->getString();
+ full_name = LLCacheName::buildFullName(
+ nvfirst->getString(), nvlast->getString());
}
- if (!fullname.empty())
+ if (!full_name.empty())
{
- LLAvatarActions::requestFriendshipDialog(dest_id, fullname);
+ LLAvatarActions::requestFriendshipDialog(dest_id, full_name);
}
else
{
@@ -5352,14 +5296,14 @@ void handle_look_at_selection(const LLSD& param)
distance = llmin(distance, (F32) orig_distance.length());
gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
- LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
- object_id );
+ LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
+ object_id );
}
else
{
gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
- }
+ }
}
}
@@ -7804,6 +7748,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole");
view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole");
view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole");
+
+ // IDEVO
+ commit.add("IDEVO.ToggleDisplayNames", boost::bind(&LLAvatarNameCache::toggleDisplayNames));
+ enable.add("IDEVO.CheckDisplayNames", boost::bind(&LLAvatarNameCache::useDisplayNames));
+
// Advanced > HUD Info
view_listener_t::addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo");
view_listener_t::addMenu(new LLAdvancedCheckHUDInfo(), "Advanced.CheckHUDInfo");
@@ -7982,7 +7931,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLAvatarDebug(), "Avatar.Debug");
view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug");
view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup");
- view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard");
commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD()));
view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call");