From 8ca06e7bf37f7e5391e14f74d8404bdc05d683d4 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 8 Feb 2010 08:19:32 -0800 Subject: nearby media pops up on hover --- indra/newview/llstatusbar.cpp | 72 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 37 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index bff32af228..a2648e4c3a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -130,7 +130,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) // status bar can possible overlay menus? setMouseOpaque(FALSE); - setIsChrome(TRUE); // size of day of the weeks and year sDays.reserve(7); @@ -140,9 +139,39 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mHealthTimer = new LLFrameTimer(); LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml"); +} - // status bar can never get a tab - setFocusRoot(FALSE); +LLStatusBar::~LLStatusBar() +{ + delete mBalanceTimer; + mBalanceTimer = NULL; + + delete mHealthTimer; + mHealthTimer = NULL; + + // LLView destructor cleans up children +} + +//----------------------------------------------------------------------- +// Overrides +//----------------------------------------------------------------------- + +// virtual +void LLStatusBar::draw() +{ + refresh(); + LLPanel::draw(); +} + +BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + show_navbar_context_menu(this,x,y); + return TRUE; +} + +BOOL LLStatusBar::postBuild() +{ + gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); // build date necessary data (must do after panel built) setupDate(); @@ -158,7 +187,9 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); - mBtnVolume->setIsChrome(TRUE); + + LLButton* media_toggle = getChild("media_toggle_btn"); + media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -218,39 +249,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mPanelVolumePulldown->setShape(volume_pulldown_rect); mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); -} - -LLStatusBar::~LLStatusBar() -{ - delete mBalanceTimer; - mBalanceTimer = NULL; - - delete mHealthTimer; - mHealthTimer = NULL; - - // LLView destructor cleans up children -} - -//----------------------------------------------------------------------- -// Overrides -//----------------------------------------------------------------------- - -// virtual -void LLStatusBar::draw() -{ - refresh(); - LLPanel::draw(); -} - -BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - show_navbar_context_menu(this,x,y); - return TRUE; -} - -BOOL LLStatusBar::postBuild() -{ - gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); return TRUE; } -- cgit v1.2.3 From c680368e19f5be7265e2f15a1f4b626b1600e773 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 10 Feb 2010 14:28:46 -0800 Subject: EXT-5261 EXT-5263 EXT-5265 EXT-5266 EXT-5271 - Reformat NMF and enable behavior of media toggle in chrome Review #100 http://10.1.19.90:8080/go?page=ReviewDisplay&reviewid=100 This encompasses the first of the behavioral and structural changes for the Nearby Media Floater and the chrome button at the top of the UI. It includes: - Removal of the Parcel Media and Parcel Audio UI. Still not in the list yet. - New More/Less button, which doesn't quite work right (see below) - Changed icon for UI chrome - Enabled "turning on" and "turning off" media from the chrome and NMF - Added gear icon to bring up prefs - XUI changes to the structure of NMF - Implementation of the "tentative" autoplay flag This is basically a checkpoint so that Richard can help with the More/Less implementation --- indra/newview/llstatusbar.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a2648e4c3a..48de23fab1 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -61,6 +61,7 @@ #include "llresmgr.h" #include "llworld.h" #include "llstatgraph.h" +#include "llviewermedia.h" #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" @@ -188,8 +189,9 @@ BOOL LLStatusBar::postBuild() mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); - LLButton* media_toggle = getChild("media_toggle_btn"); - media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); + mMediaToggle = getChild("media_toggle_btn"); + mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this ); + mMediaToggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -354,6 +356,8 @@ void LLStatusBar::refresh() // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); mBtnVolume->setToggleState(mute_audio); + + mMediaToggle->setValue(!LLViewerMedia::isAnyMediaShowing()); } void LLStatusBar::setVisibleForMouselook(bool visible) @@ -525,6 +529,14 @@ static void onClickVolume(void* data) LLAppViewer::instance()->setMasterSystemAudioMute(!mute_audio); } +//static +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()); +} + // sets the static variables necessary for the date void LLStatusBar::setupDate() { -- cgit v1.2.3 From 6c5b984bf670e34fd88a8f1a0bdeb1042fa531b2 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 11 Feb 2010 18:06:25 -0800 Subject: converted llfloaternearbymedia to llpanelnearbymedia moved from LLTransientDockableFloater model to popup panel model like volume popup --- indra/newview/llstatusbar.cpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a2648e4c3a..64cb739bea 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -41,6 +41,7 @@ #include "llviewercontrol.h" #include "llfloaterbuycurrency.h" #include "llfloaterlagmeter.h" +#include "llpanelnearbymedia.h" #include "llpanelvolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" @@ -189,7 +190,7 @@ BOOL LLStatusBar::postBuild() mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); LLButton* media_toggle = getChild("media_toggle_btn"); - media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); + media_toggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -238,6 +239,9 @@ BOOL LLStatusBar::postBuild() mPanelVolumePulldown = new LLPanelVolumePulldown(); addChild(mPanelVolumePulldown); + mPanelNearByMedia = new LLPanelNearByMedia(); + addChild(mPanelNearByMedia); + LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); LLButton* volbtn = getChild( "volume_btn" ); volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft - @@ -250,6 +254,21 @@ BOOL LLStatusBar::postBuild() mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); + LLRect nearby_media_rect = mPanelNearByMedia->getRect(); + LLButton* nearby_media_btn = getChild( "media_toggle_btn" ); + nearby_media_rect.setLeftTopAndSize(nearby_media_btn->getRect().mLeft - + (volume_pulldown_rect.getWidth() - nearby_media_btn->getRect().getWidth())/2, + nearby_media_btn->calcScreenRect().mBottom, + nearby_media_rect.getWidth(), + nearby_media_rect.getHeight()); + // force onscreen + nearby_media_rect.translate(getRect().getWidth() - nearby_media_rect.mRight, 0); + + mPanelNearByMedia->setShape(nearby_media_rect); + mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + mPanelNearByMedia->setVisible(FALSE); + + return TRUE; } @@ -511,13 +530,19 @@ static void onClickScriptDebug(void*) LLFloaterScriptDebug::show(LLUUID::null); } -//static -void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl) +void LLStatusBar::onMouseEnterVolume() +{ + // show the master volume pull-down + mPanelVolumePulldown->setVisible(TRUE); +} + +void LLStatusBar::onMouseEnterNearbyMedia() { // show the master volume pull-down - gStatusBar->mPanelVolumePulldown->setVisible(TRUE); + mPanelNearByMedia->setVisible(TRUE); } + static void onClickVolume(void* data) { // toggle the master mute setting -- cgit v1.2.3 From ffd962f3a3eafd7b65f90039a5bb04dccb0205bc Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 12 Feb 2010 13:38:17 -0800 Subject: 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. --- indra/newview/llstatusbar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') 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("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 -- cgit v1.2.3 From e159873eec4137b041fc8045f6d79ac6c21d2101 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Feb 2010 16:54:47 -0800 Subject: added popup panel to hold nearby media popup and stopped using top view --- indra/newview/llstatusbar.cpp | 47 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 025f03dc5a..5423b3e99f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -50,6 +50,7 @@ #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" +#include "llrootview.h" #include "llsd.h" #include "lltextbox.h" #include "llui.h" @@ -242,7 +243,11 @@ BOOL LLStatusBar::postBuild() addChild(mPanelVolumePulldown); mPanelNearByMedia = new LLPanelNearByMedia(); - addChild(mPanelNearByMedia); + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + popup_holder->addChild(mPanelNearByMedia); + gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(&LLStatusBar::onClickScreen, this, _1, _2)); + mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + mPanelNearByMedia->setVisible(FALSE); LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); LLButton* volbtn = getChild( "volume_btn" ); @@ -256,21 +261,6 @@ BOOL LLStatusBar::postBuild() mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); - LLRect nearby_media_rect = mPanelNearByMedia->getRect(); - LLButton* nearby_media_btn = getChild( "media_toggle_btn" ); - nearby_media_rect.setLeftTopAndSize(nearby_media_btn->getRect().mLeft - - (volume_pulldown_rect.getWidth() - nearby_media_btn->getRect().getWidth())/2, - nearby_media_btn->calcScreenRect().mBottom, - nearby_media_rect.getWidth(), - nearby_media_rect.getHeight()); - // force onscreen - nearby_media_rect.translate(getRect().getWidth() - nearby_media_rect.mRight, 0); - - mPanelNearByMedia->setShape(nearby_media_rect); - mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); - mPanelNearByMedia->setVisible(FALSE); - - return TRUE; } @@ -542,7 +532,20 @@ void LLStatusBar::onMouseEnterVolume() void LLStatusBar::onMouseEnterNearbyMedia() { + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + LLRect nearby_media_rect = mPanelNearByMedia->getRect(); + LLButton* nearby_media_btn = getChild( "media_toggle_btn" ); + LLRect nearby_media_btn_rect = nearby_media_btn->calcScreenRect(); + nearby_media_rect.setLeftTopAndSize(nearby_media_btn_rect.mLeft - + (nearby_media_rect.getWidth() - nearby_media_btn_rect.getWidth())/2, + nearby_media_btn_rect.mBottom, + nearby_media_rect.getWidth(), + nearby_media_rect.getHeight()); + // force onscreen + nearby_media_rect.translate(popup_holder->getRect().getWidth() - nearby_media_rect.mRight, 0); + // show the master volume pull-down + mPanelNearByMedia->setShape(nearby_media_rect); mPanelNearByMedia->setVisible(TRUE); } @@ -631,6 +634,18 @@ void LLStatusBar::onClickStatGraph(void* data) LLFloaterReg::showInstance("lagmeter"); } +void LLStatusBar::onClickScreen(S32 x, S32 y) +{ + if (mPanelNearByMedia->getVisible()) + { + LLRect screen_rect = mPanelNearByMedia->calcScreenRect(); + if (!screen_rect.pointInRect(x, y)) + { + mPanelNearByMedia->setVisible(FALSE); + } + } +} + BOOL can_afford_transaction(S32 cost) { return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); -- cgit v1.2.3 From 6b736758974d9219c050732e08567cfad4a537b9 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 18 Feb 2010 18:45:27 -0800 Subject: EXT-5545 - make volume popup and nearby media popup mutually exclusive reviewed by Leyla --- indra/newview/llstatusbar.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 923e1e42fb..e83c882866 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -239,25 +239,17 @@ BOOL LLStatusBar::postBuild() childSetActionTextbox("stat_btn", onClickStatGraph); + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + mPanelVolumePulldown = new LLPanelVolumePulldown(); - addChild(mPanelVolumePulldown); + popup_holder->addChild(mPanelVolumePulldown); mPanelNearByMedia = new LLPanelNearByMedia(); - LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); popup_holder->addChild(mPanelNearByMedia); gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(&LLStatusBar::onClickScreen, this, _1, _2)); mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelNearByMedia->setVisible(FALSE); - LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); - LLButton* volbtn = getChild( "volume_btn" ); - volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft - - (volume_pulldown_rect.getWidth() - volbtn->getRect().getWidth())/2, - volbtn->calcScreenRect().mBottom, - volume_pulldown_rect.getWidth(), - volume_pulldown_rect.getHeight()); - - mPanelVolumePulldown->setShape(volume_pulldown_rect); mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); @@ -531,8 +523,21 @@ static void onClickScriptDebug(void*) void LLStatusBar::onMouseEnterVolume() { + LLButton* volbtn = getChild( "volume_btn" ); + LLRect vol_btn_screen_rect = volbtn->calcScreenRect(); + LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); + volume_pulldown_rect.setLeftTopAndSize(vol_btn_screen_rect.mLeft - + (volume_pulldown_rect.getWidth() - vol_btn_screen_rect.getWidth())/2, + vol_btn_screen_rect.mBottom, + volume_pulldown_rect.getWidth(), + volume_pulldown_rect.getHeight()); + + mPanelVolumePulldown->setShape(volume_pulldown_rect); + + // show the master volume pull-down mPanelVolumePulldown->setVisible(TRUE); + mPanelNearByMedia->setVisible(FALSE); } void LLStatusBar::onMouseEnterNearbyMedia() @@ -552,6 +557,7 @@ void LLStatusBar::onMouseEnterNearbyMedia() // show the master volume pull-down mPanelNearByMedia->setShape(nearby_media_rect); mPanelNearByMedia->setVisible(TRUE); + mPanelVolumePulldown->setVisible(FALSE); } -- cgit v1.2.3 From dcfcf50d40685ccc4c092ee0f15297df059da70f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 22 Feb 2010 17:46:34 -0800 Subject: Fix (unposted bug): media "affordance" was not properly being disabled when media was disabled --- indra/newview/llstatusbar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index e83c882866..d90a019697 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -359,7 +359,7 @@ void LLStatusBar::refresh() mBtnVolume->setToggleState(mute_audio); // Don't show media toggle if there's no media, parcel media, and no parcel audio - mMediaToggle->setVisible(LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio()); + mMediaToggle->setEnabled(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() || @@ -547,13 +547,13 @@ void LLStatusBar::onMouseEnterNearbyMedia() LLButton* nearby_media_btn = getChild( "media_toggle_btn" ); LLRect nearby_media_btn_rect = nearby_media_btn->calcScreenRect(); nearby_media_rect.setLeftTopAndSize(nearby_media_btn_rect.mLeft - - (nearby_media_rect.getWidth() - nearby_media_btn_rect.getWidth())/2, - nearby_media_btn_rect.mBottom, - nearby_media_rect.getWidth(), - nearby_media_rect.getHeight()); + (nearby_media_rect.getWidth() - nearby_media_btn_rect.getWidth())/2, + nearby_media_btn_rect.mBottom, + nearby_media_rect.getWidth(), + nearby_media_rect.getHeight()); // force onscreen nearby_media_rect.translate(popup_holder->getRect().getWidth() - nearby_media_rect.mRight, 0); - + // show the master volume pull-down mPanelNearByMedia->setShape(nearby_media_rect); mPanelNearByMedia->setVisible(TRUE); -- cgit v1.2.3 From 50a99d5419cd0ea9fe3375726bdc6a34e8102824 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 22 Feb 2010 19:04:27 -0800 Subject: FIX (unposted bug): "hasMedia" and "hasAudio" no longer checks preferences: it's now up to callers to decide to do that Review #137 --- indra/newview/llstatusbar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index d90a019697..732c23982b 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -358,8 +358,10 @@ void LLStatusBar::refresh() bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); mBtnVolume->setToggleState(mute_audio); - // Don't show media toggle if there's no media, parcel media, and no parcel audio - mMediaToggle->setEnabled(LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio()); + // Disable media toggle if there's no media, parcel media, and no parcel audio + // (or if media is disabled) + mMediaToggle->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") && + (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() || -- cgit v1.2.3 From 5fbf81d17eae532da6d9537401bd677eb04c90ff Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 25 Feb 2010 01:00:50 +0800 Subject: EXT-5410 Streaming audio does ignores preference setting. --- indra/newview/llstatusbar.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llstatusbar.cpp') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 732c23982b..9fb496c214 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -360,12 +360,14 @@ void LLStatusBar::refresh() // Disable media toggle if there's no media, parcel media, and no parcel audio // (or if media is disabled) - mMediaToggle->setEnabled(gSavedSettings.getBOOL("AudioStreamingMedia") && - (LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio())); + bool button_enabled = (gSavedSettings.getBOOL("AudioStreamingMusic")||gSavedSettings.getBOOL("AudioStreamingMedia")) && + (LLViewerMedia::hasInWorldMedia() || LLViewerMedia::hasParcelMedia() || LLViewerMedia::hasParcelAudio()); + mMediaToggle->setEnabled(button_enabled); // Note the "sense" of the toggle is opposite whether media is playing or not - mMediaToggle->setValue(! (LLViewerMedia::isAnyMediaShowing() || + bool any_media_playing = (LLViewerMedia::isAnyMediaShowing() || LLViewerMedia::isParcelMediaPlaying() || - LLViewerMedia::isParcelAudioPlaying())); + LLViewerMedia::isParcelAudioPlaying()); + mMediaToggle->setValue(!any_media_playing); } void LLStatusBar::setVisibleForMouselook(bool visible) -- cgit v1.2.3