/** * Activate tab with "panel_name" panel * if no such tab - return false, otherwise true. * TODO* In some cases a pointer to a panel of * a specific class may be needed so this method * would need to use templates. */ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) { //arrange tabs child_vector_const_iter_t child_it; for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) { LLView* view = (*child_it)->findChildView(panel_name,true); if(view) { selectTabByName ((*child_it)->getName()); if(mCollapsed) expandSideBar(); LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent()); if(container) { LLSD new_params = params; new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; container->onOpen(new_params); return container->getCurrentPanel(); } LLPanel* panel = dynamic_cast<LLPanel*>(view); if(panel) { panel->onOpen(params); } return panel; } } return NULL; }
LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); if (!view) return NULL; if (!getVisible()) { openFloater(); } LLPanel* panel = NULL; LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent()); if (container) { LLSD new_params = params; new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; container->onOpen(new_params); panel = container->getCurrentPanel(); } else if ((panel = dynamic_cast<LLPanel*>(view)) != NULL) { panel->onOpen(params); } return panel; }
void LLPanelBlockedList::onBackBtnClick() { LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); if(parent) { parent->openPreviousPanel(); } }
void LLPanelSnapshot::goBack() { LLSideTrayPanelContainer* parent = getParentContainer(); if (parent) { parent->openPreviousPanel(); parent->getCurrentPanel()->onOpen(LLSD()); } }
void LLPanelProfileView::onBackBtnClick() { // Set dummy value to make picks panel dirty, // This will make Picks reload on next open. getTabContainer()[PANEL_PICKS]->setValue(LLSD()); LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); if(parent) { parent->openPreviousPanel(); } }
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) { LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); if (!parent) { llwarns << "Cannot find panel container" << llendl; return; } parent->openPanel(panel_name); parent->getCurrentPanel()->onOpen(LLSD()); LLFloaterSnapshot::postPanelSwitch(); }
LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel_name, const LLSD& params) { LLView* view = tab->findChildView(panel_name, true); if (!view) return NULL; std::string tab_name = tab->getName(); bool tab_attached = isTabAttached(tab_name); if (tab_attached && LLUI::sSettingGroups["config"]->getBOOL("OpenSidePanelsInFloaters")) { tab->toggleTabDocked(); tab_attached = false; } // Select tab and expand Side Tray only when a tab is attached. if (tab_attached) { selectTabByName(tab_name); if (mCollapsed) expandSideBar(); } else { LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab_name); if (!floater_tab) return NULL; floater_tab->openFloater(tab_name); } LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent()); if (container) { LLSD new_params = params; new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; container->onOpen(new_params); return container->getCurrentPanel(); } LLPanel* panel = dynamic_cast<LLPanel*>(view); if (panel) { panel->onOpen(params); } return panel; }
bool LLPanelPeople::notifyChildren(const LLSD& info) { if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") { LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); if (!container) { llwarns << "Cannot find People panel container" << llendl; return true; } if (container->getCurrentPanelIndex() > 0) { // if not on the default panel, switch to it container->onOpen(LLSD().with(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName())); } else LLSideTray::getInstance()->collapseSideBar(); return true; // this notification is only supposed to be handled by task panels } return LLPanel::notifyChildren(info); }