//static LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater() { if (!LLVoiceClient::getInstance()->voiceEnabled()) { return NULL; } if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel()) { // show near me tab if in proximal channel return LLFloaterChat::getInstance(LLSD()); } else { LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(LLSD()); // iterator over all IM tabs (skip friends and near me) for (S32 i = 0; i < floater->getFloaterCount(); i++) { LLPanel* panelp = floater->mTabContainer->getPanelByIndex(i); if (panelp->getName() == "im_floater") { // only LLFloaterIMPanels are called "im_floater" LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)panelp; if (im_floaterp->getVoiceChannel() == LLVoiceChannel::getCurrentVoiceChannel()) { return im_floaterp; } } } } return NULL; }
//virtual LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { tuple_list_t::const_iterator itor; for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) { LLPanel *panel = (*itor)->mTabPanel; if (panel->getName() == name) { return panel; } } if (recurse) { for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) { LLPanel *panel = (*itor)->mTabPanel; LLView *child = panel->getChildView(name, recurse, FALSE); if (child) { return child; } } } return LLView::getChildView(name, recurse, create_if_missing); }
// static void LLFloaterDirectory::onTabChanged(void* data, bool from_click) { LLFloaterDirectory* self = (LLFloaterDirectory*)data; if (!self) return; LLPanel *panel = self->childGetVisibleTab("Directory Tabs"); if (panel) { gSavedSettings.setString("LastFindPanel", panel->getName()); } }
LLPanel *LLTabContainer::getPanelByName(const std::string& name) { for (S32 index = 0 ; index < (S32)mTabList.size(); index++) { LLPanel *panel = mTabList[index]->mTabPanel; if (name == panel->getName()) { return panel; } } return NULL; }
//----------------------------------------------------------------------------- // rebuild() //----------------------------------------------------------------------------- void LLUICtrlFactory::rebuild() { built_panel_t built_panels = mBuiltPanels; mBuiltPanels.clear(); built_panel_t::iterator built_panel_it; for (built_panel_it = built_panels.begin(); built_panel_it != built_panels.end(); ++built_panel_it) { std::string filename = built_panel_it->second; LLPanel* panelp = built_panel_it->first.get(); if (!panelp) { continue; } llinfos << "Rebuilding UI panel " << panelp->getName() << " from " << filename << llendl; BOOL visible = panelp->getVisible(); panelp->setVisible(FALSE); panelp->setFocus(FALSE); panelp->deleteAllChildren(); buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap()); panelp->setVisible(visible); } built_floater_t::iterator built_floater_it; for (built_floater_it = mBuiltFloaters.begin(); built_floater_it != mBuiltFloaters.end(); ++built_floater_it) { LLFloater* floaterp = built_floater_it->first.get(); if (!floaterp) { continue; } std::string filename = built_floater_it->second; llinfos << "Rebuilding UI floater " << floaterp->getName() << " from " << filename << llendl; BOOL visible = floaterp->getVisible(); floaterp->setVisible(FALSE); floaterp->setFocus(FALSE); floaterp->deleteAllChildren(); gFloaterView->removeChild(floaterp); buildFloater(floaterp, filename, &floaterp->getFactoryMap()); floaterp->setVisible(visible); } }
bool LLSideTray::isPanelActive(const std::string& panel_name) { LLPanel *panel = getActivePanel(); if (!panel) return false; return (panel->getName() == panel_name); }