Skip to content
Snippets Groups Projects
Commit 619090ba authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Add music url history to parcel about

parent a9fe1b8e
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -1489,6 +1489,17 @@ ...@@ -1489,6 +1489,17 @@
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>StreamList</key>
<map>
<key>Comment</key>
<string>Saved list of parcel audio streams</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>LLSD</string>
<key>Value</key>
<string />
</map>
<key>VoiceMultiInstance</key> <key>VoiceMultiInstance</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
#include "llviewerregion.h" #include "llviewerregion.h"
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llviewercontrol.h"
// library includes // library includes
#include "llcheckboxctrl.h" #include "llcheckboxctrl.h"
...@@ -88,8 +89,8 @@ BOOL LLPanelLandAudio::postBuild() ...@@ -88,8 +89,8 @@ BOOL LLPanelLandAudio::postBuild()
mCheckParcelVoiceLocal = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_local"); mCheckParcelVoiceLocal = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_local");
childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this); childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this);
mMusicURLEdit = getChild<LLLineEditor>("music_url"); mMusicURLEdit = getChild<LLComboBox>("music_url");
childSetCommitCallback("music_url", onCommitAny, this); mMusicURLEdit->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitMusicUrl, this));
mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check"); mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check");
childSetCommitCallback("all av sound check", onCommitAny, this); childSetCommitCallback("all av sound check", onCommitAny, this);
...@@ -151,8 +152,18 @@ void LLPanelLandAudio::refresh() ...@@ -151,8 +152,18 @@ void LLPanelLandAudio::refresh()
mCheckParcelEnableVoice->set(allow_voice); mCheckParcelEnableVoice->set(allow_voice);
mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel()); mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel());
mMusicURLEdit->setText(parcel->getMusicURL()); const std::string& current_url = parcel->getMusicURL();
mMusicURLEdit->setEnabled( can_change_media ); mMusicURLEdit->clearRows();
LLSD stream_list = gSavedSettings.getLLSD("StreamList");
const LLSD streams = stream_list["audio"];
for (LLSD::array_const_iterator s_itr = streams.beginArray(), s_end = streams.endArray(); s_itr != s_end; ++s_itr)
{
mMusicURLEdit->add(LLSD(*s_itr));
}
mMusicURLEdit->addSeparator(ADD_TOP);
mMusicURLEdit->add(LLSD(current_url), ADD_TOP);
mMusicURLEdit->selectByValue(current_url);
mMusicURLEdit->setEnabled(can_change_media);
BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData(); BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData();
mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds()); mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds());
...@@ -178,7 +189,7 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) ...@@ -178,7 +189,7 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
// Extract data from UI // Extract data from UI
BOOL sound_local = self->mCheckSoundLocal->get(); BOOL sound_local = self->mCheckSoundLocal->get();
std::string music_url = self->mMusicURLEdit->getText(); std::string music_url = self->mMusicURLEdit->getSimple();
BOOL voice_enabled = self->mCheckParcelEnableVoice->get(); BOOL voice_enabled = self->mCheckParcelEnableVoice->get();
BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get(); BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get();
...@@ -210,3 +221,25 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) ...@@ -210,3 +221,25 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
// Might have changed properties, so let's redraw! // Might have changed properties, so let's redraw!
self->refresh(); self->refresh();
} }
void LLPanelLandAudio::onCommitMusicUrl()
{
std::string music_url = mMusicURLEdit->getSimple();
LLStringUtil::trim(music_url);
if (!music_url.empty())
{
LLSD stream_list = gSavedSettings.getLLSD("StreamList");
const LLSD streams = stream_list["audio"];
bool found = false;
for (LLSD::array_const_iterator s_itr = streams.beginArray(), s_end = streams.endArray(); s_itr != s_end; ++s_itr)
{
if (LLStringUtil::compareInsensitive((LLSD(*s_itr)).asString(), music_url) == 0)
found = true;
}
if (!found)
stream_list["audio"].append(music_url);
gSavedSettings.setLLSD("StreamList", stream_list);
}
onCommitAny(mMusicURLEdit, this);
}
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
#ifndef LLPANELLANDAUDIO_H #ifndef LLPANELLANDAUDIO_H
#define LLPANELLANDAUDIO_H #define LLPANELLANDAUDIO_H
#include "lllineeditor.h"
#include "llpanel.h" #include "llpanel.h"
#include "llparcelselection.h" #include "llparcelselection.h"
#include "lluifwd.h" // widget pointer types #include "lluifwd.h" // widget pointer types
class LLComboBox;
class LLPanelLandAudio class LLPanelLandAudio
: public LLPanel : public LLPanel
{ {
...@@ -44,13 +45,14 @@ class LLPanelLandAudio ...@@ -44,13 +45,14 @@ class LLPanelLandAudio
private: private:
static void onCommitAny(LLUICtrl* ctrl, void *userdata); static void onCommitAny(LLUICtrl* ctrl, void *userdata);
void onCommitMusicUrl();
private: private:
LLCheckBoxCtrl* mCheckSoundLocal; LLCheckBoxCtrl* mCheckSoundLocal;
LLCheckBoxCtrl* mCheckParcelEnableVoice; LLCheckBoxCtrl* mCheckParcelEnableVoice;
LLCheckBoxCtrl* mCheckEstateDisabledVoice; LLCheckBoxCtrl* mCheckEstateDisabledVoice;
LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLCheckBoxCtrl* mCheckParcelVoiceLocal;
LLLineEditor* mMusicURLEdit; LLComboBox* mMusicURLEdit;
LLCheckBoxCtrl* mCheckAVSoundAny; LLCheckBoxCtrl* mCheckAVSoundAny;
LLCheckBoxCtrl* mCheckAVSoundGroup; LLCheckBoxCtrl* mCheckAVSoundGroup;
LLCheckBoxCtrl* mCheckObscureMOAP; LLCheckBoxCtrl* mCheckObscureMOAP;
......
...@@ -1842,12 +1842,14 @@ Only large parcels can be listed in search. ...@@ -1842,12 +1842,14 @@ Only large parcels can be listed in search.
width="364"> width="364">
Music URL: Music URL:
</text> </text>
<line_editor <combo_box
allow_text_entry="true"
allow_new_values="true"
follows="left|top|right" follows="left|top|right"
height="23" height="23"
layout="topleft" layout="topleft"
left="100" left="100"
max_length_bytes="255" max_chars="255"
name="music_url" name="music_url"
top_delta="0" top_delta="0"
right="-15" right="-15"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment