Skip to content
Snippets Groups Projects
Commit 050d544a authored by ¡Cinder! ㊝'s avatar ¡Cinder! ㊝ :speech_balloon:
Browse files

showTab() openTab() in LegacyProfiles

parent 491990e1
No related branches found
No related tags found
1 merge request!89Legacy notification well for normal folks who don't like checking their...
...@@ -70,7 +70,12 @@ void LLFloaterProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLA ...@@ -70,7 +70,12 @@ void LLFloaterProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLA
mAvatarNameCacheConnection.disconnect(); mAvatarNameCacheConnection.disconnect();
} }
void LLFloaterProfileLegacy::openTab(std::string_view tab_name) const void LLFloaterProfileLegacy::showTab(std::string_view tab_name) const
{ {
if (mPanel) { mPanel->showAccordion(tab_name, true); } if (mPanel) { mPanel->showTab(tab_name, true); }
}
std::string_view LLFloaterProfileLegacy::getShownTab() const
{
return mPanel != nullptr ? mPanel->getShownTab() : LLStringUtil::null;
} }
...@@ -42,7 +42,8 @@ class LLFloaterProfileLegacy final : public LLFloater ...@@ -42,7 +42,8 @@ class LLFloaterProfileLegacy final : public LLFloater
LLFloaterProfileLegacy(LLSD const& key); LLFloaterProfileLegacy(LLSD const& key);
BOOL postBuild() override; BOOL postBuild() override;
void onOpen(const LLSD& key) override; void onOpen(const LLSD& key) override;
void openTab(std::string_view tab_name) const; void showTab(std::string_view tab_name) const;
std::string_view getShownTab() const;
private: private:
~LLFloaterProfileLegacy() override; ~LLFloaterProfileLegacy() override;
......
...@@ -497,7 +497,7 @@ void LLPanelProfileLegacy::processProperties(void* data, EAvatarProcessorType ty ...@@ -497,7 +497,7 @@ void LLPanelProfileLegacy::processProperties(void* data, EAvatarProcessorType ty
const LLAvatarGroups* pData = static_cast<LLAvatarGroups*>(data); const LLAvatarGroups* pData = static_cast<LLAvatarGroups*>(data);
if(!pData || getAvatarId() != pData->avatar_id) return; if(!pData || getAvatarId() != pData->avatar_id) return;
showAccordion("avatar_groups_tab", !pData->group_list.empty()); showTab("avatar_groups_tab", !pData->group_list.empty());
break; break;
} }
// These are handled by their respective panels // These are handled by their respective panels
...@@ -523,13 +523,19 @@ void LLPanelProfileLegacy::setProgress(bool started) ...@@ -523,13 +523,19 @@ void LLPanelProfileLegacy::setProgress(bool started)
indicator->stop(); indicator->stop();
} }
void LLPanelProfileLegacy::showAccordion(std::string_view name, bool show) void LLPanelProfileLegacy::showTab(std::string_view name, bool show) const
{ {
LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name); LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
tab->setVisible(show); tab->setVisible(show);
getChild<LLAccordionCtrl>("avatar_accordion")->arrange(); getChild<LLAccordionCtrl>("avatar_accordion")->arrange();
} }
std::string_view LLPanelProfileLegacy::getShownTab() const
{
const LLAccordionCtrlTab* tab = getChild<LLAccordionCtrl>("avatar_accordion")->getExpandedTab();
return tab != nullptr ? tab->getTitle() : LLStringUtil::null;
}
void LLPanelProfileLegacy::onCommitAction(const LLSD& userdata) void LLPanelProfileLegacy::onCommitAction(const LLSD& userdata)
{ {
const std::string action = userdata.asString(); const std::string action = userdata.asString();
...@@ -1192,9 +1198,9 @@ void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedSave(LLPanelCla ...@@ -1192,9 +1198,9 @@ void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedSave(LLPanelCla
c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this)); c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this));
c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this));
// order does matter, showAccordion will invoke arrange for accordions. // order does matter, showTab will invoke arrange for accordions.
//mClassifiedsAccTab->changeOpenClose(false); //mClassifiedsAccTab->changeOpenClose(false);
//showAccordion("tab_classifieds", true); //showTab("tab_classifieds", true);
} }
else if (panel->isNewWithErrors()) else if (panel->isNewWithErrors())
{ {
......
...@@ -54,7 +54,8 @@ class LLPanelProfileLegacy final : public LLPanelProfileLegacyTab ...@@ -54,7 +54,8 @@ class LLPanelProfileLegacy final : public LLPanelProfileLegacyTab
BOOL postBuild() override; BOOL postBuild() override;
void onOpen(const LLSD& key) override; void onOpen(const LLSD& key) override;
void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override;
void showAccordion(std::string_view name, bool show); void showTab(std::string_view name, bool show) const;
std::string_view getShownTab() const;
protected: protected:
void openPanel(LLPanel* panel, const LLSD& params); void openPanel(LLPanel* panel, const LLSD& params);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment