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 ++++++++++++++++++++++
linden/indra/newview/llfloatergroups.h | 2 ++
.../skins/default/xui/en-us/panel_groups.xml | 2 ++
3 files changed, 36 insertions(+)
(limited to 'linden/indra')
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)
{
diff --git a/linden/indra/newview/llfloatergroups.h b/linden/indra/newview/llfloatergroups.h
index 5eda8ba..ad3ecac 100644
--- a/linden/indra/newview/llfloatergroups.h
+++ b/linden/indra/newview/llfloatergroups.h
@@ -110,6 +110,7 @@ protected:
static void onBtnLeave(void* userdata);
static void onBtnSearch(void* userdata);
static void onBtnVote(void* userdata);
+ static void onBtnInvite(void* userdata);
static void onDoubleClickGroup(void* userdata);
void create();
@@ -119,6 +120,7 @@ protected:
void leave();
void search();
void callVote();
+ void invite();
static void callbackLeaveGroup(S32 option, void* userdata);
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_groups.xml b/linden/indra/newview/skins/default/xui/en-us/panel_groups.xml
index 416f58b..02d5504 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_groups.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_groups.xml
@@ -34,4 +34,6 @@
label="Create..." name="Create" width="80" />
+
--
cgit v1.1