diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d511703bd..389b02629 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -507,8 +507,8 @@ BOOL is_god_customer_service(void*); void menu_toggle_attached_lights(void* user_data); void menu_toggle_attached_particles(void* user_data); -BOOL enable_dump_archetype_xm(void*); void handle_dump_archetype_xml(void *); +void handle_dump_archetype_xml_continued(LLVOAvatar* avatar, AIFilePicker* filepicker); void region_change(); void parse_simulator_features(); @@ -4366,11 +4366,6 @@ void handle_claim_public_land(void*) gAgent.sendReliableMessage(); } -BOOL enable_dump_archetype_xm(void*) -{ - return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); -} - void handle_dump_archetype_xml(void *) { std::string emptyname; @@ -4380,9 +4375,25 @@ void handle_dump_archetype_xml(void *) { avatar = gAgentAvatarp; } - avatar->dumpArchetypeXML(emptyname); + + std::string file_name = avatar->getFullname() + (avatar->isSelf() ? "_s" : "_o") + ".xml"; + std::string default_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + + AIFilePicker* filepicker = AIFilePicker::create(); + filepicker->open(file_name, FFSAVE_XML, default_path, "archetype"); + filepicker->run(boost::bind(&handle_dump_archetype_xml_continued, avatar, filepicker)); }; +void handle_dump_archetype_xml_continued(LLVOAvatar* avatar, AIFilePicker* filepicker) +{ + if (!filepicker->hasFilename()) + { + llwarns << "No file" << llendl; + return; + } + avatar->dumpArchetypeXML_cont(filepicker->getFilename(), false); +} + // HACK for easily testing new avatar geometry void handle_god_request_avatar_geometry(void *) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 10ab24309..f451376dd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8282,14 +8282,15 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara { outprefix = getFullname() + (isSelf()?"_s":"_o"); } - if (outprefix.empty()) - { - outprefix = std::string("new_archetype"); - } std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); - LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); + dumpArchetypeXML_cont(fullpath, group_by_wearables); +} + +void LLVOAvatar::dumpArchetypeXML_cont(std::string const& fullpath, bool group_by_wearables ) +{ + LLAPRFile outfile; outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 0299cf070..a6c2e4c7b 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -987,6 +987,7 @@ private: //-------------------------------------------------------------------- public: void dumpArchetypeXML(const std::string& prefix, bool group_by_wearables = false); + void dumpArchetypeXML_cont(std::string const& fullpath, bool group_by_wearables); void dumpAppearanceMsgParams( const std::string& dump_prefix, const std::vector& paramsForDump, const LLTEContents& tec);