diff options
author | Palmer Truelson <palmer@lindenlab.com> | 2010-02-23 17:19:58 -0800 |
---|---|---|
committer | Palmer Truelson <palmer@lindenlab.com> | 2010-02-23 17:19:58 -0800 |
commit | 54a95f706fe42cbef272c53e3fadfc2cf7ecfd0f (patch) | |
tree | d9b1f05ce695fa3ef5ee41949d3799d4e9a3e050 /indra/newview/llpanelgroup.cpp | |
parent | 7885748497d8b95f51c65f7f84a40d1405429616 (diff) | |
parent | 0980df1e0ce99bdafdd4e806cbacad96c71729cc (diff) |
merge
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 469f1c1739..706787e824 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -90,6 +90,7 @@ LLPanelGroup::LLPanelGroup() : LLPanel(), LLGroupMgrObserver( LLUUID() ), mSkipRefresh(FALSE), + mButtonJoin(NULL), mShowingNotifyDialog(false) { // Set up the factory callbacks. @@ -101,8 +102,10 @@ LLPanelGroup::LLPanelGroup() LLPanelGroup::~LLPanelGroup() { LLGroupMgr::getInstance()->removeObserver(this); - if(LLVoiceClient::getInstance()) + if(LLVoiceClient::instanceExists()) + { LLVoiceClient::getInstance()->removeObserver(this); + } } void LLPanelGroup::onOpen(const LLSD& key) @@ -159,10 +162,6 @@ BOOL LLPanelGroup::postBuild() button = getChild<LLButton>("btn_chat"); button->setClickedCallback(onBtnGroupChatClicked, this); - button = getChild<LLButton>("btn_join"); - button->setVisible(false); - button->setEnabled(true); - button = getChild<LLButton>("btn_cancel"); button->setVisible(false); button->setEnabled(true); @@ -174,7 +173,7 @@ BOOL LLPanelGroup::postBuild() childSetCommitCallback("back",boost::bind(&LLPanelGroup::onBackBtnClick,this),NULL); childSetCommitCallback("btn_create",boost::bind(&LLPanelGroup::onBtnCreate,this),NULL); - childSetCommitCallback("btn_join",boost::bind(&LLPanelGroup::onBtnJoin,this),NULL); + childSetCommitCallback("btn_cancel",boost::bind(&LLPanelGroup::onBtnCancel,this),NULL); LLPanelGroupTab* panel_general = findChild<LLPanelGroupTab>("group_general_tab_panel"); @@ -188,7 +187,17 @@ BOOL LLPanelGroup::postBuild() if(panel_land) mTabs.push_back(panel_land); if(panel_general) + { panel_general->setupCtrls(this); + button = panel_general->getChild<LLButton>("btn_join"); + button->setVisible(false); + button->setEnabled(true); + + mButtonJoin = button; + mButtonJoin->setCommitCallback(boost::bind(&LLPanelGroup::onBtnJoin,this)); + + mJoinText = panel_general->getChild<LLUICtrl>("join_cost_text"); + } gVoiceClient->addObserver(this); @@ -326,16 +335,13 @@ void LLPanelGroup::update(LLGroupChange gc) { childSetValue("group_name", gdatap->mName); childSetToolTip("group_name",gdatap->mName); - - LLButton* btn_join = getChild<LLButton>("btn_join"); - LLUICtrl* join_text = getChild<LLUICtrl>("join_cost_text"); - + LLGroupData agent_gdatap; - bool is_member = gAgent.getGroupData(mID,agent_gdatap); + bool is_member = gAgent.getGroupData(mID,agent_gdatap) || gAgent.isGodlike(); bool join_btn_visible = !is_member && gdatap->mOpenEnrollment; - btn_join->setVisible(join_btn_visible); - join_text->setVisible(join_btn_visible); + mButtonJoin->setVisible(join_btn_visible); + mJoinText->setVisible(join_btn_visible); if(join_btn_visible) { @@ -351,7 +357,7 @@ void LLPanelGroup::update(LLGroupChange gc) { fee_buff = getString("group_join_free", string_args); } - childSetValue("join_cost_text",fee_buff); + mJoinText->setValue(fee_buff); } } } @@ -380,7 +386,7 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLButton* button_apply = findChild<LLButton>("btn_apply"); LLButton* button_refresh = findChild<LLButton>("btn_refresh"); LLButton* button_create = findChild<LLButton>("btn_create"); - LLButton* button_join = findChild<LLButton>("btn_join"); + LLButton* button_cancel = findChild<LLButton>("btn_cancel"); LLButton* button_call = findChild<LLButton>("btn_call"); LLButton* button_chat = findChild<LLButton>("btn_chat"); @@ -417,8 +423,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(!tab_general || !tab_roles || !tab_notices || !tab_land) return; - if(button_join) - button_join->setVisible(false); + if(mButtonJoin) + mButtonJoin->setVisible(false); if(is_null_group_id)//creating new group @@ -460,7 +466,7 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) } LLGroupData agent_gdatap; - bool is_member = gAgent.getGroupData(mID,agent_gdatap); + bool is_member = gAgent.getGroupData(mID,agent_gdatap) || gAgent.isGodlike(); tab_roles->setVisible(is_member); tab_notices->setVisible(is_member); @@ -478,6 +484,7 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) } reposButtons(); + update(GC_ALL);//show/hide "join" button if data is already ready } bool LLPanelGroup::apply(LLPanelGroupTab* tab) |