From e52c0218c718fe96a7927f0524c4616022be510e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 20 Nov 2012 18:40:53 +0200 Subject: CHUI-523 FIXED Set visibility of warning message depending on combobox state. --- indra/newview/llfloaterpreference.cpp | 30 ++++++++++++++++++++++++++++++ indra/newview/llfloaterpreference.h | 4 ++++ 2 files changed, 34 insertions(+) (limited to 'indra') 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("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); + getChild("FriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"FriendIMOptions")); + getChild("NonFriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NonFriendIMOptions")); + getChild("ConferenceIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ConferenceIMOptions")); + getChild("GroupChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"GroupChatOptions")); + getChild("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(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("notifications_alert")->setVisible(show_notifications_alert); +} + void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue) { LLColorSwatchCtrl* color_swatch = findChild("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 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; -- cgit v1.2.3