From de8a61f71a16f950cbf64b5704b9952cb733403e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 15 May 2022 12:31:49 +0300 Subject: SL-15312 Shortcut to notes --- indra/newview/llpanelprofile.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelprofile.cpp') diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 542ecf8b42..fb5d2d2051 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -842,6 +842,8 @@ BOOL LLPanelProfileSecondLife::postBuild() mSeeOnMapToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); mEditObjectsToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); }); + getChild("open_notes")->setCommitCallback([this](LLUICtrl*, void*) { onOpenNotes(); }, nullptr); + return TRUE; } @@ -1614,6 +1616,23 @@ void LLPanelProfileSecondLife::onShowAgentPermissionsDialog() } } +void LLPanelProfileSecondLife::onOpenNotes() +{ + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + if (!parent_floater) + { + return; + } + + LLTabContainer* tab_container = parent_floater->findChild("panel_profile_tabs", TRUE); + if (!tab_container) + { + return; + } + + tab_container->selectTabByName(PANEL_NOTES); +} + ////////////////////////////////////////////////////////////////////////// // LLPanelProfileWeb @@ -1991,13 +2010,13 @@ void LLPanelProfileNotes::onSaveNotesChanges() boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes))); - LLFloater* floater_profile = LLFloaterReg::findInstance("profile", LLSD().with("id", getAvatarId())); - if (!floater_profile) + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + if (!parent_floater) { return; } - LLPanel* panel = floater_profile->findChild(PANEL_SECONDLIFE, TRUE); + LLPanel* panel = parent_floater->findChild(PANEL_SECONDLIFE, TRUE); LLPanelProfileSecondLife *panel_sl = dynamic_cast(panel); if (panel_sl) { -- cgit v1.3