diff options
author | brad kittenbrink <brad@lindenlab.com> | 2009-08-13 01:28:38 -0400 |
---|---|---|
committer | brad kittenbrink <brad@lindenlab.com> | 2009-08-13 01:28:38 -0400 |
commit | 39c2a584f47785c826c3bc133106f3689120bf32 (patch) | |
tree | 898695d92fc467672618f08260106ab773e456b5 /indra/newview/llgroupactions.cpp | |
parent | a15feff98c13cd693e60fc59345609c007de16db (diff) | |
parent | efd58603da6062d90a5d7019987409994bc73858 (diff) |
Merged latest viewer-2.0.0-3 change up through svn r130333 into login-api.
Diffstat (limited to 'indra/newview/llgroupactions.cpp')
-rw-r--r-- | indra/newview/llgroupactions.cpp | 126 |
1 files changed, 117 insertions, 9 deletions
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 30f4447283..b14f23f9cf 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -36,12 +36,74 @@ #include "llgroupactions.h" #include "llagent.h" -#include "llfloatergroupinfo.h" #include "llfloaterreg.h" #include "llimview.h" // for gIMMgr #include "llgroupmgr.h" #include "llavataractions.h" #include "llviewercontrol.h" +#include "llsidetray.h" + +#include "llcommandhandler.h" + +// +// Globals +// + +class LLGroupHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLGroupHandler() : LLCommandHandler("group", true) { } + bool handle(const LLSD& tokens, const LLSD& query_map, + LLWebBrowserCtrl* web) + { + if (tokens.size() < 1) + { + return false; + } + + if (tokens[0].asString() == "create") + { + LLGroupActions::createGroup(); + return true; + } + + if (tokens.size() < 2) + { + return false; + } + + if (tokens[0].asString() == "list") + { + if (tokens[1].asString() == "show") + { + LLFloaterReg::showInstance("contacts", "groups"); + return true; + } + return false; + } + + LLUUID group_id; + if (!group_id.set(tokens[0], FALSE)) + { + return false; + } + + if (tokens[1].asString() == "about") + { + if (group_id.isNull()) + return true; + + LLGroupActions::show(group_id); + + return true; + } + return false; + } +}; +LLGroupHandler gGroupHandler; + + // LLGroupActions::teleport helper // @@ -168,12 +230,6 @@ void LLGroupActions::search() } // static -void LLGroupActions::create() -{ - LLFloaterGroupInfo::showCreateGroup(NULL); -} - -// static void LLGroupActions::leave(const LLUUID& group_id) { if (group_id.isNull()) @@ -208,14 +264,66 @@ void LLGroupActions::activate(const LLUUID& group_id) gAgent.sendReliableMessage(); } +bool isGroupUIVisible() +{ + LLPanel* panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray"); + if(!panel) + return false; + return panel->getVisible(); +} + // static -void LLGroupActions::info(const LLUUID& group_id) +void LLGroupActions::show(const LLUUID& group_id) { if (group_id.isNull()) return; - LLFloaterGroupInfo::showFromUUID(group_id); + LLSD params; + params["group_id"] = group_id; + params["open_tab_name"] = "panel_group_info_sidetray"; + + LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); +} + +//static +void LLGroupActions::refresh(const LLUUID& group_id) +{ + if(!isGroupUIVisible()) + return; + + LLSD params; + params["group_id"] = group_id; + params["open_tab_name"] = "panel_group_info_sidetray"; + params["action"] = "refresh"; + + LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); +} + +//static +void LLGroupActions::createGroup() +{ + LLSD params; + params["group_id"] = LLUUID::null; + params["open_tab_name"] = "panel_group_info_sidetray"; + params["action"] = "create"; + + LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); + } +//static +void LLGroupActions::closeGroup(const LLUUID& group_id) +{ + if(!isGroupUIVisible()) + return; + + LLSD params; + params["group_id"] = group_id; + params["open_tab_name"] = "panel_group_info_sidetray"; + params["action"] = "close"; + + LLSideTray::getInstance()->showPanel("panel_group_info_sidetray", params); +} + // static void LLGroupActions::startChat(const LLUUID& group_id) |