diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index e5a0d91bd0..e6af1df8ab 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -246,6 +246,7 @@ void LLPanelLandAudio::onBtnStreamAdd(LLUICtrl*, void *userdata) if (!music_url.empty()) { LLSD streamlist = gSavedSettings.getLLSD("FSStreamList"); + streamlist["version"] = 1; streamlist["audio"].append(music_url); gSavedSettings.setLLSD("FSStreamList", streamlist); self->refresh(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6bf25daf49..28b3d04738 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -131,14 +131,16 @@ #include "fslslbridge.h" #include "fscommon.h" #include "fscontactsfloater.h" // Display group list in contacts floater +#include "fspose.h" // FIRE-4345: Undeform #include "fswsassetblacklist.h" #include "llavatarpropertiesprocessor.h" // ## Zi: Texture Refresh +#include "llsdserialize.h" #include "lltexturecache.h" // ## Zi: Texture Refresh #include "lllogininstance.h" // #include "llvovolume.h" #include "particleeditor.h" #include "piemenu.h" // ## Zi: Pie Menu -#include "fspose.h" // FIRE-4345: Undeform + using namespace LLAvatarAppearanceDefines; @@ -8678,6 +8680,57 @@ class FSToolsUndeform : public view_listener_t }; // FIRE-4345: Undeform +// Stream list import/export +class FSStreamListExportXML :public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFilePicker& file_picker = LLFilePicker::instance(); + if(file_picker.getSaveFile(LLFilePicker::FFSAVE_XML, LLDir::getScrubbedFileName("stream_list.xml"))) + { + std::string filename = file_picker.getFirstFile(); + llofstream export_file(filename); + LLSDSerialize::toPrettyXML(gSavedSettings.getLLSD("FSStreamList"), export_file); + export_file.close(); + LLSD args; + args["FILENAME"] = filename; + LLNotificationsUtil::add("StreamListExportSuccess", args); + } + else + llinfos << "User closed the filepicker. Aborting!" << llendl; + + return true; + } +}; + +class FSStreamListImportXML :public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFilePicker& file_picker = LLFilePicker::instance(); + if(file_picker.getOpenFile(LLFilePicker::FFLOAD_XML)) + { + std::string filename = file_picker.getFirstFile(); + llifstream stream_list(filename); + if(!stream_list.is_open()) + { + llwarns << "Couldn't open the xml file for reading. Aborting import!" << llendl; + return true; + } + LLSD stream_data; + if(LLSDSerialize::fromXML(stream_data, stream_list) >= 1) + { + gSavedSettings.setLLSD("FSStreamList", stream_data); + LLNotificationsUtil::add("StreamListImportSuccess"); + } + stream_list.close(); + } + + return true; + } +}; +// Stream list import/export + class LLToolsSelectOnlyMyObjects : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -10354,4 +10407,8 @@ void initialize_menus() // Script debug floater commit.add("ShowScriptDebug", boost::bind(&LLFloaterScriptDebug::show, LLUUID::null)); + + // Stream list import/export + view_listener_t::addMenu(new FSStreamListExportXML(), "Streamlist.xml_export"); + view_listener_t::addMenu(new FSStreamListImportXML(), "Streamlist.xml_import"); } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e1c73f44aa..a25d0d7f5d 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2495,6 +2495,23 @@ name="RLVa Embedded" tear_off="true" visible="true" /> + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index bc346bcda1..3cd5265f4c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -11085,6 +11085,20 @@ Error in the regular expression: Successfully saved appearance to XML. + + Successfully exported stream list to XML to [FILENAME]. + + + + Successfully imported stream list from XML. + +