diff options
Diffstat (limited to 'indra/newview/llpanelprofile.cpp')
-rwxr-xr-x | indra/newview/llpanelprofile.cpp | 108 |
1 files changed, 64 insertions, 44 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 4f13c0c022..f91c4110c0 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -31,16 +31,29 @@ #include "llavataractions.h" #include "llfloaterreg.h" #include "llcommandhandler.h" +#include "llnotificationsutil.h" #include "llpanelpicks.h" #include "lltabcontainer.h" #include "llviewercontrol.h" +#include "llviewernetwork.h" +#include "llmutelist.h" +#include "llpanelblockedlist.h" +#include "llweb.h" static const std::string PANEL_PICKS = "panel_picks"; -static const std::string PANEL_PROFILE = "panel_profile"; std::string getProfileURL(const std::string& agent_name) { - std::string url = gSavedSettings.getString("WebProfileURL"); + std::string url; + + if (LLGridManager::getInstance()->isInProductionGrid()) + { + url = gSavedSettings.getString("WebProfileURL"); + } + else + { + url = gSavedSettings.getString("WebProfileNonProductionURL"); + } LLSD subs; subs["AGENT_NAME"] = agent_name; url = LLWeb::expandURLSubstitutions(url,subs); @@ -59,9 +72,9 @@ public: { if (params.size() < 1) return false; std::string agent_name = params[0]; - llinfos << "Profile, agent_name " << agent_name << llendl; + LL_INFOS() << "Profile, agent_name " << agent_name << LL_ENDL; std::string url = getProfileURL(agent_name); - LLWeb::loadWebURLInternal(url); + LLWeb::loadURLInternal(url); return true; } @@ -105,6 +118,12 @@ public: if (verb == "pay") { + if (!LLUI::sSettingGroups["config"]->getBOOL("EnableAvatarPay")) + { + LLNotificationsUtil::add("NoAvatarPay", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); + return true; + } + LLAvatarActions::pay(avatar_id); return true; } @@ -121,6 +140,12 @@ public: return true; } + if (verb == "removefriend") + { + LLAvatarActions::removeFriendDialog(avatar_id); + return true; + } + if (verb == "mute") { if (! LLAvatarActions::isBlocked(avatar_id)) @@ -139,6 +164,18 @@ public: return true; } + if (verb == "block") + { + if (params.size() > 2) + { + const std::string object_name = params[2].asString(); + LLMute mute(avatar_id, object_name, LLMute::OBJECT); + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + return true; + } + return false; } }; @@ -151,6 +188,23 @@ LLPanelProfile::ChildStack::ChildStack() { } +LLPanelProfile::ChildStack::~ChildStack() +{ + while (mStack.size() != 0) + { + view_list_t& top = mStack.back(); + for (view_list_t::const_iterator it = top.begin(); it != top.end(); ++it) + { + LLView* viewp = *it; + if (viewp) + { + viewp->die(); + } + } + mStack.pop_back(); + } +} + void LLPanelProfile::ChildStack::setParent(LLPanel* parent) { llassert_always(parent != NULL); @@ -178,7 +232,7 @@ bool LLPanelProfile::ChildStack::pop() { if (mStack.size() == 0) { - llwarns << "Empty stack" << llendl; + LL_WARNS() << "Empty stack" << LL_ENDL; llassert(mStack.size() == 0); return false; } @@ -217,7 +271,7 @@ void LLPanelProfile::ChildStack::postParentReshape() for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it) { LLView* viewp = *list_it; - lldebugs << "removing " << viewp->getName() << llendl; + LL_DEBUGS() << "removing " << viewp->getName() << LL_ENDL; mParent->removeChild(viewp); } } @@ -226,7 +280,7 @@ void LLPanelProfile::ChildStack::postParentReshape() void LLPanelProfile::ChildStack::dump() { unsigned lvl = 0; - lldebugs << "child stack dump:" << llendl; + LL_DEBUGS() << "child stack dump:" << LL_ENDL; for (stack_t::const_iterator stack_it = mStack.begin(); stack_it != mStack.end(); ++stack_it, ++lvl) { std::ostringstream dbg_line; @@ -236,7 +290,7 @@ void LLPanelProfile::ChildStack::dump() { dbg_line << " " << (*list_it)->getName(); } - lldebugs << dbg_line.str() << llendl; + LL_DEBUGS() << dbg_line.str() << LL_ENDL; } } @@ -244,7 +298,6 @@ void LLPanelProfile::ChildStack::dump() LLPanelProfile::LLPanelProfile() : LLPanel() - , mTabCtrl(NULL) , mAvatarId(LLUUID::null) { mChildStack.setParent(this); @@ -252,15 +305,10 @@ LLPanelProfile::LLPanelProfile() BOOL LLPanelProfile::postBuild() { - mTabCtrl = getChild<LLTabContainer>("tabs"); - - getTabCtrl()->setCommitCallback(boost::bind(&LLPanelProfile::onTabSelected, this, _2)); - LLPanelPicks* panel_picks = findChild<LLPanelPicks>(PANEL_PICKS); panel_picks->setProfilePanel(this); getTabContainer()[PANEL_PICKS] = panel_picks; - getTabContainer()[PANEL_PROFILE] = findChild<LLPanelAvatarProfile>(PANEL_PROFILE); return TRUE; } @@ -276,18 +324,7 @@ void LLPanelProfile::reshape(S32 width, S32 height, BOOL called_from_parent) void LLPanelProfile::onOpen(const LLSD& key) { - // open the desired panel - if (key.has("open_tab_name")) - { - getTabContainer()[PANEL_PICKS]->onClosePanel(); - - // onOpen from selected panel will be called from onTabSelected callback - getTabCtrl()->selectTabByName(key["open_tab_name"]); - } - else - { - getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId()); - } + getTabContainer()[PANEL_PICKS]->onOpen(getAvatarId()); // support commands to open further pieces of UI if (key.has("show_tab_panel")) @@ -345,23 +382,6 @@ void LLPanelProfile::onOpen(const LLSD& key) } } -void LLPanelProfile::togglePanel(LLPanel* panel, const LLSD& key) -{ - // TRUE - we need to open/expand "panel" - bool expand = getChildList()->front() != panel; // mTabCtrl->getVisible(); - - if (expand) - { - openPanel(panel, key); - } - else - { - closePanel(panel); - - getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId()); - } -} - void LLPanelProfile::onTabSelected(const LLSD& param) { std::string tab_name = param.asString(); @@ -415,7 +435,7 @@ void LLPanelProfile::closePanel(LLPanel* panel) } else { - llwarns << "No underlying panel to focus." << llendl; + LL_WARNS() << "No underlying panel to focus." << LL_ENDL; } } } |