aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatergroups.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatergroups.cpp')
-rw-r--r--linden/indra/newview/llfloatergroups.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp
index 74526e1..5a442be 100644
--- a/linden/indra/newview/llfloatergroups.cpp
+++ b/linden/indra/newview/llfloatergroups.cpp
@@ -38,6 +38,7 @@
38#include "llfloatergroups.h" 38#include "llfloatergroups.h"
39 39
40#include "message.h" 40#include "message.h"
41#include "roles_constants.h"
41 42
42#include "llagent.h" 43#include "llagent.h"
43#include "llbutton.h" 44#include "llbutton.h"
@@ -56,7 +57,7 @@
56std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances; 57std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances;
57 58
58// helper functions 59// helper functions
59void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id); 60void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask = GP_ALL_POWERS);
60 61
61///---------------------------------------------------------------------------- 62///----------------------------------------------------------------------------
62/// Class LLFloaterGroupPicker 63/// Class LLFloaterGroupPicker
@@ -83,7 +84,8 @@ LLFloaterGroupPicker* LLFloaterGroupPicker::createInstance(const LLSD &seed)
83 84
84LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) : 85LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) :
85 mSelectCallback(NULL), 86 mSelectCallback(NULL),
86 mCallbackUserdata(NULL) 87 mCallbackUserdata(NULL),
88 mPowersMask(GP_ALL_POWERS)
87{ 89{
88 mID = seed.asUUID(); 90 mID = seed.asUUID();
89 sInstances.insert(std::make_pair(mID, this)); 91 sInstances.insert(std::make_pair(mID, this));
@@ -101,9 +103,16 @@ void LLFloaterGroupPicker::setSelectCallback(void (*callback)(LLUUID, void*),
101 mCallbackUserdata = userdata; 103 mCallbackUserdata = userdata;
102} 104}
103 105
106void LLFloaterGroupPicker::setPowersMask(U64 powers_mask)
107{
108 mPowersMask = powers_mask;
109 postBuild();
110}
111
112
104BOOL LLFloaterGroupPicker::postBuild() 113BOOL LLFloaterGroupPicker::postBuild()
105{ 114{
106 init_group_list(LLUICtrlFactory::getScrollListByName(this, "group list"), gAgent.getGroupID()); 115 init_group_list(LLUICtrlFactory::getScrollListByName(this, "group list"), gAgent.getGroupID(), mPowersMask);
107 116
108 childSetAction("OK", onBtnOK, this); 117 childSetAction("OK", onBtnOK, this);
109 118
@@ -414,7 +423,7 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata)
414 if(self) self->enableButtons(); 423 if(self) self->enableButtons();
415} 424}
416 425
417void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id) 426void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask)
418{ 427{
419 S32 count = gAgent.mGroups.count(); 428 S32 count = gAgent.mGroups.count();
420 LLUUID id; 429 LLUUID id;
@@ -427,20 +436,22 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id)
427 { 436 {
428 id = gAgent.mGroups.get(i).mID; 437 id = gAgent.mGroups.get(i).mID;
429 LLGroupData* group_datap = &gAgent.mGroups.get(i); 438 LLGroupData* group_datap = &gAgent.mGroups.get(i);
430 LLString style = "NORMAL"; 439 if ((group_datap->mPowers & powers_mask) != 0) {
431 if(highlight_id == id) 440 LLString style = "NORMAL";
432 { 441 if(highlight_id == id)
433 style = "BOLD"; 442 {
443 style = "BOLD";
444 }
445
446 LLSD element;
447 element["id"] = id;
448 element["columns"][0]["column"] = "name";
449 element["columns"][0]["value"] = group_datap->mName;
450 element["columns"][0]["font"] = "SANSSERIF";
451 element["columns"][0]["font-style"] = style;
452
453 group_list->addElement(element, ADD_SORTED);
434 } 454 }
435
436 LLSD element;
437 element["id"] = id;
438 element["columns"][0]["column"] = "name";
439 element["columns"][0]["value"] = group_datap->mName;
440 element["columns"][0]["font"] = "SANSSERIF";
441 element["columns"][0]["font-style"] = style;
442
443 group_list->addElement(element, ADD_SORTED);
444 } 455 }
445 456
446 // add "none" to list at top 457 // add "none" to list at top