summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelnearbymedia.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 23:20:03 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-27 23:20:03 +0200
commit56056aa198fc31a14cb4320762033958e96558cc (patch)
treed274000fb53dc1234cff8cddd8b3d3b756bf3681 /indra/newview/llpanelnearbymedia.cpp
parent78bdf57ad6610b34389226bf941ba736ca0c2225 (diff)
parent191c1791f4f83fee1be6e71aa9e3f246206b2e80 (diff)
Upstream merge from viewer-neko
Diffstat (limited to 'indra/newview/llpanelnearbymedia.cpp')
-rw-r--r--indra/newview/llpanelnearbymedia.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 2dca55514d..b654e928e2 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -43,6 +43,7 @@
#include "llbutton.h"
#include "lltextbox.h"
#include "llviewermedia.h"
+#include "llviewerparcelaskplay.h"
#include "llviewerparcelmedia.h"
#include "llviewerregion.h"
#include "llviewermediafocus.h"
@@ -83,10 +84,11 @@ LLPanelNearByMedia::LLPanelNearByMedia()
{
mHoverTimer.stop();
- mParcelAudioAutoStart = gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) &&
- gSavedSettings.getBOOL("MediaTentativeAutoPlay");
+ // This is just an initial value, mParcelAudioAutoStart does not affect ParcelMediaAutoPlayEnable
+ mParcelAudioAutoStart = gSavedSettings.getS32("ParcelMediaAutoPlayEnable") != 0
+ && gSavedSettings.getBOOL("MediaTentativeAutoPlay");
- gSavedSettings.getControl(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)->getSignal()->connect(boost::bind(&LLPanelNearByMedia::handleMediaAutoPlayChanged, this, _2));
+ gSavedSettings.getControl("ParcelMediaAutoPlayEnable")->getSignal()->connect(boost::bind(&LLPanelNearByMedia::handleMediaAutoPlayChanged, this, _2));
mCommitCallbackRegistrar.add("MediaListCtrl.EnableAll", boost::bind(&LLPanelNearByMedia::onClickEnableAll, this));
mCommitCallbackRegistrar.add("MediaListCtrl.DisableAll", boost::bind(&LLPanelNearByMedia::onClickDisableAll, this));
@@ -177,9 +179,18 @@ BOOL LLPanelNearByMedia::postBuild()
void LLPanelNearByMedia::handleMediaAutoPlayChanged(const LLSD& newvalue)
{
- // update mParcelAudioAutoStart if AUTO_PLAY_MEDIA_SETTING changes
- mParcelAudioAutoStart = gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) &&
- gSavedSettings.getBOOL("MediaTentativeAutoPlay");
+ // update mParcelAudioAutoStartMode if "ParcelMediaAutoPlayEnable" changes
+ S32 value = gSavedSettings.getS32("ParcelMediaAutoPlayEnable");
+ mParcelAudioAutoStart = value != 0
+ && gSavedSettings.getBOOL("MediaTentativeAutoPlay");
+
+ LLViewerParcelAskPlay *inst = LLViewerParcelAskPlay::getInstance();
+ if (value == 2 && !inst->hasData())
+ {
+ // Init if nessesary
+ inst->loadSettings();
+ }
+ inst->cancelNotification();
}
/*virtual*/