From 3f27ba891ac4d032753b219b4b96d1ffbc9fb488 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:16 -0500 Subject: Second Life viewer sources 1.18.5.0-RC --- linden/indra/newview/llfloateravatarinfo.cpp | 150 +++++++++------------------ 1 file changed, 51 insertions(+), 99 deletions(-) (limited to 'linden/indra/newview/llfloateravatarinfo.cpp') diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index c7341b6..58fe1ab 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp @@ -1,6 +1,9 @@ /** * @file llfloateravatarinfo.cpp * @brief LLFloaterAvatarInfo class implementation + * Avatar information as shown in a floating window from right-click + * Profile. Used for editing your own avatar info. Just a wrapper + * for LLPanelAvatar, shared with the Find directory. * * $LicenseInfo:firstyear=2002&license=viewergpl$ * @@ -28,54 +31,42 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ - -/** - * Avatar information as shown in a floating window from right-click - * Profile. Used for editing your own avatar info. Just a wrapper - * for LLPanelAvatar, shared with the Find directory. - */ - -// system includes - -// linden prefix includes #include "llviewerprecompiledheaders.h" -// self include #include "llfloateravatarinfo.h" -// linden library includes -#include "llcachename.h" -#include "llfontgl.h" -#include "llinventory.h" -#include "message.h" - // viewer project includes #include "llagentdata.h" -#include "llbutton.h" -#include "llcallingcard.h" -#include "llcheckboxctrl.h" +//#include "llbutton.h" +//#include "llcallingcard.h" +//#include "llcheckboxctrl.h" +//#include "llcommandhandler.h" +//#include "llfloaterworldmap.h" +//#include "llfloatermute.h" +//#include "llinventoryview.h" +//#include "lllineeditor.h" +//#include "llmutelist.h" +//#include "llscrolllistctrl.h" +//#include "lltabcontainer.h" +//#include "llimview.h" +//#include "lluiconstants.h" +//#include "llviewerobject.h" +//#include "llviewerobjectlist.h" +//#include "llviewerregion.h" +//#include "llviewborder.h" +//#include "llinventorymodel.h" +//#include "lltextbox.h" +//#include "lltexturectrl.h" +//#include "llviewertexteditor.h" #include "llcommandhandler.h" -#include "llfloaterworldmap.h" -#include "llfloatermute.h" -#include "llinventoryview.h" -#include "lllineeditor.h" -#include "llmutelist.h" -#include "llscrolllistctrl.h" -#include "lltabcontainer.h" -#include "llimview.h" -#include "lluiconstants.h" -#include "llviewerobject.h" -#include "llviewerobjectlist.h" -#include "llviewerregion.h" -#include "llviewborder.h" -#include "llinventorymodel.h" -#include "lltextbox.h" -#include "lltexturectrl.h" -#include "llviewertexteditor.h" #include "llpanelavatar.h" - #include "llvieweruictrlfactory.h" +// linden library includes +#include "llinventory.h" +#include "lluuid.h" +#include "message.h" + const char FLOATER_TITLE[] = "Profile"; const LLRect FAI_RECT(0, 530, 420, 0); @@ -100,7 +91,7 @@ public: if (params[1] == "about") { - LLFloaterAvatarInfo::showFromDirectory(agent_id); + LLFloaterAvatarInfo::show(agent_id); return true; } return false; @@ -172,79 +163,52 @@ void LLFloaterAvatarInfo::resetGroupList() mPanelAvatarp->resetGroupList(); } - -// Open profile to a certian tab. // static -void LLFloaterAvatarInfo::showFromObject( - const LLUUID& avatar_id, - std::string tab_name) +LLFloaterAvatarInfo* LLFloaterAvatarInfo::show(const LLUUID &avatar_id) { - if(avatar_id.isNull()) + if (avatar_id.isNull()) { - return; + return NULL; } - LLFloaterAvatarInfo *floater = NULL; + LLFloaterAvatarInfo *floater; if (gAvatarInfoInstances.checkData(avatar_id)) { // ...bring that window to front floater = gAvatarInfoInstances.getData(avatar_id); + floater->open(); /*Flawfinder: ignore*/ } else { floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, - avatar_id); + avatar_id ); floater->center(); - floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); - + floater->open(); /*Flawfinder: ignore*/ } - floater->mPanelAvatarp->selectTabByName(tab_name); - floater->open(); /*Flawfinder: ignore*/ + return floater; } +// Open profile to a certain tab. // static -void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) +void LLFloaterAvatarInfo::showFromObject( + const LLUUID& avatar_id, + std::string tab_name) { - if(avatar_id.isNull()) + LLFloaterAvatarInfo *floater = show(avatar_id); + if (floater) { - return; - } - - LLFloaterAvatarInfo *floater; - if (gAvatarInfoInstances.checkData(avatar_id)) - { - // ...bring that window to front - floater = gAvatarInfoInstances.getData(avatar_id); - } - else - { - floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, - avatar_id); - floater->center(); floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); - } - if(floater) - { - floater->open(); + floater->mPanelAvatarp->selectTabByName(tab_name); } } - // static -void LLFloaterAvatarInfo::showFromAvatar(LLViewerObject *avatar) +void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) { - if (gAvatarInfoInstances.checkData(avatar->getID())) - { - // ...bring that window to front - LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData(avatar->getID()); - f->open(); /*Flawfinder: ignore*/ - } - else + LLFloaterAvatarInfo *floater = show(avatar_id); + if (floater) { - LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, - avatar->getID() ); - floater->center(); - floater->open(); /*Flawfinder: ignore*/ + floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); } } @@ -252,21 +216,9 @@ void LLFloaterAvatarInfo::showFromAvatar(LLViewerObject *avatar) // static void LLFloaterAvatarInfo::showFromFriend(const LLUUID& agent_id, BOOL online) { - if(agent_id.isNull()) + LLFloaterAvatarInfo *floater = show(agent_id); + if (floater) { - return; - } - if (gAvatarInfoInstances.checkData( agent_id )) - { - // ...bring that window to front - LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData( agent_id ); - f->open(); /*Flawfinder: ignore*/ - } - else - { - LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, - agent_id); - floater->center(); floater->mSuggestedOnlineStatus = online ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; } } -- cgit v1.1