From 835ee8879ce51ef3c981dc6141cac20e54baafc6 Mon Sep 17 00:00:00 2001 From: Beq Date: Thu, 15 Jun 2017 00:21:34 +0100 Subject: [PATCH 1/2] FIRE-21241 - Allow copy URI to appear only on the self profile in certain skins --- indra/newview/fspanelprofile.cpp | 33 +++++++++++++++++-- .../xui/en/panel_profile_secondlife.xml | 21 ++++++------ .../xui/en/panel_profile_secondlife.xml | 11 ++++++- .../xui/en/panel_profile_secondlife.xml | 11 ++++++- .../xui/en/panel_profile_secondlife.xml | 11 ++++++- 5 files changed, 71 insertions(+), 16 deletions(-) diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index cda2b4e05d..90251667d6 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -251,17 +251,28 @@ BOOL FSPanelProfileSecondLife::postBuild() // allow skins to have copy buttons for name and avatar URI -Zi LLButton* copy_uri_button = findChild("copy_uri_button"); LLButton* copy_name_button = findChild("copy_name_button"); - + // FIRE-21241 - Allow copy URI to appear only on the self profile in certain skins + // First we check for a all purpose copy_uri_button, if that was not defined + // then we do a second lookup for copy_own_uri_button. + if (!copy_uri_button) + { + // extended check to allow skins to have a copy button only on the self tab + copy_uri_button = findChild("copy_own_uri_button"); + } + // Same for name + if (!copy_name_button){ + copy_name_button = findChild("copy_own_name_button"); + } + // if (copy_uri_button) { copy_uri_button->setCommitCallback(boost::bind(&FSPanelProfileSecondLife::onCopyURI, this)); } - if (copy_name_button) { copy_name_button->setCommitCallback(boost::bind(&FSPanelProfileSecondLife::onCopyToClipboard, this)); } - // allow skins to have copy buttons for name and avatar URI -Zi + LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); @@ -310,6 +321,22 @@ void FSPanelProfileSecondLife::onOpen(const LLSD& key) FSDropTarget* drop_target = getChild("drop_target"); drop_target->setVisible(!own_profile); drop_target->setEnabled(!own_profile); + + // FIRE-21241 - Allow copy URI to appear only on the self profile in certain skins + // extended check to allow skins to have a copy button only on the self tab + LLButton* copy_uri_button = findChild("copy_own_uri_button"); + LLButton* copy_name_button = findChild("copy_own_name_button"); + if (copy_uri_button) + { + copy_uri_button->setVisible(own_profile); + copy_uri_button->setEnabled(own_profile); + } + if (copy_name_button) + { + copy_name_button->setVisible(own_profile); + copy_name_button->setEnabled(own_profile); + } + // if (!own_profile) { 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 9f0327f6f2..f715822db0 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -166,15 +166,7 @@ KC: Use view_border's around text_editor's due to text render issues with border enabled="false" max_length="254" value="(loading...)" /> -