diff options
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index c30ef3221d..469f1c1739 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -89,8 +89,8 @@ BOOL LLPanelGroupTab::postBuild() LLPanelGroup::LLPanelGroup() : LLPanel(), LLGroupMgrObserver( LLUUID() ), - mAllowEdit( TRUE ) - ,mShowingNotifyDialog(false) + mSkipRefresh(FALSE), + mShowingNotifyDialog(false) { // Set up the factory callbacks. // Roles sub tabs @@ -101,6 +101,8 @@ LLPanelGroup::LLPanelGroup() LLPanelGroup::~LLPanelGroup() { LLGroupMgr::getInstance()->removeObserver(this); + if(LLVoiceClient::getInstance()) + LLVoiceClient::getInstance()->removeObserver(this); } void LLPanelGroup::onOpen(const LLSD& key) @@ -166,7 +168,6 @@ BOOL LLPanelGroup::postBuild() button = getChild<LLButton>("btn_refresh"); button->setClickedCallback(onBtnRefresh, this); - button->setVisible(mAllowEdit); getChild<LLButton>("btn_create")->setVisible(false); @@ -188,6 +189,8 @@ BOOL LLPanelGroup::postBuild() if(panel_general) panel_general->setupCtrls(this); + + gVoiceClient->addObserver(this); return TRUE; } @@ -300,6 +303,17 @@ void LLPanelGroup::changed(LLGroupChange gc) update(gc); } +// virtual +void LLPanelGroup::onChange(EStatusType status, const std::string &channelURI, bool proximal) +{ + if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) + { + return; + } + + childSetEnabled("btn_call", LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()); +} + void LLPanelGroup::notifyObservers() { changed(GC_ALL); @@ -356,6 +370,13 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it) (*it)->setGroupID(group_id); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mID); + if(gdatap) + { + childSetValue("group_name", gdatap->mName); + childSetToolTip("group_name",gdatap->mName); + } + LLButton* button_apply = findChild<LLButton>("btn_apply"); LLButton* button_refresh = findChild<LLButton>("btn_refresh"); LLButton* button_create = findChild<LLButton>("btn_create"); @@ -457,17 +478,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) } reposButtons(); - - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mID); - - if(gdatap) - { - childSetValue("group_name", gdatap->mName); - childSetToolTip("group_name",gdatap->mName); - - //group data is already present, call update manually - update(GC_ALL); - } } bool LLPanelGroup::apply(LLPanelGroupTab* tab) @@ -481,7 +491,12 @@ bool LLPanelGroup::apply(LLPanelGroupTab* tab) std::string apply_mesg; if(tab->apply( apply_mesg ) ) + { + //we skip refreshing group after ew manually apply changes since its very annoying + //for those who are editing group + mSkipRefresh = TRUE; return true; + } if ( !apply_mesg.empty() ) { @@ -528,6 +543,11 @@ void LLPanelGroup::draw() void LLPanelGroup::refreshData() { + if(mSkipRefresh) + { + mSkipRefresh = FALSE; + return; + } LLGroupMgr::getInstance()->clearGroupData(getID()); setGroupID(getID()); @@ -549,10 +569,10 @@ void LLPanelGroup::chatGroup() } void LLPanelGroup::showNotice(const std::string& subject, - const std::string& message, - const bool& has_inventory, - const std::string& inventory_name, - LLOfferInfo* inventory_offer) + const std::string& message, + const bool& has_inventory, + const std::string& inventory_name, + LLOfferInfo* inventory_offer) { LLPanelGroupNotices* panel_notices = findChild<LLPanelGroupNotices>("group_notices_tab_panel"); if(!panel_notices) |