aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--linden/indra/newview/llfloatergroups.cpp82
-rw-r--r--linden/indra/newview/llfloatergroups.h1
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_groups.xml13
3 files changed, 82 insertions, 14 deletions
diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp
index f00489c..4ddacfd 100644
--- a/linden/indra/newview/llfloatergroups.cpp
+++ b/linden/indra/newview/llfloatergroups.cpp
@@ -65,7 +65,7 @@
65std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances; 65std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances;
66 66
67// helper functions 67// helper functions
68void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask = GP_ALL_POWERS); 68void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, bool group_picker, U64 powers_mask = GP_ALL_POWERS);
69 69
70///---------------------------------------------------------------------------- 70///----------------------------------------------------------------------------
71/// Class LLFloaterGroupPicker 71/// Class LLFloaterGroupPicker
@@ -121,7 +121,7 @@ void LLFloaterGroupPicker::setPowersMask(U64 powers_mask)
121BOOL LLFloaterGroupPicker::postBuild() 121BOOL LLFloaterGroupPicker::postBuild()
122{ 122{
123 const std::string none_text = getString("none"); 123 const std::string none_text = getString("none");
124 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, mPowersMask); 124 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, true, mPowersMask);
125 125
126 childSetAction("OK", onBtnOK, this); 126 childSetAction("OK", onBtnOK, this);
127 127
@@ -206,7 +206,7 @@ void LLPanelGroups::reset()
206 childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); 206 childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
207 207
208 const std::string none_text = getString("none"); 208 const std::string none_text = getString("none");
209 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text); 209 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, false);
210 enableButtons(); 210 enableButtons();
211} 211}
212 212
@@ -218,7 +218,7 @@ BOOL LLPanelGroups::postBuild()
218 childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); 218 childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
219 219
220 const std::string none_text = getString("none"); 220 const std::string none_text = getString("none");
221 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text); 221 init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text, false);
222 222
223 childSetAction("Activate", onBtnActivate, this); 223 childSetAction("Activate", onBtnActivate, this);
224 224
@@ -344,13 +344,13 @@ void LLPanelGroups::onBtnTitles(void* userdata)
344 344
345void LLPanelGroups::create() 345void LLPanelGroups::create()
346{ 346{
347 llinfos << "LLPanelGroups::create" << llendl; 347 //llinfos << "LLPanelGroups::create" << llendl;
348 LLFloaterGroupInfo::showCreateGroup(NULL); 348 LLFloaterGroupInfo::showCreateGroup(NULL);
349} 349}
350 350
351void LLPanelGroups::activate() 351void LLPanelGroups::activate()
352{ 352{
353 llinfos << "LLPanelGroups::activate" << llendl; 353 //llinfos << "LLPanelGroups::activate" << llendl;
354 LLCtrlListInterface *group_list = childGetListInterface("group list"); 354 LLCtrlListInterface *group_list = childGetListInterface("group list");
355 LLUUID group_id; 355 LLUUID group_id;
356 if (group_list) 356 if (group_list)
@@ -368,7 +368,7 @@ void LLPanelGroups::activate()
368 368
369void LLPanelGroups::info() 369void LLPanelGroups::info()
370{ 370{
371 llinfos << "LLPanelGroups::info" << llendl; 371 //llinfos << "LLPanelGroups::info" << llendl;
372 LLCtrlListInterface *group_list = childGetListInterface("group list"); 372 LLCtrlListInterface *group_list = childGetListInterface("group list");
373 LLUUID group_id; 373 LLUUID group_id;
374 if (group_list && (group_id = group_list->getCurrentID()).notNull()) 374 if (group_list && (group_id = group_list->getCurrentID()).notNull())
@@ -406,7 +406,7 @@ void LLPanelGroups::startIM()
406 406
407void LLPanelGroups::leave() 407void LLPanelGroups::leave()
408{ 408{
409 llinfos << "LLPanelGroups::leave" << llendl; 409 //llinfos << "LLPanelGroups::leave" << llendl;
410 LLCtrlListInterface *group_list = childGetListInterface("group list"); 410 LLCtrlListInterface *group_list = childGetListInterface("group list");
411 LLUUID group_id; 411 LLUUID group_id;
412 if (group_list && (group_id = group_list->getCurrentID()).notNull()) 412 if (group_list && (group_id = group_list->getCurrentID()).notNull())
@@ -446,7 +446,7 @@ void LLPanelGroups::invite()
446 group_id = group_list->getCurrentID(); 446 group_id = group_list->getCurrentID();
447 } 447 }
448 448
449 LLFloaterGroupInvite::showForGroup(group_id); 449 LLFloaterGroupInvite::showForGroup(group_id);
450} 450}
451 451
452void LLPanelGroups::titles() 452void LLPanelGroups::titles()
@@ -477,10 +477,15 @@ bool LLPanelGroups::callbackLeaveGroup(const LLSD& notification, const LLSD& res
477void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata) 477void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata)
478{ 478{
479 LLPanelGroups* self = (LLPanelGroups*)userdata; 479 LLPanelGroups* self = (LLPanelGroups*)userdata;
480 if(self) self->enableButtons(); 480 if (self)
481 {
482 self->enableButtons();
483 // check to see if group checkboxes have changed
484 self->applyChangesToGroups();
485 }
481} 486}
482 487
483void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask) 488void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, bool group_picker, U64 powers_mask)
484{ 489{
485 S32 count = gAgent.mGroups.count(); 490 S32 count = gAgent.mGroups.count();
486 LLUUID id; 491 LLUUID id;
@@ -501,6 +506,11 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const s
501 style = "BOLD"; 506 style = "BOLD";
502 } 507 }
503 508
509 // 0 - Group Name
510 // 1 - Group Notices
511 // 2 - Group Chat
512 // 3 - Group Listing in Profile
513
504 LLSD element; 514 LLSD element;
505 element["id"] = id; 515 element["id"] = id;
506 element["columns"][0]["column"] = "name"; 516 element["columns"][0]["column"] = "name";
@@ -508,6 +518,24 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const s
508 element["columns"][0]["font"] = "SANSSERIF"; 518 element["columns"][0]["font"] = "SANSSERIF";
509 element["columns"][0]["font-style"] = style; 519 element["columns"][0]["font-style"] = style;
510 520
521 if (!group_picker)
522 {
523 LLSD& receive_notices_column = element["columns"][1];
524 receive_notices_column["column"] = "receive_notices";
525 receive_notices_column["type"] = "checkbox";
526 receive_notices_column["value"] = group_datap->mAcceptNotices;
527
528 LLSD& join_group_chat_column = element["columns"][2];
529 join_group_chat_column["column"] = "join_group_chat";
530 join_group_chat_column["type"] = "checkbox";
531 join_group_chat_column["value"] = !gIMMgr->getIgnoreGroup(id);
532
533 LLSD& list_in_profile_column = element["columns"][3];
534 list_in_profile_column["column"] = "list_in_profile";
535 list_in_profile_column["type"] = "checkbox";
536 list_in_profile_column["value"] = group_datap->mListInProfile;
537 }
538
511 group_list->addElement(element, ADD_SORTED); 539 group_list->addElement(element, ADD_SORTED);
512 } 540 }
513 } 541 }
@@ -532,3 +560,35 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const s
532 group_list->selectByValue(highlight_id); 560 group_list->selectByValue(highlight_id);
533} 561}
534 562
563void LLPanelGroups::applyChangesToGroups()
564{
565 LLScrollListCtrl* group_list = getChild<LLScrollListCtrl>("group list");
566 if (group_list)
567 {
568 // just in case we want to allow selecting multiple groups ever
569 std::vector<LLScrollListItem*> selected = group_list->getAllSelected();
570 for (std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
571 {
572 LLUUID group_id = (*itr)->getValue();
573 BOOL receive_notices = (*itr)->getColumn(1)->getValue().asBoolean();
574 BOOL join_group_chat = (*itr)->getColumn(2)->getValue().asBoolean();
575 BOOL list_in_profile = (*itr)->getColumn(3)->getValue().asBoolean();
576
577 LLGroupData group_datap;
578 if (gAgent.getGroupData(group_id, group_datap))
579 {
580 // notices and profile
581 if ((receive_notices != group_datap.mAcceptNotices) || (list_in_profile != group_datap.mListInProfile))
582 {
583 gAgent.setUserGroupFlags(group_id, receive_notices, list_in_profile);
584 }
585
586 // chat
587 if (join_group_chat != (!gIMMgr->getIgnoreGroup(group_id)))
588 {
589 gIMMgr->updateIgnoreGroup(group_id, join_group_chat);
590 }
591 }
592 }
593 }
594}
diff --git a/linden/indra/newview/llfloatergroups.h b/linden/indra/newview/llfloatergroups.h
index c0d06e7..91021f0 100644
--- a/linden/indra/newview/llfloatergroups.h
+++ b/linden/indra/newview/llfloatergroups.h
@@ -102,6 +102,7 @@ protected:
102 102
103 // highlight_id is a group id to highlight 103 // highlight_id is a group id to highlight
104 void enableButtons(); 104 void enableButtons();
105 void applyChangesToGroups();
105 106
106 static void onGroupList(LLUICtrl* ctrl, void* userdata); 107 static void onGroupList(LLUICtrl* ctrl, void* userdata);
107 static void onBtnCreate(void* userdata); 108 static void onBtnCreate(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 e6b78fb..22967dc 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
@@ -1,12 +1,19 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="true" bottom="-371" height="300" left="280" mouse_opaque="true" 2<panel border="true" bottom="-371" height="300" left="280" mouse_opaque="true"
3 name="groups" width="350"> 3 name="groups" width="350" min_width="350">
4 <scroll_list background_visible="true" bottom="45" column_padding="5" draw_border="true" 4 <scroll_list background_visible="true" bottom="45" column_padding="5" draw_border="true"
5 draw_heading="false" draw_stripes="true" enabled="true" 5 draw_heading="true" draw_stripes="true" enabled="true"
6 follows="left|top|right|bottom" left="10" mouse_opaque="true" 6 follows="left|top|right|bottom" left="10" mouse_opaque="true"
7 multi_select="false" name="group list" tab_stop="true" top="-10" 7 multi_select="false" name="group list" tab_stop="true" top="-10"
8 width="240"> 8 width="240">
9 <column label="" name="name" width="248" /> 9 <column label="Group Name" name="name" dynamicwidth="true" />
10 <column label="Notices" name="receive_notices" width="60"
11 tool_tip="Receve notices from this group" />
12 <column label="Chat" name="join_group_chat" width="60"
13 tool_tip="Join group IMs (group chat) from this group" />
14 <column label="Public" name="list_in_profile" width="20"
15 image="ff_visible_online_button.tga"
16 tool_tip="Group is listed in your profile" />
10 </scroll_list> 17 </scroll_list>
11 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 18 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
12 bottom="22" drop_shadow_visible="true" enabled="true" follows="left|bottom" 19 bottom="22" drop_shadow_visible="true" enabled="true" follows="left|bottom"