diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-02-26 19:18:15 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-26 19:18:15 -0800 |
commit | a2efe4bb4154b7ecb9c7cb279f7a28d7d401a93a (patch) | |
tree | 4cafd0e64a9c45b444664d12f022cd3e675bfebd /indra/newview/llpanelgroup.cpp | |
parent | 5352954eb65076d877cc74d4328620e910b93d1c (diff) | |
parent | 1ae70e112a466a6ed5baf4e05c1771218c78b2f5 (diff) |
automated merge
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 28abcab99e..9f202ff261 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. @@ -159,10 +160,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 +171,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 +185,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"); + } LLVoiceClient::getInstance()->addObserver(this); @@ -326,16 +333,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 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 +355,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 +384,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 +421,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 @@ -478,6 +482,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) |