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 +++++++++++++++++++--- indra/newview/llpanelprofile.h | 1 + .../default/xui/en/panel_profile_secondlife.xml | 10 +++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) 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) { diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 8b2893905d..0237a537de 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -177,6 +177,7 @@ private: void onSaveDescriptionChanges(); void onDiscardDescriptionChanges(); void onShowAgentPermissionsDialog(); + void onOpenNotes(); private: typedef std::map group_map_t; diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index e23da2b7fe..3745706a5a 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -403,6 +403,16 @@ Account: [ACCTTYPE] word_wrap="true" use_ellipses="true" allow_scroll="false"/> +