From eea440b4542747e66c4e16037436acff90d48e22 Mon Sep 17 00:00:00 2001
From: maxim_productengine <mnikolenko@productengine.com>
Date: Fri, 19 Apr 2019 16:07:41 +0300
Subject: [PATCH] SL-10989 Toggle checkbox when clicking 'Avatars on other
 parcels can see and chat...' label

---
 indra/newview/llfloaterland.cpp                | 18 +++++++++++++++++-
 indra/newview/llfloaterland.h                  |  1 +
 .../default/xui/en/floater_about_land.xml      |  2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 7f2e8fd82a2..8fbc7b3b642 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1923,6 +1923,13 @@ BOOL LLPanelLandOptions::postBuild()
 	mSeeAvatarsCtrl = getChild<LLCheckBoxCtrl>( "SeeAvatarsCheck");
 	childSetCommitCallback("SeeAvatarsCheck", onCommitAny, this);
 
+	if (hasChild("allow_see_label", TRUE))
+	{
+		getChild<LLTextBox>("allow_see_label")->setShowCursorHand(false);
+		getChild<LLTextBox>("allow_see_label")->setSoundFlags(LLView::MOUSE_UP);
+		getChild<LLTextBox>("allow_see_label")->setClickedCallback(boost::bind(&toggleSeeAvatars, this));
+	}
+
 	mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck");
 	childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this);
 
@@ -2364,7 +2371,16 @@ void LLPanelLandOptions::onClickClear(void* userdata)
 	self->refresh();
 }
 
-
+void LLPanelLandOptions::toggleSeeAvatars(void* userdata)
+{
+	LLPanelLandOptions* self = (LLPanelLandOptions*)userdata;
+	if (self)
+	{
+		self->getChild<LLCheckBoxCtrl>("SeeAvatarsCheck")->toggle();
+		self->getChild<LLCheckBoxCtrl>("SeeAvatarsCheck")->setBtnFocus();
+		self->onCommitAny(NULL, userdata);
+	}
+}
 //---------------------------------------------------------------------------
 // LLPanelLandAccess
 //---------------------------------------------------------------------------
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index e846d426665..c7b96f7ba01 100644
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -327,6 +327,7 @@ class LLPanelLandOptions
 	static void onCommitAny(LLUICtrl* ctrl, void *userdata);
 	static void onClickSet(void* userdata);
 	static void onClickClear(void* userdata);
+	static void toggleSeeAvatars(void* userdata);
 
 private:
 	LLCheckBoxCtrl*	mCheckEditObjects;
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 9f5eb8823a1..8bbf7d04c6b 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -1477,7 +1477,7 @@ Only large parcels can be listed in search.
              layout="topleft"
              left="274"
              top="150"
-             name="allow_label5"
+             name="allow_see_label"
              width="205"
              word_wrap="true">
               Avatars on other parcels can see and chat with avatars on this parcel
-- 
GitLab