SL-15312 Shortcut to notes

master
Andrey Kleshchev 2022-05-15 12:31:49 +03:00
parent 26ee1cc148
commit de8a61f71a
3 changed files with 33 additions and 3 deletions

View File

@ -842,6 +842,8 @@ BOOL LLPanelProfileSecondLife::postBuild()
mSeeOnMapToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); });
mEditObjectsToggle->setMouseUpCallback([this](LLUICtrl*, const LLSD&) { onShowAgentPermissionsDialog(); });
getChild<LLButton>("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<LLTabContainer>("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<LLPanel>(PANEL_SECONDLIFE, TRUE);
LLPanel* panel = parent_floater->findChild<LLPanel>(PANEL_SECONDLIFE, TRUE);
LLPanelProfileSecondLife *panel_sl = dynamic_cast<LLPanelProfileSecondLife*>(panel);
if (panel_sl)
{

View File

@ -177,6 +177,7 @@ private:
void onSaveDescriptionChanges();
void onDiscardDescriptionChanges();
void onShowAgentPermissionsDialog();
void onOpenNotes();
private:
typedef std::map<std::string, LLUUID> group_map_t;

View File

@ -403,6 +403,16 @@ Account: [ACCTTYPE]
word_wrap="true"
use_ellipses="true"
allow_scroll="false"/>
<button
follows="right|bottom"
layout="topleft"
name="open_notes"
tooltip="Show notes"
image_overlay="ForwardArrow_Off"
height="18"
bottom="-5"
right="-5"
width="20" />
</layout_panel>
<layout_panel