summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-02-22 19:04:27 -0800
committerRick Pasetto <rick@lindenlab.com>2010-02-22 19:04:27 -0800
commit50a99d5419cd0ea9fe3375726bdc6a34e8102824 (patch)
tree029f70cee6e6bad0b034c793ef72c18d9383f945 /indra/newview/llpanelnearbymedia.cpp
parentea2e72f4502fe58b01a00f8e6b0ae3e47c269e8b (diff)
FIX (unposted bug): "hasMedia" and "hasAudio" no longer checks preferences: it's now up to callers to decide to do that
Review #137
Diffstat (limited to 'indra/newview/llpanelnearbymedia.cpp')
-rw-r--r--indra/newview/llpanelnearbymedia.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 877b31513a..b73d7db770 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -535,7 +535,9 @@ void LLPanelNearByMedia::refreshParcelItems()
const LLSD &choice_llsd = mShowCtrl->getSelectedValue();
MediaClass choice = (MediaClass)choice_llsd.asInteger();
// Only show "special parcel items" if "All" or "Within" filter
- bool should_include = choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL;
+ // (and if media is "enabled")
+ bool should_include = gSavedSettings.getBOOL("AudioStreamingMedia") &&
+ (choice == MEDIA_CLASS_ALL || choice == MEDIA_CLASS_WITHIN_PARCEL);
// First Parcel Media: add or remove it as necessary
if (should_include && LLViewerMedia::hasParcelMedia())
@@ -579,8 +581,8 @@ void LLPanelNearByMedia::refreshParcelItems()
"parcel media");
}
- // Next Parcel Audio: add or remove it as necessary
- if (should_include && LLViewerMedia::hasParcelAudio())
+ // Next Parcel Audio: add or remove it as necessary (don't show if disabled in prefs)
+ if (should_include && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// Yes, there is parcel audio.
if (NULL == mParcelAudioItem)
@@ -692,14 +694,16 @@ void LLPanelNearByMedia::refreshList()
}
}
}
- mDisableAllCtrl->setEnabled(LLViewerMedia::isAnyMediaShowing() ||
- LLViewerMedia::isParcelMediaPlaying() ||
- LLViewerMedia::isParcelAudioPlaying());
- mEnableAllCtrl->setEnabled(disabled_count > 0 ||
- // parcel media (if we have it, and it isn't playing, enable "start")
- (LLViewerMedia::hasParcelMedia() && ! LLViewerMedia::isParcelMediaPlaying()) ||
- // parcel audio (if we have it, and it isn't playing, enable "start")
- (LLViewerMedia::hasParcelAudio() && ! LLViewerMedia::isParcelAudioPlaying()));
+ mDisableAllCtrl->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") &&
+ (LLViewerMedia::isAnyMediaShowing() ||
+ LLViewerMedia::isParcelMediaPlaying() ||
+ LLViewerMedia::isParcelAudioPlaying()));
+ mEnableAllCtrl->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") &&
+ (disabled_count > 0 ||
+ // parcel media (if we have it, and it isn't playing, enable "start")
+ (LLViewerMedia::hasParcelMedia() && ! LLViewerMedia::isParcelMediaPlaying()) ||
+ // parcel audio (if we have it, and it isn't playing, enable "start")
+ (LLViewerMedia::hasParcelAudio() && ! LLViewerMedia::isParcelAudioPlaying())));
// Iterate over the rows in the control, updating ones whose impl exists, and deleting ones whose impl has gone away.
std::vector<LLScrollListItem*> items = mMediaList->getAllData();
@@ -964,7 +968,7 @@ void LLPanelNearByMedia::updateControls()
if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID)
{
- if (!LLViewerMedia::hasParcelAudio())
+ if (!LLViewerMedia::hasParcelAudio() || !gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// Shouldn't happen, but do this anyway
showDisabledControls();