diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index c6ba14575ecd0399fd046ad62e2f58bc90feb3b4..0f91ba8e0a5a5c3ab102a49299621c6364bb0e63 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -1489,6 +1489,17 @@ <key>Value</key> <integer>0</integer> </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> <map> <key>Comment</key> diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index 9e3fc544773ab2c27285b870b4f18072c8b14318..09f28315974ea4cde260bc88b3aefaf9680cdd85 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -34,6 +34,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "lluictrlfactory.h" +#include "llviewercontrol.h" // library includes #include "llcheckboxctrl.h" @@ -88,8 +89,8 @@ BOOL LLPanelLandAudio::postBuild() mCheckParcelVoiceLocal = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_local"); childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this); - mMusicURLEdit = getChild<LLLineEditor>("music_url"); - childSetCommitCallback("music_url", onCommitAny, this); + mMusicURLEdit = getChild<LLComboBox>("music_url"); + mMusicURLEdit->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitMusicUrl, this)); mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check"); childSetCommitCallback("all av sound check", onCommitAny, this); @@ -151,8 +152,18 @@ void LLPanelLandAudio::refresh() mCheckParcelEnableVoice->set(allow_voice); mCheckParcelVoiceLocal->set(!parcel->getParcelFlagUseEstateVoiceChannel()); - mMusicURLEdit->setText(parcel->getMusicURL()); - mMusicURLEdit->setEnabled( can_change_media ); + const std::string& current_url = parcel->getMusicURL(); + 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(); mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds()); @@ -178,7 +189,7 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) // Extract data from UI 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_estate_chan = !self->mCheckParcelVoiceLocal->get(); @@ -210,3 +221,25 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) // Might have changed properties, so let's redraw! 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); +} diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index b54fe62179a9f294af384e0daa3c5a02e9926f07..d1024d89fdf2cdc853319f23a86a16296af763c0 100644 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -28,11 +28,12 @@ #ifndef LLPANELLANDAUDIO_H #define LLPANELLANDAUDIO_H -#include "lllineeditor.h" #include "llpanel.h" #include "llparcelselection.h" #include "lluifwd.h" // widget pointer types +class LLComboBox; + class LLPanelLandAudio : public LLPanel { @@ -44,13 +45,14 @@ class LLPanelLandAudio private: static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitMusicUrl(); private: LLCheckBoxCtrl* mCheckSoundLocal; LLCheckBoxCtrl* mCheckParcelEnableVoice; LLCheckBoxCtrl* mCheckEstateDisabledVoice; LLCheckBoxCtrl* mCheckParcelVoiceLocal; - LLLineEditor* mMusicURLEdit; + LLComboBox* mMusicURLEdit; LLCheckBoxCtrl* mCheckAVSoundAny; LLCheckBoxCtrl* mCheckAVSoundGroup; LLCheckBoxCtrl* mCheckObscureMOAP; diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 120f27ffb181e2ae5ad64d8706a58a6fe0b04bd0..eb5c1623fbca2d0a67c596fa63c580e31806a835 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1842,12 +1842,14 @@ Only large parcels can be listed in search. width="364"> Music URL: </text> - <line_editor + <combo_box + allow_text_entry="true" + allow_new_values="true" follows="left|top|right" height="23" layout="topleft" left="100" - max_length_bytes="255" + max_chars="255" name="music_url" top_delta="0" right="-15"