summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp10
-rw-r--r--indra/llui/llnotifications.cpp10
-rw-r--r--indra/llui/llnotifications.h1
-rw-r--r--indra/llui/llnotificationtemplate.h6
4 files changed, 20 insertions, 7 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 1b6e4ed0e5..ada2bde55e 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -64,6 +64,8 @@
// use this to control "jumping" behavior when Ctrl-Tabbing
const S32 TABBED_FLOATER_OFFSET = 0;
+extern LLControlGroup gSavedSettings;
+
namespace LLInitParam
{
void TypeValues<LLFloaterEnums::EOpenPositioning>::declareValues()
@@ -660,7 +662,13 @@ void LLFloater::openFloater(const LLSD& key)
&& !getFloaterHost()
&& (!getVisible() || isMinimized()))
{
- make_ui_sound("UISndWindowOpen");
+ //Don't play a sound for incoming voice call based upon chat preference setting
+ bool playSound = !(getName() == "incoming call" && gSavedSettings.getBOOL("PlaySoundIncomingVoiceCall") == FALSE);
+
+ if(playSound)
+ {
+ make_ui_sound("UISndWindowOpen");
+ }
}
//RN: for now, we don't allow rehosting from one multifloater to another
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 929b7da081..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)
@@ -899,6 +900,11 @@ bool LLNotification::hasFormElements() const
return mTemplatep->mForm->getNumElements() != 0;
}
+void LLNotification::playSound()
+{
+ make_ui_sound(mTemplatep->mSoundName.c_str());
+}
+
LLNotification::ECombineBehavior LLNotification::getCombineBehavior() const
{
return mTemplatep->mCombineBehavior;
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index c677dfe298..088931858a 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -524,6 +524,7 @@ public:
bool canLogToIM() const;
bool canShowToast() const;
bool hasFormElements() const;
+ void playSound();
typedef enum e_combine_behavior
{
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;