From fa277a3b4a5d5dc5af6eb53ecd005e4789534758 Mon Sep 17 00:00:00 2001
From: Leyla Farazha <leyla@lindenlab.com>
Date: Tue, 15 Mar 2011 11:37:03 -0700
Subject: [PATCH] SOCIAL-744 User cannot close Destination Guide and Avatar
 picker by clicking the respective buttons while open

---
 indra/newview/llviewermenu.cpp | 41 +++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index add24e52162..2a5a845d53c 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -855,28 +855,37 @@ void toggle_destination_and_avatar_picker(const LLSD& show)
 	switch(panel_idx)
 	{
 	case 0:
-		container->setVisible(true);
-		destinations->setVisible(true);
-		avatar_picker->setVisible(false);
-		LLFirstUse::notUsingDestinationGuide(false);
-		avatar_btn->setToggleState(false);
-		destination_btn->setToggleState(true);
+		if (!destinations->getVisible())
+		{
+			container->setVisible(true);
+			destinations->setVisible(true);
+			avatar_picker->setVisible(false);
+			LLFirstUse::notUsingDestinationGuide(false);
+			avatar_btn->setToggleState(false);
+			destination_btn->setToggleState(true);
+			return;
+		}
 		break;
 	case 1:
-		container->setVisible(true);
-		destinations->setVisible(false);
-		avatar_picker->setVisible(true);
-		avatar_btn->setToggleState(true);
-		destination_btn->setToggleState(false);
+		if (!avatar_picker->getVisible())
+		{	
+			container->setVisible(true);
+			destinations->setVisible(false);
+			avatar_picker->setVisible(true);
+			avatar_btn->setToggleState(true);
+			destination_btn->setToggleState(false);
+			return;
+		}
 		break;
 	default:
-		container->setVisible(false);
-		destinations->setVisible(false);
-		avatar_picker->setVisible(false);
-		avatar_btn->setToggleState(false);
-		destination_btn->setToggleState(false);
 		break;
 	}
+
+	container->setVisible(false);
+	destinations->setVisible(false);
+	avatar_picker->setVisible(false);
+	avatar_btn->setToggleState(false);
+	destination_btn->setToggleState(false);
 };
 
 
-- 
GitLab