From 0bf4b5f2222ffb8171be094613363427f3b8470a Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 12 Aug 2009 01:12:27 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll@1277 https://svn.aws.productengine.com/secondlife/pe/stable-1@1297 -> viewer-2-0 Fixes: EXT 208 EXT 366 EXT-211 EXT-245 EXT-246 EXT-278 EXT-279 EXT-280 EXT-298 EXT-301 EXT-304 EXT-311 EXT-317 EXT-318 EXT-319 EXT-339 EXT-343 EXT-344 EXT-346 EXT-349 EXT-350 EXT-351 EXT-354 EXT-355 EXT-358 EXT-360 EXT-362 EXT-369 EXT-372 EXT-374 EXT-381 EXT-382 EXT-383 EXT-395 EXT-396 EXT-412 Other changes: Movement & Caemra controls work Profile and Me panel refactoring Notification refactoring --- indra/newview/llpanelgrouproles.cpp | 95 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 47 deletions(-) (limited to 'indra/newview/llpanelgrouproles.cpp') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 50e1f84cad..ab614fea53 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -55,6 +55,8 @@ #include "roles_constants.h" +static LLRegisterPanelClassWrapper t_panel_group_roles("panel_group_roles"); + bool agentCanRemoveFromRole(const LLUUID& group_id, const LLUUID& role_id) { @@ -108,14 +110,9 @@ bool agentCanAddToRole(const LLUUID& group_id, } // static -void* LLPanelGroupRoles::createTab(void* data) -{ - LLUUID* group_id = static_cast(data); - return new LLPanelGroupRoles(*group_id); -} -LLPanelGroupRoles::LLPanelGroupRoles(const LLUUID& group_id) -: LLPanelGroupTab(group_id), +LLPanelGroupRoles::LLPanelGroupRoles() +: LLPanelGroupTab(), mCurrentTab(NULL), mRequestedTab( NULL ), mSubTabContainer( NULL ), @@ -126,13 +123,6 @@ LLPanelGroupRoles::LLPanelGroupRoles(const LLUUID& group_id) LLPanelGroupRoles::~LLPanelGroupRoles() { - int i; - for (i = 0; i < mSubTabContainer->getTabCount(); ++i) - { - LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i); - - subtabp->removeObserver(this); - } } BOOL LLPanelGroupRoles::postBuild() @@ -161,7 +151,7 @@ BOOL LLPanelGroupRoles::postBuild() if (!subtabp->postBuildSubTab(this)) return FALSE; - subtabp->addObserver(this); + //subtabp->addObserver(this); } // Set the current tab to whatever is currently being shown. @@ -387,7 +377,8 @@ std::string LLPanelGroupRoles::getHelpText() const void LLPanelGroupRoles::update(LLGroupChange gc) { if (mGroupID.isNull()) return; - + + LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); if (panelp) { @@ -397,6 +388,7 @@ void LLPanelGroupRoles::update(LLGroupChange gc) { llwarns << "LLPanelGroupRoles::update() -- No subtab to update!" << llendl; } + } void LLPanelGroupRoles::activate() @@ -464,17 +456,12 @@ BOOL LLPanelGroupRoles::hasModal() return panelp->hasModal(); } -// PanelGroupTab observer trigger -void LLPanelGroupRoles::tabChanged() -{ - notifyObservers(); -} //////////////////////////// // LLPanelGroupSubTab //////////////////////////// -LLPanelGroupSubTab::LLPanelGroupSubTab(const LLUUID& group_id) -: LLPanelGroupTab(group_id), +LLPanelGroupSubTab::LLPanelGroupSubTab() +: LLPanelGroupTab(), mHeader(NULL), mFooter(NULL), mSearchLineEditor(NULL), @@ -847,15 +834,11 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) // LLPanelGroupMembersSubTab //////////////////////////// -// static -void* LLPanelGroupMembersSubTab::createTab(void* data) -{ - LLUUID* group_id = static_cast(data); - return new LLPanelGroupMembersSubTab(*group_id); -} -LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab(const LLUUID& group_id) -: LLPanelGroupSubTab(group_id), +static LLRegisterPanelClassWrapper t_panel_group_members_subtab("panel_group_members_subtab"); + +LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab() +: LLPanelGroupSubTab(), mMembersList(NULL), mAssignedRolesList(NULL), mAllowedActionsList(NULL), @@ -1708,15 +1691,10 @@ void LLPanelGroupMembersSubTab::updateMembers() // LLPanelGroupRolesSubTab //////////////////////////// -// static -void* LLPanelGroupRolesSubTab::createTab(void* data) -{ - LLUUID* group_id = static_cast(data); - return new LLPanelGroupRolesSubTab(*group_id); -} +static LLRegisterPanelClassWrapper t_panel_group_roles_subtab("panel_group_roles_subtab"); -LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const LLUUID& group_id) - : LLPanelGroupSubTab(group_id), +LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() + : LLPanelGroupSubTab(), mRolesList(NULL), mAssignedMembersList(NULL), mAllowedActionsList(NULL), @@ -2418,15 +2396,11 @@ void LLPanelGroupRolesSubTab::saveRoleChanges() // LLPanelGroupActionsSubTab //////////////////////////// -// static -void* LLPanelGroupActionsSubTab::createTab(void* data) -{ - LLUUID* group_id = static_cast(data); - return new LLPanelGroupActionsSubTab(*group_id); -} +static LLRegisterPanelClassWrapper t_panel_group_actions_subtab("panel_group_actions_subtab"); -LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab(const LLUUID& group_id) -: LLPanelGroupSubTab(group_id) + +LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab() +: LLPanelGroupSubTab() { } @@ -2598,3 +2572,30 @@ void LLPanelGroupActionsSubTab::handleActionSelect() LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); } } +void LLPanelGroupRoles::setGroupID(const LLUUID& id) +{ + LLPanelGroupTab::setGroupID(id); + + LLPanelGroupMembersSubTab* group_members_tab = findChild("members_sub_tab"); + LLPanelGroupRolesSubTab* group_roles_tab = findChild("roles_sub_tab"); + LLPanelGroupActionsSubTab* group_actions_tab = findChild("actions_sub_tab"); + + if(group_members_tab) group_members_tab->setGroupID(id); + if(group_roles_tab) group_roles_tab->setGroupID(id); + if(group_actions_tab) group_actions_tab->setGroupID(id); + + activate(); + + if (!mSubTabContainer) return ; + + // Hook up each sub-tabs callback and widgets. + for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i) + { + LLPanel* panel = mSubTabContainer->getPanelByIndex(i); + LLPanelGroupSubTab* subtabp = dynamic_cast(panel); + if (subtabp) + subtabp->postBuildSubTab(this); + } +} + + -- cgit v1.2.3