From 36bf984b03daf0b472fccc7b9cc63bc913f3ced2 Mon Sep 17 00:00:00 2001
From: Andrew Dyukov <adyukov@productengine.com>
Date: Fri, 25 Jun 2010 17:55:24 +0300
Subject: [PATCH] EXT-7872 FIXED Removed disabling of movement controls when
 sitting.

- Removed code responsible for disabling actions panel when sitting.

- Removed LLFloaterMove::setEnabled() and replaced calls to it with calls showModeButtons() because it was the only code which remained there after first step of this fix.

Reviewed by Leyla Farazha at https://codereview.productengine.com/secondlife/r/655/

--HG--
branch : product-engine
---
 indra/newview/llmoveview.cpp | 23 ++++++-----------------
 indra/newview/llmoveview.h   |  1 -
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index afca9daa67e..6ae4a5e5e47 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -144,18 +144,6 @@ BOOL LLFloaterMove::postBuild()
 	return TRUE;
 }
 
-// virtual
-void LLFloaterMove::setEnabled(BOOL enabled)
-{
-	//we need to enable/disable only buttons, EXT-1061.
-
-	// is called before postBuild() - use findChild here.
-	LLPanel *panel_actions = findChild<LLPanel>("panel_actions");
-	if (panel_actions) panel_actions->setEnabled(enabled);
-
-	showModeButtons(enabled);
-}
-
 // *NOTE: we assume that setVisible() is called on floater close.
 // virtual
 void LLFloaterMove::setVisible(BOOL visible)
@@ -406,7 +394,7 @@ void LLFloaterMove::initMovementMode()
 
 	if (isAgentAvatarValid())
 	{
-		setEnabled(!gAgentAvatarp->isSitting());
+		showModeButtons(!gAgentAvatarp->isSitting());
 	}
 }
 
@@ -476,8 +464,7 @@ void LLFloaterMove::sUpdateFlyingStatus()
 
 void LLFloaterMove::showModeButtons(BOOL bShow)
 {
-	// is called from setEnabled so can be called before postBuild(), check mModeActionsPanel agains to NULL
-	if (NULL == mModeActionsPanel || mModeActionsPanel->getVisible() == bShow)
+	if (mModeActionsPanel->getVisible() == bShow)
 		return;
 	mModeActionsPanel->setVisible(bShow);
 }
@@ -488,12 +475,14 @@ void LLFloaterMove::enableInstance(BOOL bEnable)
 	LLFloaterMove* instance = LLFloaterReg::findTypedInstance<LLFloaterMove>("moveview");
 	if (instance)
 	{
-		instance->setEnabled(bEnable);
-
 		if (gAgent.getFlying())
 		{
 			instance->showModeButtons(FALSE);
 		}
+		else
+		{
+			instance->showModeButtons(bEnable);
+		}
 	}
 }
 
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index fcf643f0505..d463861188d 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -55,7 +55,6 @@ class LLFloaterMove
 public:
 
 	/*virtual*/	BOOL	postBuild();
-	/*virtual*/ void	setEnabled(BOOL enabled);
 	/*virtual*/ void	setVisible(BOOL visible);
 	static F32	getYawRate(F32 time);
 	static void setFlyingMode(BOOL fly);
-- 
GitLab