summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroup.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-10 16:09:42 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-10 16:09:42 -0500
commitcc8b983398b66253d9331f3b9d6055f8b00998b9 (patch)
tree2c901fc33f6a390ef5b15c0446365b70074bbfa1 /indra/newview/llpanelgroup.cpp
parent662ce9b1fd6fcdf817e8fd825ce2c35e4fa52ca3 (diff)
parentda3ad612dffa422deabc5cc9afb775442f13bb45 (diff)
merge
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r--indra/newview/llpanelgroup.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index 469f1c1739..ce4078409a 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");
+ }
gVoiceClient->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)