diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-05-15 12:27:46 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-05-15 12:27:46 +0300 |
commit | e59216443619dd2280ce0fff316a2b9e2ee7cf5e (patch) | |
tree | 27d782916858596d67a60ecf56ca07b6a44a4601 /indra/newview/llpanelgroup.cpp | |
parent | dcb85f9f9d1019bb046a5719bc3645fa96a2d060 (diff) | |
parent | bb3c36f5cbc0c3b542045fd27255eee24e03da22 (diff) |
Merge branch 'main' into release/maint-c
# Conflicts:
# indra/llui/lltexteditor.cpp
# indra/newview/llcontrolavatar.cpp
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index de35aea35a..6b7680d19d 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -134,6 +134,15 @@ void LLPanelGroup::onOpen(const LLSD& key) if(panel_notices) panel_notices->refreshNotices(); } + if (str_action == "show_notices") + { + setGroupID(group_id); + + LLAccordionCtrl *tab_ctrl = getChild<LLAccordionCtrl>("groups_accordion"); + tab_ctrl->collapseAllTabs(); + getChild<LLAccordionCtrlTab>("group_notices_tab")->setDisplayChildren(true); + tab_ctrl->arrange(); + } } @@ -264,8 +273,15 @@ void LLPanelGroup::onBtnGroupChatClicked(void* user_data) void LLPanelGroup::onBtnJoin() { - LL_DEBUGS() << "joining group: " << mID << LL_ENDL; - LLGroupActions::join(mID); + if (LLGroupActions::isInGroup(mID)) + { + LLGroupActions::leave(mID); + } + else + { + LL_DEBUGS() << "joining group: " << mID << LL_ENDL; + LLGroupActions::join(mID); + } } void LLPanelGroup::changed(LLGroupChange gc) @@ -303,12 +319,17 @@ void LLPanelGroup::update(LLGroupChange gc) LLGroupData agent_gdatap; bool is_member = gAgent.getGroupData(mID,agent_gdatap) || gAgent.isGodlikeWithoutAdminMenuFakery(); - bool join_btn_visible = !is_member && gdatap->mOpenEnrollment; + bool join_btn_visible = is_member || gdatap->mOpenEnrollment; mButtonJoin->setVisible(join_btn_visible); mJoinText->setVisible(join_btn_visible); - if(join_btn_visible) + if (is_member) + { + mJoinText->setValue(getString("group_member")); + mButtonJoin->setLabel(getString("leave_txt")); + } + else if(join_btn_visible) { LLStringUtil::format_map_t string_args; std::string fee_buff; @@ -323,6 +344,7 @@ void LLPanelGroup::update(LLGroupChange gc) fee_buff = getString("group_join_free", string_args); } mJoinText->setValue(fee_buff); + mButtonJoin->setLabel(getString("join_txt")); } } } |