diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-11-15 19:24:45 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-11-15 19:24:45 -0800 |
commit | 987350fcb3cf2da03b70ac3fbadb0429f523d07a (patch) | |
tree | 3fa718455b83ea0204fbb45109bb5cddc92ad9ad /indra | |
parent | 89f7335a52ec9955432dbe8bfa5903f605b7362c (diff) |
CHUI-489: Code review cleanup for both CHUI-489 and CHUI-486. This should be last commit for CHUI-489.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfloater.cpp | 7 | ||||
-rw-r--r-- | indra/llui/llnotifications.cpp | 7 | ||||
-rw-r--r-- | indra/llui/llnotificationtemplate.h | 6 | ||||
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 16 |
4 files changed, 12 insertions, 24 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a3b5fb993d..ada2bde55e 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -662,13 +662,8 @@ void LLFloater::openFloater(const LLSD& key) && !getFloaterHost() && (!getVisible() || isMinimized())) { - bool playSound = true; - //Don't play a sound for incoming voice call based upon chat preference setting - if(getName() == "incoming call" && gSavedSettings.getBOOL("PlaySoundIncomingVoiceCall") == FALSE) - { - playSound = false; - } + bool playSound = !(getName() == "incoming call" && gSavedSettings.getBOOL("PlaySoundIncomingVoiceCall") == FALSE); if(playSound) { diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index fe84dbbdaf..9618c002f5 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -413,12 +413,13 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mDefaultFunctor(p.functor.isProvided() ? p.functor() : p.name()), mLogToChat(p.log_to_chat), mLogToIM(p.log_to_im), - mShowToast(p.show_toast) + mShowToast(p.show_toast), + mSoundName("") { if (p.sound.isProvided() && LLUI::sSettingGroups["config"]->controlExists(p.sound)) { - mSoundEffect = LLUUID(LLUI::sSettingGroups["config"]->getString(p.sound)); + mSoundName = p.sound; } BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts) @@ -901,7 +902,7 @@ bool LLNotification::hasFormElements() const void LLNotification::playSound() { - LLUI::sAudioCallback(mTemplatep->mSoundEffect); + make_ui_sound(mTemplatep->mSoundName.c_str()); } LLNotification::ECombineBehavior LLNotification::getCombineBehavior() const diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index 9434efe1b9..906b83a400 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -323,10 +323,8 @@ struct LLNotificationTemplate LLNotificationFormPtr mForm; // default priority for notifications of this type ENotificationPriority mPriority; - // UUID of the audio file to be played when this notification arrives - // this is loaded as a name, but looked up to get the UUID upon template load. - // If null, it wasn't specified. - LLUUID mSoundEffect; + // Stores the sound name which can then be used to play the sound using make_ui_sound + std::string mSoundName; // List of tags that rules can match against. std::list<std::string> mTags; diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 8b7cac9f4b..91003c7d53 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -118,22 +118,16 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification) if(channel) channel->addToast(p); - bool playSound = true; - - //Play notification sound for inventory offer and teleport offer based upon chat preference - if((notification->getName() == "UserGiveItem" - && gSavedSettings.getBOOL("PlaySoundInventoryOffer") == FALSE) - || notification->getName() == "TeleportOffered" - && gSavedSettings.getBOOL("PlaySoundTeleportOffer") == FALSE) - { - playSound = false; - } + //Will not play a notification sound for inventory and teleport offer based upon chat preference + bool playSound = !((notification->getName() == "UserGiveItem" + && gSavedSettings.getBOOL("PlaySoundInventoryOffer") == FALSE) + || notification->getName() == "TeleportOffered" + && gSavedSettings.getBOOL("PlaySoundTeleportOffer") == FALSE); if(playSound) { notification->playSound(); } - } if (notification->canLogToIM()) |