Henri's Group Title picker.
Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -76,6 +76,7 @@ set(viewer_SOURCE_FILES
|
||||
dofloaterhex.cpp
|
||||
dohexeditor.cpp
|
||||
floatersculptpreview.cpp
|
||||
hbfloatergrouptitles.cpp
|
||||
hgfloatertexteditor.cpp
|
||||
hippogridmanager.cpp
|
||||
hipporestrequest.cpp
|
||||
@@ -525,6 +526,7 @@ set(viewer_HEADER_FILES
|
||||
dofloaterhex.h
|
||||
dohexeditor.h
|
||||
floatersculptpreview.h
|
||||
hbfloatergrouptitles.h
|
||||
hgfloatertexteditor.h
|
||||
hippogridmanager.h
|
||||
hipporestrequest.h
|
||||
|
||||
@@ -40,6 +40,22 @@
|
||||
<real>1.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>BeauchampFloaterGroupTitlesRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for group titles window</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>0</integer>
|
||||
<integer>400</integer>
|
||||
<integer>500</integer>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>ShyotlRenderUseStreamVBO</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -14156,9 +14172,8 @@
|
||||
<key>FloaterUploadRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for DicksDongs</string>
|
||||
<string>Rectangle for Uploader</string>
|
||||
<key>Persist</key>
|
||||
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
@@ -14169,6 +14184,33 @@
|
||||
<integer>850</integer>
|
||||
<integer>400</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>FloaterContactRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for Contact Group Manager</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>500</integer>
|
||||
<integer>450</integer>
|
||||
<integer>850</integer>
|
||||
<integer>400</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>ContactListCollapsed</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Send a digest of texture info to the sim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>FloaterHexRect</key>
|
||||
<map>
|
||||
|
||||
@@ -40,10 +40,12 @@
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloatergroups.h"
|
||||
#include "llfloatergroupinvite.h"
|
||||
|
||||
#include "message.h"
|
||||
#include "roles_constants.h"
|
||||
|
||||
#include "hbfloatergrouptitles.h"
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "llfloatergroupinfo.h"
|
||||
@@ -61,7 +63,7 @@
|
||||
std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances;
|
||||
|
||||
// helper functions
|
||||
void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask = GP_ALL_POWERS);
|
||||
void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask = GP_ALL_POWERS);
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Class LLFloaterGroupPicker
|
||||
@@ -116,7 +118,9 @@ void LLFloaterGroupPicker::setPowersMask(U64 powers_mask)
|
||||
|
||||
BOOL LLFloaterGroupPicker::postBuild()
|
||||
{
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), mPowersMask);
|
||||
|
||||
const std::string none_text = getString("none");
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, mPowersMask);
|
||||
|
||||
childSetAction("OK", onBtnOK, this);
|
||||
|
||||
@@ -200,7 +204,8 @@ void LLPanelGroups::reset()
|
||||
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
|
||||
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
|
||||
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
|
||||
const std::string none_text = getString("none");
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
|
||||
enableButtons();
|
||||
}
|
||||
|
||||
@@ -211,7 +216,8 @@ BOOL LLPanelGroups::postBuild()
|
||||
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
|
||||
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
|
||||
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
|
||||
const std::string none_text = getString("none");
|
||||
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
|
||||
|
||||
childSetAction("Activate", onBtnActivate, this);
|
||||
|
||||
@@ -224,6 +230,10 @@ BOOL LLPanelGroups::postBuild()
|
||||
childSetAction("Create", onBtnCreate, this);
|
||||
|
||||
childSetAction("Search...", onBtnSearch, this);
|
||||
|
||||
childSetAction("Invite...", onBtnInvite, this);
|
||||
|
||||
childSetAction("Titles...", onBtnTitles, this);
|
||||
|
||||
setDefaultBtn("IM");
|
||||
|
||||
@@ -272,6 +282,14 @@ void LLPanelGroups::enableButtons()
|
||||
{
|
||||
childDisable("Create");
|
||||
}
|
||||
if (group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE))
|
||||
{
|
||||
LLPanelGroups::childEnable("Invite...");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLPanelGroups::childDisable("Invite...");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,6 +299,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;
|
||||
@@ -311,6 +335,12 @@ void LLPanelGroups::onBtnSearch(void* userdata)
|
||||
if(self) self->search();
|
||||
}
|
||||
|
||||
void LLPanelGroups::onBtnTitles(void* userdata)
|
||||
{
|
||||
LLPanelGroups* self = (LLPanelGroups*)userdata;
|
||||
if(self) self->titles();
|
||||
}
|
||||
|
||||
void LLPanelGroups::create()
|
||||
{
|
||||
llinfos << "LLPanelGroups::create" << llendl;
|
||||
@@ -403,6 +433,27 @@ 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);
|
||||
}
|
||||
|
||||
void LLPanelGroups::titles()
|
||||
{
|
||||
HBFloaterGroupTitles::toggle();
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
bool LLPanelGroups::callbackLeaveGroup(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
@@ -428,7 +479,7 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata)
|
||||
if(self) self->enableButtons();
|
||||
}
|
||||
|
||||
void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask)
|
||||
void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask)
|
||||
{
|
||||
S32 count = gAgent.mGroups.count();
|
||||
LLUUID id;
|
||||
@@ -470,7 +521,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow
|
||||
LLSD element;
|
||||
element["id"] = LLUUID::null;
|
||||
element["columns"][0]["column"] = "name";
|
||||
element["columns"][0]["value"] = "none"; // *TODO: Translate
|
||||
element["columns"][0]["value"] = none_text;
|
||||
element["columns"][0]["font"] = "SANSSERIF";
|
||||
element["columns"][0]["font-style"] = style;
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@ protected:
|
||||
static void onBtnLeave(void* userdata);
|
||||
static void onBtnSearch(void* userdata);
|
||||
static void onBtnVote(void* userdata);
|
||||
static void onBtnInvite(void* userdata);
|
||||
static void onBtnTitles(void* userdata);
|
||||
static void onDoubleClickGroup(void* userdata);
|
||||
|
||||
void create();
|
||||
@@ -120,6 +122,8 @@ protected:
|
||||
void leave();
|
||||
void search();
|
||||
void callVote();
|
||||
void invite();
|
||||
void titles();
|
||||
|
||||
static bool callbackLeaveGroup(const LLSD& notification, const LLSD& response);
|
||||
|
||||
|
||||
@@ -18,4 +18,7 @@
|
||||
<button bottom="-236" font="SansSerif" halign="center" height="20" label="Cancel"
|
||||
label_selected="Cancel" left_delta="88" mouse_opaque="true" name="Cancel"
|
||||
width="80" />
|
||||
<string name="none">
|
||||
none
|
||||
</string>
|
||||
</floater>
|
||||
|
||||
@@ -34,7 +34,11 @@
|
||||
label="Create..." name="Create" width="80" />
|
||||
<button bottom_delta="-25" follows="top|right" font="SansSerif" height="22"
|
||||
label="Search..." name="Search..." width="80" />
|
||||
<button bottom_delta="-25" follows="top|right" font="SansSerif" height="22"
|
||||
<button bottom_delta="-25" follows="top|right" font="SansSerif" height="22"
|
||||
label="Invite..." name="Invite..." width="80" />
|
||||
|
||||
<button bottom_delta="-25" follows="top|right" font="SansSerif" height="22"
|
||||
label="Titles..." name="Titles..." width="80" />
|
||||
<string name="none">
|
||||
none
|
||||
</string>
|
||||
</panel>
|
||||
|
||||
Reference in New Issue
Block a user