diff options
| author | maxim_productengine <mnikolenko@productengine.com> | 2012-11-20 18:40:53 +0200 | 
|---|---|---|
| committer | maxim_productengine <mnikolenko@productengine.com> | 2012-11-20 18:40:53 +0200 | 
| commit | e52c0218c718fe96a7927f0524c4616022be510e (patch) | |
| tree | efc6a9654f50afc414425e2862787b382dcab282 /indra | |
| parent | b87974df51c4caf12c47009dec03b7dc8afe543d (diff) | |
CHUI-523 FIXED Set visibility of warning message depending on combobox state.
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 30 | ||||
| -rw-r--r-- | indra/newview/llfloaterpreference.h | 4 | 
2 files changed, 34 insertions, 0 deletions
| diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ffd59ba8b6..d08a1d0034 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -443,12 +443,25 @@ BOOL LLFloaterPreference::postBuild()  	getChild<LLComboBox>("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); +	getChild<LLComboBox>("FriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"FriendIMOptions")); +	getChild<LLComboBox>("NonFriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NonFriendIMOptions")); +	getChild<LLComboBox>("ConferenceIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ConferenceIMOptions")); +	getChild<LLComboBox>("GroupChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"GroupChatOptions")); +	getChild<LLComboBox>("NearbyChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NearbyChatOptions")); +  	// if floater is opened before login set default localized do not disturb message  	if (LLStartUp::getStartupState() < STATE_STARTED)  	{  		gSavedPerAccountSettings.setString("DoNotDisturbModeResponse", LLTrans::getString("DoNotDisturbModeResponseDefault"));  	} +	//get the options that were checked +	onNotificationsChange("FriendIMOptions"); +	onNotificationsChange("NonFriendIMOptions"); +	onNotificationsChange("ConferenceIMOptions"); +	onNotificationsChange("GroupChatOptions"); +	onNotificationsChange("NearbyChatOptions"); +  	return TRUE;  } @@ -863,6 +876,23 @@ void LLFloaterPreference::onLanguageChange()  	}  } +void LLFloaterPreference::onNotificationsChange(const std::string& OptionName) +{ +	mNotificationOptions[OptionName] = getChild<LLComboBox>(OptionName)->getSelectedItemLabel(); + +	bool show_notifications_alert = true; +	for (notifications_map::iterator it_notification = mNotificationOptions.begin(); it_notification != mNotificationOptions.end(); it_notification++) +	{ +		if(it_notification->second != "None") +		{ +			show_notifications_alert = false; +			break; +		} +	} + +	getChild<LLTextBox>("notifications_alert")->setVisible(show_notifications_alert); +} +  void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue)  {  	LLColorSwatchCtrl* color_swatch = findChild<LLColorSwatchCtrl>("background"); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 4c1c122fb1..37a531e99e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -45,6 +45,8 @@ class LLSliderCtrl;  class LLSD;  class LLTextBox; +typedef std::map<std::string, std::string> notifications_map; +  typedef enum  	{  		GS_LOW_GRAPHICS, @@ -93,6 +95,7 @@ protected:  	void		onClickClearCache();			// Clear viewer texture cache, vfs, and VO cache on next startup  	void		onClickBrowserClearCache();		// Clear web history and caches as well as viewer caches above  	void		onLanguageChange(); +	void		onNotificationsChange(const std::string& OptionName);  	void		onNameTagOpacityChange(const LLSD& newvalue);  	// set value of "DoNotDisturbResponseChanged" in account settings depending on whether do not disturb response @@ -170,6 +173,7 @@ public:  private:  	static std::string sSkin; +	notifications_map mNotificationOptions;  	bool mClickActionDirty; ///< Set to true when the click/double-click options get changed by user.  	bool mGotPersonalInfo;  	bool mOriginalIMViaEmail; | 
