Commits

Kent Quirk committed f904ee7

VWR-22024 -- apply Bao's patch to beta

  • Participants
  • Parent commits 1237987

Comments (0)

Files changed (2)

File indra/newview/llfirstuse.cpp

 
 
 // static
-std::set<std::string> LLFirstUse::sConfigVariables;
+//std::set<std::string> LLFirstUse::sConfigVariables;
+std::set<std::string> LLFirstUse::sConfigVariablesEnabled;
 
 // static
-void LLFirstUse::addConfigVariable(const std::string& var)
-{
-	sConfigVariables.insert(var);
-}
+//void LLFirstUse::addConfigVariable(const std::string& var)
+//{
+//	sConfigVariables.insert(var);
+//}
 
 // static
-void LLFirstUse::disableFirstUse()
-{
-	// Set all first-use warnings to disabled
-	for (std::set<std::string>::iterator iter = sConfigVariables.begin();
-		 iter != sConfigVariables.end(); ++iter)
-	{
-		gWarningSettings.setBOOL(*iter, FALSE);
-	}
-}
+//void LLFirstUse::disableFirstUse()
+//{
+//	// Set all first-use warnings to disabled
+//	for (std::set<std::string>::iterator iter = sConfigVariables.begin();
+//		 iter != sConfigVariables.end(); ++iter)
+//	{
+//		gWarningSettings.setBOOL(*iter, FALSE);
+//	}
+//}
 
 // static
-void LLFirstUse::resetFirstUse()
-{
-	// Set all first-use warnings to disabled
-	for (std::set<std::string>::iterator iter = sConfigVariables.begin();
-		 iter != sConfigVariables.end(); ++iter)
-	{
-		gWarningSettings.setBOOL(*iter, TRUE);
-	}
-}
+//void LLFirstUse::resetFirstUse()
+//{
+//	// Set all first-use warnings to disabled
+//	for (std::set<std::string>::iterator iter = sConfigVariables.begin();
+//		 iter != sConfigVariables.end(); ++iter)
+//	{
+//		gWarningSettings.setBOOL(*iter, TRUE);
+//	}
+//}
 
 // static
 void LLFirstUse::otherAvatarChatFirst(bool enable)
 
 	if (enable)
 	{
+		if(sConfigVariablesEnabled.find(control_var) != sConfigVariablesEnabled.end())
+		{
+			return ; //already added
+		}
+
 		if (gSavedSettings.getBOOL("EnableUIHints"))
 		{
 			LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
 
 			// if notification doesn't already exist and this notification hasn't been disabled...
 			if (gWarningSettings.getBOOL(control_var))
-			{ // create new notification
+			{ 
+				sConfigVariablesEnabled.insert(control_var) ;
+
+				// create new notification
 				LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
 			}
 		}
 		// redundantly clear settings var here, in case there are no notifications to cancel
 		gWarningSettings.setBOOL(control_var, FALSE);
 	}
-
 }
 
 // static

File indra/newview/llfirstuse.h

 public:
 
 	// Add a config variable to be reset on resetFirstUse()
-	static void addConfigVariable(const std::string& var);
+	//static void addConfigVariable(const std::string& var);
 	
 	// Sets all controls back to show the dialogs.
-	static void disableFirstUse();
-	static void resetFirstUse();
+	//static void disableFirstUse();
+	//static void resetFirstUse();
 
 	static void otherAvatarChatFirst(bool enable = true);
 	static void sit(bool enable = true);
 	
 protected:
 	static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD());
-	static std::set<std::string> sConfigVariables;
+	//static std::set<std::string> sConfigVariables;
+	static std::set<std::string> sConfigVariablesEnabled;
 
 	static void init();
 	static bool processNotification(const LLSD& notify);