From acc9543916089ede930df2363e91247c80bec5d1 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 19 Sep 2008 19:38:00 -0500 Subject: VWR-8024: simplify group invites: invite to group from groups list. --- linden/indra/newview/llfloatergroups.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'linden/indra/newview/llfloatergroups.cpp') diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp index f6e226d..01624c6 100644 --- a/linden/indra/newview/llfloatergroups.cpp +++ b/linden/indra/newview/llfloatergroups.cpp @@ -39,6 +39,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloatergroups.h" +#include "llfloatergroupinvite.h" #include "message.h" #include "roles_constants.h" @@ -223,6 +224,8 @@ BOOL LLPanelGroups::postBuild() childSetAction("Create", onBtnCreate, this); childSetAction("Search...", onBtnSearch, this); + + childSetAction("Invite...", onBtnInvite, this); setDefaultBtn("IM"); @@ -271,6 +274,14 @@ void LLPanelGroups::enableButtons() { childDisable("Create"); } + if (group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE)) + { + LLPanelGroups::childEnable("Invite..."); + } + else + { + LLPanelGroups::childDisable("Invite..."); + } } @@ -280,6 +291,12 @@ void LLPanelGroups::onBtnCreate(void* userdata) if(self) self->create(); } +void LLPanelGroups::onBtnInvite(void* userdata) +{ + LLPanelGroups* self = (LLPanelGroups*)userdata; + if(self) self->invite(); +} + void LLPanelGroups::onBtnActivate(void* userdata) { LLPanelGroups* self = (LLPanelGroups*)userdata; @@ -401,6 +418,21 @@ void LLPanelGroups::search() LLFloaterDirectory::showGroups(); } +void LLPanelGroups::invite() +{ + LLCtrlListInterface *group_list = childGetListInterface("group list"); + LLUUID group_id; + + //if (group_list && (group_id = group_list->getCurrentID()).notNull()) + + if (group_list) + { + group_id = group_list->getCurrentID(); + } + + LLFloaterGroupInvite::showForGroup(group_id); +} + // static void LLPanelGroups::callbackLeaveGroup(S32 option, void* userdata) { -- cgit v1.1