summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-02-12 13:38:17 -0800
committerRick Pasetto <rick@lindenlab.com>2010-02-12 13:38:17 -0800
commitffd962f3a3eafd7b65f90039a5bb04dccb0205bc (patch)
tree9f1674862487a62a8c269ae32f424bb2433000b2 /indra/newview/llstatusbar.cpp
parente47dc498e86034a2c991d0add56d522a39354417 (diff)
EXT-5267 EXT-5268: Add Parcel Media and Parcel Audio items to nearby media panel
Review #109 This (fairly major) change adds new "items" to the media list for Parcel Media and Parcel Audio. Since these items are special (before the items were always MoaP impls), they had to be treated special. Moreover, actions on all of "media" had to be centralized so that they would have similar behavior.
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 025f03dc5a..235de89f47 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -376,7 +376,12 @@ void LLStatusBar::refresh()
bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute();
mBtnVolume->setToggleState(mute_audio);
- mMediaToggle->setValue(!LLViewerMedia::isAnyMediaShowing());
+ // Don't show media toggle if there's no media, parcel media, and no parcel audio
+ mMediaToggle->setVisible(LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio());
+ // Note the "sense" of the toggle is opposite whether media is playing or not
+ mMediaToggle->setValue(! (LLViewerMedia::isAnyMediaShowing() ||
+ LLViewerMedia::isParcelMediaPlaying() ||
+ LLViewerMedia::isParcelAudioPlaying()));
}
void LLStatusBar::setVisibleForMouselook(bool visible)
@@ -406,8 +411,8 @@ void LLStatusBar::setBalance(S32 balance)
LLButton* btn_buy_currency = getChild<LLButton>("buycurrency");
LLStringUtil::format_map_t string_args;
string_args["[AMT]"] = llformat("%s", money_str.c_str());
- std::string labe_str = getString("buycurrencylabel", string_args);
- btn_buy_currency->setLabel(labe_str);
+ std::string label_str = getString("buycurrencylabel", string_args);
+ btn_buy_currency->setLabel(label_str);
// Resize the balance button so that the label fits it, and the button expands to the left.
// *TODO: LLButton should have an option where to expand.
@@ -559,7 +564,8 @@ void LLStatusBar::onClickMediaToggle(void* data)
{
LLStatusBar *status_bar = (LLStatusBar*)data;
// "Selected" means it was showing the "play" icon (so media was playing), and now it shows "pause", so turn off media
- LLViewerMedia::setAllMediaEnabled(! status_bar->mMediaToggle->getValue());
+ bool enable = ! status_bar->mMediaToggle->getValue();
+ LLViewerMedia::setAllMediaEnabled(enable);
}
// sets the static variables necessary for the date