add a deque specifically for use with llmessagelogfilter apply to defeat iterator invalidation, replace crlf with lf

This commit is contained in:
Hazim Gazov
2010-06-09 21:41:34 +00:00
parent 70e296e174
commit 4721c0d9bd
6 changed files with 429 additions and 417 deletions

View File

@@ -1,219 +1,219 @@
// <edit> // <edit>
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llao.h" #include "llao.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llfilepicker.h" #include "llfilepicker.h"
#include "llsdserialize.h" #include "llsdserialize.h"
std::map<LLUUID,LLUUID> LLAO::mOverrides; std::map<LLUUID,LLUUID> LLAO::mOverrides;
LLFloaterAO* LLFloaterAO::sInstance; LLFloaterAO* LLFloaterAO::sInstance;
//static //static
void LLAO::refresh() void LLAO::refresh()
{ {
mOverrides.clear(); mOverrides.clear();
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings"); LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
LLSD overrides = settings["overrides"]; LLSD overrides = settings["overrides"];
LLSD::map_iterator sd_it = overrides.beginMap(); LLSD::map_iterator sd_it = overrides.beginMap();
LLSD::map_iterator sd_end = overrides.endMap(); LLSD::map_iterator sd_end = overrides.endMap();
for( ; sd_it != sd_end; sd_it++) for( ; sd_it != sd_end; sd_it++)
{ {
// don't allow override to be used as a trigger // don't allow override to be used as a trigger
if(mOverrides.find(sd_it->second.asUUID()) == mOverrides.end()) if(mOverrides.find(sd_it->second.asUUID()) == mOverrides.end())
{ {
// ignore if override is null key... // ignore if override is null key...
if(sd_it->second.asUUID().notNull()) if(sd_it->second.asUUID().notNull())
{ {
mOverrides[LLUUID(sd_it->first)] = sd_it->second.asUUID(); mOverrides[LLUUID(sd_it->first)] = sd_it->second.asUUID();
} }
} }
} }
} }
//static //static
void LLFloaterAO::show() void LLFloaterAO::show()
{ {
if(sInstance) if(sInstance)
sInstance->open(); sInstance->open();
else else
(new LLFloaterAO())->open(); (new LLFloaterAO())->open();
} }
LLFloaterAO::LLFloaterAO() LLFloaterAO::LLFloaterAO()
: LLFloater() : LLFloater()
{ {
sInstance = this; sInstance = this;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ao.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ao.xml");
} }
LLFloaterAO::~LLFloaterAO() LLFloaterAO::~LLFloaterAO()
{ {
sInstance = NULL; sInstance = NULL;
} }
BOOL LLFloaterAO::postBuild(void) BOOL LLFloaterAO::postBuild(void)
{ {
childSetAction("btn_save", onClickSave, this); childSetAction("btn_save", onClickSave, this);
childSetAction("btn_load", onClickLoad, this); childSetAction("btn_load", onClickLoad, this);
childSetCommitCallback("line_walking", onCommitAnim, this); childSetCommitCallback("line_walking", onCommitAnim, this);
childSetCommitCallback("line_running", onCommitAnim, this); childSetCommitCallback("line_running", onCommitAnim, this);
childSetCommitCallback("line_crouchwalk", onCommitAnim, this); childSetCommitCallback("line_crouchwalk", onCommitAnim, this);
childSetCommitCallback("line_flying", onCommitAnim, this); childSetCommitCallback("line_flying", onCommitAnim, this);
childSetCommitCallback("line_turn_left", onCommitAnim, this); childSetCommitCallback("line_turn_left", onCommitAnim, this);
childSetCommitCallback("line_turn_right", onCommitAnim, this); childSetCommitCallback("line_turn_right", onCommitAnim, this);
childSetCommitCallback("line_jumping", onCommitAnim, this); childSetCommitCallback("line_jumping", onCommitAnim, this);
childSetCommitCallback("line_fly_up", onCommitAnim, this); childSetCommitCallback("line_fly_up", onCommitAnim, this);
childSetCommitCallback("line_crouching", onCommitAnim, this); childSetCommitCallback("line_crouching", onCommitAnim, this);
childSetCommitCallback("line_fly_down", onCommitAnim, this); childSetCommitCallback("line_fly_down", onCommitAnim, this);
childSetCommitCallback("line_stand1", onCommitAnim, this); childSetCommitCallback("line_stand1", onCommitAnim, this);
childSetCommitCallback("line_stand2", onCommitAnim, this); childSetCommitCallback("line_stand2", onCommitAnim, this);
childSetCommitCallback("line_stand3", onCommitAnim, this); childSetCommitCallback("line_stand3", onCommitAnim, this);
childSetCommitCallback("line_hover", onCommitAnim, this); childSetCommitCallback("line_hover", onCommitAnim, this);
childSetCommitCallback("line_sitting", onCommitAnim, this); childSetCommitCallback("line_sitting", onCommitAnim, this);
childSetCommitCallback("line_prejump", onCommitAnim, this); childSetCommitCallback("line_prejump", onCommitAnim, this);
childSetCommitCallback("line_falling", onCommitAnim, this); childSetCommitCallback("line_falling", onCommitAnim, this);
childSetCommitCallback("line_stride", onCommitAnim, this); childSetCommitCallback("line_stride", onCommitAnim, this);
childSetCommitCallback("line_soft_landing", onCommitAnim, this); childSetCommitCallback("line_soft_landing", onCommitAnim, this);
childSetCommitCallback("line_medium_landing", onCommitAnim, this); childSetCommitCallback("line_medium_landing", onCommitAnim, this);
childSetCommitCallback("line_hard_landing", onCommitAnim, this); childSetCommitCallback("line_hard_landing", onCommitAnim, this);
childSetCommitCallback("line_flying_slow", onCommitAnim, this); childSetCommitCallback("line_flying_slow", onCommitAnim, this);
childSetCommitCallback("line_sitting_on_ground", onCommitAnim, this); childSetCommitCallback("line_sitting_on_ground", onCommitAnim, this);
refresh(); refresh();
return TRUE; return TRUE;
} }
std::string LLFloaterAO::idstr(LLUUID id) std::string LLFloaterAO::idstr(LLUUID id)
{ {
if(id.notNull()) return id.asString(); if(id.notNull()) return id.asString();
else return ""; else return "";
} }
void LLFloaterAO::refresh() void LLFloaterAO::refresh()
{ {
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings"); LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
LLSD overrides = settings["overrides"]; LLSD overrides = settings["overrides"];
childSetText("line_walking", idstr(overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"])); childSetText("line_walking", idstr(overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"]));
childSetText("line_running", idstr(overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"])); childSetText("line_running", idstr(overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"]));
childSetText("line_crouchwalk", idstr(overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"])); childSetText("line_crouchwalk", idstr(overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"]));
childSetText("line_flying", idstr(overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"])); childSetText("line_flying", idstr(overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"]));
childSetText("line_turn_left", idstr(overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"])); childSetText("line_turn_left", idstr(overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"]));
childSetText("line_turn_right", idstr(overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"])); childSetText("line_turn_right", idstr(overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"]));
childSetText("line_jumping", idstr(overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"])); childSetText("line_jumping", idstr(overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"]));
childSetText("line_fly_up", idstr(overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"])); childSetText("line_fly_up", idstr(overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"]));
childSetText("line_crouching", idstr(overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"])); childSetText("line_crouching", idstr(overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"]));
childSetText("line_fly_down", idstr(overrides["20f063ea-8306-2562-0b07-5c853b37b31e"])); childSetText("line_fly_down", idstr(overrides["20f063ea-8306-2562-0b07-5c853b37b31e"]));
childSetText("line_stand1", idstr(overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"])); childSetText("line_stand1", idstr(overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"]));
childSetText("line_stand2", idstr(overrides["15468e00-3400-bb66-cecc-646d7c14458e"])); childSetText("line_stand2", idstr(overrides["15468e00-3400-bb66-cecc-646d7c14458e"]));
childSetText("line_stand3", idstr(overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"])); childSetText("line_stand3", idstr(overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"]));
childSetText("line_hover", idstr(overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"])); childSetText("line_hover", idstr(overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"]));
childSetText("line_sitting", idstr(overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"])); childSetText("line_sitting", idstr(overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"]));
childSetText("line_prejump", idstr(overrides["7a4e87fe-de39-6fcb-6223-024b00893244"])); childSetText("line_prejump", idstr(overrides["7a4e87fe-de39-6fcb-6223-024b00893244"]));
childSetText("line_falling", idstr(overrides["666307d9-a860-572d-6fd4-c3ab8865c094"])); childSetText("line_falling", idstr(overrides["666307d9-a860-572d-6fd4-c3ab8865c094"]));
childSetText("line_stride", idstr(overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"])); childSetText("line_stride", idstr(overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"]));
childSetText("line_soft_landing", idstr(overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"])); childSetText("line_soft_landing", idstr(overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"]));
childSetText("line_medium_landing", idstr(overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"])); childSetText("line_medium_landing", idstr(overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"]));
childSetText("line_hard_landing", idstr(overrides["3da1d753-028a-5446-24f3-9c9b856d9422"])); childSetText("line_hard_landing", idstr(overrides["3da1d753-028a-5446-24f3-9c9b856d9422"]));
childSetText("line_flying_slow", idstr(overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"])); childSetText("line_flying_slow", idstr(overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"]));
childSetText("line_sitting_on_ground", idstr(overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"])); childSetText("line_sitting_on_ground", idstr(overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"]));
} }
// static // static
void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data) void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
{ {
LLFloaterAO* floater = (LLFloaterAO*)user_data; LLFloaterAO* floater = (LLFloaterAO*)user_data;
LLSD overrides; LLSD overrides;
LLUUID id; LLUUID id;
id = LLUUID(floater->childGetValue("line_walking").asString()); id = LLUUID(floater->childGetValue("line_walking").asString());
if(id.notNull()) overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"] = id; if(id.notNull()) overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"] = id;
id = LLUUID(floater->childGetValue("line_running").asString()); id = LLUUID(floater->childGetValue("line_running").asString());
if(id.notNull()) overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"] = id; if(id.notNull()) overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"] = id;
id = LLUUID(floater->childGetValue("line_crouchwalk").asString()); id = LLUUID(floater->childGetValue("line_crouchwalk").asString());
if(id.notNull()) overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"] = id; if(id.notNull()) overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"] = id;
id = LLUUID(floater->childGetValue("line_flying").asString()); id = LLUUID(floater->childGetValue("line_flying").asString());
if(id.notNull()) overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"] = id; if(id.notNull()) overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"] = id;
id = LLUUID(floater->childGetValue("line_turn_left").asString()); id = LLUUID(floater->childGetValue("line_turn_left").asString());
if(id.notNull()) overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"] = id; if(id.notNull()) overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"] = id;
id = LLUUID(floater->childGetValue("line_turn_right").asString()); id = LLUUID(floater->childGetValue("line_turn_right").asString());
if(id.notNull()) overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"] = id; if(id.notNull()) overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"] = id;
id = LLUUID(floater->childGetValue("line_jumping").asString()); id = LLUUID(floater->childGetValue("line_jumping").asString());
if(id.notNull()) overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"] = id; if(id.notNull()) overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"] = id;
id = LLUUID(floater->childGetValue("line_fly_up").asString()); id = LLUUID(floater->childGetValue("line_fly_up").asString());
if(id.notNull()) overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"] = id; if(id.notNull()) overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"] = id;
id = LLUUID(floater->childGetValue("line_crouching").asString()); id = LLUUID(floater->childGetValue("line_crouching").asString());
if(id.notNull()) overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"] = id; if(id.notNull()) overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"] = id;
id = LLUUID(floater->childGetValue("line_fly_down").asString()); id = LLUUID(floater->childGetValue("line_fly_down").asString());
if(id.notNull()) overrides["20f063ea-8306-2562-0b07-5c853b37b31e"] = id; if(id.notNull()) overrides["20f063ea-8306-2562-0b07-5c853b37b31e"] = id;
id = LLUUID(floater->childGetValue("line_stand1").asString()); id = LLUUID(floater->childGetValue("line_stand1").asString());
if(id.notNull()) overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"] = id; if(id.notNull()) overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"] = id;
id = LLUUID(floater->childGetValue("line_stand2").asString()); id = LLUUID(floater->childGetValue("line_stand2").asString());
if(id.notNull()) overrides["15468e00-3400-bb66-cecc-646d7c14458e"] = id; if(id.notNull()) overrides["15468e00-3400-bb66-cecc-646d7c14458e"] = id;
id = LLUUID(floater->childGetValue("line_stand3").asString()); id = LLUUID(floater->childGetValue("line_stand3").asString());
if(id.notNull()) overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"] = id; if(id.notNull()) overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"] = id;
id = LLUUID(floater->childGetValue("line_hover").asString()); id = LLUUID(floater->childGetValue("line_hover").asString());
if(id.notNull()) overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"] = id; if(id.notNull()) overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"] = id;
id = LLUUID(floater->childGetValue("line_sitting").asString()); id = LLUUID(floater->childGetValue("line_sitting").asString());
if(id.notNull()) overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"] = id; if(id.notNull()) overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"] = id;
id = LLUUID(floater->childGetValue("line_prejump").asString()); id = LLUUID(floater->childGetValue("line_prejump").asString());
if(id.notNull()) overrides["7a4e87fe-de39-6fcb-6223-024b00893244"] = id; if(id.notNull()) overrides["7a4e87fe-de39-6fcb-6223-024b00893244"] = id;
id = LLUUID(floater->childGetValue("line_falling").asString()); id = LLUUID(floater->childGetValue("line_falling").asString());
if(id.notNull()) overrides["666307d9-a860-572d-6fd4-c3ab8865c094"] = id; if(id.notNull()) overrides["666307d9-a860-572d-6fd4-c3ab8865c094"] = id;
id = LLUUID(floater->childGetValue("line_stride").asString()); id = LLUUID(floater->childGetValue("line_stride").asString());
if(id.notNull()) overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"] = id; if(id.notNull()) overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"] = id;
id = LLUUID(floater->childGetValue("line_soft_landing").asString()); id = LLUUID(floater->childGetValue("line_soft_landing").asString());
if(id.notNull()) overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"] = id; if(id.notNull()) overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"] = id;
id = LLUUID(floater->childGetValue("line_medium_landing").asString()); id = LLUUID(floater->childGetValue("line_medium_landing").asString());
if(id.notNull()) overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"] = id; if(id.notNull()) overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"] = id;
id = LLUUID(floater->childGetValue("line_hard_landing").asString()); id = LLUUID(floater->childGetValue("line_hard_landing").asString());
if(id.notNull()) overrides["3da1d753-028a-5446-24f3-9c9b856d9422"] = id; if(id.notNull()) overrides["3da1d753-028a-5446-24f3-9c9b856d9422"] = id;
id = LLUUID(floater->childGetValue("line_flying_slow").asString()); id = LLUUID(floater->childGetValue("line_flying_slow").asString());
if(id.notNull()) overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"] = id; if(id.notNull()) overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"] = id;
id = LLUUID(floater->childGetValue("line_sitting_on_ground").asString()); id = LLUUID(floater->childGetValue("line_sitting_on_ground").asString());
if(id.notNull()) overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"] = id; if(id.notNull()) overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"] = id;
LLSD settings; LLSD settings;
settings["version"] = 1; settings["version"] = 1;
settings["overrides"] = overrides; settings["overrides"] = overrides;
gSavedPerAccountSettings.setLLSD("AO.Settings", settings); gSavedPerAccountSettings.setLLSD("AO.Settings", settings);
LLAO::refresh(); LLAO::refresh();
floater->refresh(); floater->refresh();
} }
//static //static
void LLFloaterAO::onClickSave(void* user_data) void LLFloaterAO::onClickSave(void* user_data)
{ {
LLFilePicker& file_picker = LLFilePicker::instance(); LLFilePicker& file_picker = LLFilePicker::instance();
if(file_picker.getSaveFile( LLFilePicker::FFSAVE_AO, LLDir::getScrubbedFileName("untitled.ao"))) if(file_picker.getSaveFile( LLFilePicker::FFSAVE_AO, LLDir::getScrubbedFileName("untitled.ao")))
{ {
std::string file_name = file_picker.getFirstFile(); std::string file_name = file_picker.getFirstFile();
llofstream export_file(file_name); llofstream export_file(file_name);
LLSDSerialize::toPrettyXML(gSavedPerAccountSettings.getLLSD("AO.Settings"), export_file); LLSDSerialize::toPrettyXML(gSavedPerAccountSettings.getLLSD("AO.Settings"), export_file);
export_file.close(); export_file.close();
} }
} }
//static //static
void LLFloaterAO::onClickLoad(void* user_data) void LLFloaterAO::onClickLoad(void* user_data)
{ {
LLFloaterAO* floater = (LLFloaterAO*)user_data; LLFloaterAO* floater = (LLFloaterAO*)user_data;
LLFilePicker& file_picker = LLFilePicker::instance(); LLFilePicker& file_picker = LLFilePicker::instance();
if(file_picker.getOpenFile(LLFilePicker::FFLOAD_AO)) if(file_picker.getOpenFile(LLFilePicker::FFLOAD_AO))
{ {
std::string file_name = file_picker.getFirstFile(); std::string file_name = file_picker.getFirstFile();
llifstream xml_file(file_name); llifstream xml_file(file_name);
if(!xml_file.is_open()) return; if(!xml_file.is_open()) return;
LLSD data; LLSD data;
if(LLSDSerialize::fromXML(data, xml_file) >= 1) if(LLSDSerialize::fromXML(data, xml_file) >= 1)
{ {
gSavedPerAccountSettings.setLLSD("AO.Settings", data); gSavedPerAccountSettings.setLLSD("AO.Settings", data);
LLAO::refresh(); LLAO::refresh();
floater->refresh(); floater->refresh();
} }
xml_file.close(); xml_file.close();
} }
} }
// </edit> // </edit>

View File

@@ -1,32 +1,32 @@
// <edit> // <edit>
#ifndef LL_LLAO_H #ifndef LL_LLAO_H
#define LL_LLAO_H #define LL_LLAO_H
#include "llfloater.h" #include "llfloater.h"
class LLAO class LLAO
{ {
public: public:
static std::map<LLUUID,LLUUID> mOverrides; static std::map<LLUUID,LLUUID> mOverrides;
static void refresh(); static void refresh();
}; };
class LLFloaterAO : public LLFloater class LLFloaterAO : public LLFloater
{ {
public: public:
static LLFloaterAO* sInstance; static LLFloaterAO* sInstance;
static void show(); static void show();
LLFloaterAO(); LLFloaterAO();
BOOL postBuild(void); BOOL postBuild(void);
void refresh(); void refresh();
static void onCommitAnim(LLUICtrl* ctrl, void* user_data); static void onCommitAnim(LLUICtrl* ctrl, void* user_data);
static void onClickSave(void* user_data); static void onClickSave(void* user_data);
static void onClickLoad(void* user_data); static void onClickLoad(void* user_data);
private: private:
virtual ~LLFloaterAO(); virtual ~LLFloaterAO();
std::string idstr(LLUUID id); // silly utility std::string idstr(LLUUID id); // silly utility
}; };
#endif #endif
// </edit> // </edit>

View File

@@ -23,6 +23,10 @@ LLFloaterExportRegion::LLFloaterExportRegion(const LLSD& unused)
{ {
sInstance = this; sInstance = this;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml");
//populate the list of objects to export
//int numOfObjects = gObjectList.getNumObjects();
} }

View File

@@ -412,7 +412,9 @@ LLMessageLogFilterApply::LLMessageLogFilterApply()
mFinished(FALSE), mFinished(FALSE),
mProgress(0) mProgress(0)
{ {
mIter = LLFloaterMessageLog::sMessageLogEntries.begin(); //make extra sure we don't invalidate any iterators and reserve a deque exclusively for our use
mFilterTempMessages = new std::deque <LLMessageLogEntry>(LLFloaterMessageLog::sMessageLogEntries);
mIter = mFilterTempMessages->begin();
} }
void LLMessageLogFilterApply::cancel() void LLMessageLogFilterApply::cancel()
{ {
@@ -420,7 +422,7 @@ void LLMessageLogFilterApply::cancel()
} }
BOOL LLMessageLogFilterApply::tick() BOOL LLMessageLogFilterApply::tick()
{ {
std::deque<LLMessageLogEntry>::iterator end = LLFloaterMessageLog::sMessageLogEntries.end(); std::deque<LLMessageLogEntry>::iterator end = mFilterTempMessages->end();
if(mIter == end || !LLFloaterMessageLog::sInstance) if(mIter == end || !LLFloaterMessageLog::sInstance)
{ {
mFinished = TRUE; mFinished = TRUE;
@@ -445,6 +447,9 @@ BOOL LLMessageLogFilterApply::tick()
LLFloaterMessageLog::sInstance->stopApplyingFilter(); LLFloaterMessageLog::sInstance->stopApplyingFilter();
} }
} }
delete mFilterTempMessages;
return TRUE; return TRUE;
} }
@@ -686,7 +691,9 @@ void LLFloaterMessageLog::onLog(LLMessageLogEntry entry)
{ {
sMessageLogEntries.push_back(entry); sMessageLogEntries.push_back(entry);
if(!sBusyApplyingFilter) if(!sBusyApplyingFilter)
{
conditionalLog(LLFloaterMessageLogItem(entry)); conditionalLog(LLFloaterMessageLogItem(entry));
}
} }
// static // static
void LLFloaterMessageLog::conditionalLog(LLFloaterMessageLogItem item) void LLFloaterMessageLog::conditionalLog(LLFloaterMessageLogItem item)

View File

@@ -1,91 +1,92 @@
// <edit> // <edit>
#include "llfloater.h" #include "llfloater.h"
#include "llmessagelog.h" #include "llmessagelog.h"
#include "lltemplatemessagereader.h" #include "lltemplatemessagereader.h"
class LLNetListItem class LLNetListItem
{ {
public: public:
LLNetListItem(LLUUID id); LLNetListItem(LLUUID id);
LLUUID mID; LLUUID mID;
BOOL mAutoName; BOOL mAutoName;
std::string mName; std::string mName;
std::string mPreviousRegionName; std::string mPreviousRegionName;
LLCircuitData* mCircuitData; LLCircuitData* mCircuitData;
}; };
class LLFloaterMessageLogItem : public LLMessageLogEntry class LLFloaterMessageLogItem : public LLMessageLogEntry
{ {
public: public:
LLFloaterMessageLogItem(LLMessageLogEntry entry); LLFloaterMessageLogItem(LLMessageLogEntry entry);
~LLFloaterMessageLogItem(); ~LLFloaterMessageLogItem();
LLUUID mID; LLUUID mID;
U32 mSequenceID; U32 mSequenceID;
std::string mName; std::string mName;
std::string mSummary; std::string mSummary;
U32 mFlags; U32 mFlags;
std::string getFull(BOOL show_header = TRUE); std::string getFull(BOOL show_header = TRUE);
BOOL isOutgoing(); BOOL isOutgoing();
private: private:
static LLTemplateMessageReader* sTemplateMessageReader; static LLTemplateMessageReader* sTemplateMessageReader;
static std::string getString(LLTemplateMessageReader* readerp, const char* block_name, S32 block_num, const char* var_name, e_message_variable_type var_type, BOOL &returned_hex, BOOL summary_mode = FALSE); static std::string getString(LLTemplateMessageReader* readerp, const char* block_name, S32 block_num, const char* var_name, e_message_variable_type var_type, BOOL &returned_hex, BOOL summary_mode = FALSE);
}; };
class LLMessageLogFilter class LLMessageLogFilter
{ {
public: public:
LLMessageLogFilter(); LLMessageLogFilter();
~LLMessageLogFilter(); ~LLMessageLogFilter();
BOOL set(std::string filter); BOOL set(std::string filter);
std::list<std::string> mPositiveNames; std::list<std::string> mPositiveNames;
std::list<std::string> mNegativeNames; std::list<std::string> mNegativeNames;
}; };
class LLMessageLogFilterApply : public LLEventTimer class LLMessageLogFilterApply : public LLEventTimer
{ {
public: public:
LLMessageLogFilterApply(); LLMessageLogFilterApply();
void cancel(); void cancel();
BOOL tick(); BOOL tick();
S32 mProgress; S32 mProgress;
BOOL mFinished; BOOL mFinished;
private: private:
std::deque<LLMessageLogEntry>::iterator mIter; std::deque<LLMessageLogEntry> *mFilterTempMessages;
}; std::deque<LLMessageLogEntry>::iterator mIter;
class LLFloaterMessageLog : public LLFloater, public LLEventTimer };
{ class LLFloaterMessageLog : public LLFloater, public LLEventTimer
public: {
LLFloaterMessageLog(); public:
~LLFloaterMessageLog(); LLFloaterMessageLog();
static void show(); ~LLFloaterMessageLog();
BOOL postBuild(); static void show();
BOOL tick(); BOOL postBuild();
LLNetListItem* findNetListItem(LLHost host); BOOL tick();
LLNetListItem* findNetListItem(LLUUID id); LLNetListItem* findNetListItem(LLHost host);
void refreshNetList(); LLNetListItem* findNetListItem(LLUUID id);
void refreshNetInfo(BOOL force); void refreshNetList();
enum ENetInfoMode { NI_NET, NI_LOG }; void refreshNetInfo(BOOL force);
void setNetInfoMode(ENetInfoMode mode); enum ENetInfoMode { NI_NET, NI_LOG };
static void onLog(LLMessageLogEntry entry); void setNetInfoMode(ENetInfoMode mode);
static void conditionalLog(LLFloaterMessageLogItem item); static void onLog(LLMessageLogEntry entry);
static void onCommitNetList(LLUICtrl* ctrl, void* user_data); static void conditionalLog(LLFloaterMessageLogItem item);
static void onCommitMessageLog(LLUICtrl* ctrl, void* user_data); static void onCommitNetList(LLUICtrl* ctrl, void* user_data);
static void onCommitFilter(LLUICtrl* ctrl, void* user_data); static void onCommitMessageLog(LLUICtrl* ctrl, void* user_data);
static BOOL onClickCloseCircuit(void* user_data); static void onCommitFilter(LLUICtrl* ctrl, void* user_data);
static void onConfirmCloseCircuit(S32 option, LLSD payload); static BOOL onClickCloseCircuit(void* user_data);
static void onConfirmRemoveRegion(S32 option, LLSD payload); static void onConfirmCloseCircuit(S32 option, LLSD payload);
static void onClickFilterApply(void* user_data); static void onConfirmRemoveRegion(S32 option, LLSD payload);
void startApplyingFilter(std::string filter, BOOL force); static void onClickFilterApply(void* user_data);
void stopApplyingFilter(); void startApplyingFilter(std::string filter, BOOL force);
void updateFilterStatus(); void stopApplyingFilter();
static BOOL sBusyApplyingFilter; void updateFilterStatus();
LLMessageLogFilterApply* mMessageLogFilterApply; static BOOL sBusyApplyingFilter;
static void onClickClearLog(void* user_data); LLMessageLogFilterApply* mMessageLogFilterApply;
static LLFloaterMessageLog* sInstance; static void onClickClearLog(void* user_data);
static std::list<LLNetListItem*> sNetListItems; static LLFloaterMessageLog* sInstance;
static std::deque<LLMessageLogEntry> sMessageLogEntries; static std::list<LLNetListItem*> sNetListItems;
static std::vector<LLFloaterMessageLogItem> sFloaterMessageLogItems; static std::deque<LLMessageLogEntry> sMessageLogEntries;
static LLMessageLogFilter sMessageLogFilter; static std::vector<LLFloaterMessageLogItem> sFloaterMessageLogItems;
static std::string sMessageLogFilterString; static LLMessageLogFilter sMessageLogFilter;
ENetInfoMode mNetInfoMode; static std::string sMessageLogFilterString;
static void onClickFilterChoice(void* user_data); ENetInfoMode mNetInfoMode;
static void onClickFilterMenu(void* user_data); static void onClickFilterChoice(void* user_data);
static void onClickSendToMessageBuilder(void* user_data); static void onClickFilterMenu(void* user_data);
}; static void onClickSendToMessageBuilder(void* user_data);
// </edit> };
// </edit>

View File

@@ -1,122 +1,122 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false" <floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
width="410" height="650" width="410" height="650"
name="AO Editor" title="AO Editor" rect_control="FloaterAORect"> name="AO Editor" title="AO Editor" rect_control="FloaterAORect">
<button bottom="-50" halign="center" height="24" label="Load..." left="220" name="btn_load" width="80" /> <button bottom="-50" halign="center" height="24" label="Load..." left="220" name="btn_load" width="80" />
<button bottom="-50" halign="center" height="24" label="Save..." left_delta="90" name="btn_save" width="80" /> <button bottom="-50" halign="center" height="24" label="Save..." left_delta="90" name="btn_save" width="80" />
<text follows="top|left" height="15" left="10" name="text_walking" bottom="-80"> <text follows="top|left" height="15" left="10" name="text_walking" bottom="-80">
Walking: Walking:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_walking" <line_editor follows="top|left|right" height="19" max_length="36" name="line_walking"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_running" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_running" bottom_delta="-25">
Running: Running:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_running" <line_editor follows="top|left|right" height="19" max_length="36" name="line_running"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_crouchwalk" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_crouchwalk" bottom_delta="-25">
Crouchwalk: Crouchwalk:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_crouchwalk" <line_editor follows="top|left|right" height="19" max_length="36" name="line_crouchwalk"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_flying" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_flying" bottom_delta="-25">
Flying: Flying:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_flying" <line_editor follows="top|left|right" height="19" max_length="36" name="line_flying"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_turn_left" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_turn_left" bottom_delta="-25">
Turn Left: Turn Left:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_turn_left" <line_editor follows="top|left|right" height="19" max_length="36" name="line_turn_left"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_turn_right" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_turn_right" bottom_delta="-25">
Turn Right: Turn Right:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_turn_right" <line_editor follows="top|left|right" height="19" max_length="36" name="line_turn_right"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_jumping" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_jumping" bottom_delta="-25">
Jumping: Jumping:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_jumping" <line_editor follows="top|left|right" height="19" max_length="36" name="line_jumping"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_fly_up" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_fly_up" bottom_delta="-25">
Fly Up: Fly Up:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_up" <line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_up"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_crouching" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_crouching" bottom_delta="-25">
Crouching: Crouching:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_crouching" <line_editor follows="top|left|right" height="19" max_length="36" name="line_crouching"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_fly_down" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_fly_down" bottom_delta="-25">
Fly Down: Fly Down:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_down" <line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_down"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_stand1" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_stand1" bottom_delta="-25">
Stand1: Stand1:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand1" <line_editor follows="top|left|right" height="19" max_length="36" name="line_stand1"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_stand2" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_stand2" bottom_delta="-25">
Stand2: Stand2:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand2" <line_editor follows="top|left|right" height="19" max_length="36" name="line_stand2"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_stand3" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_stand3" bottom_delta="-25">
Stand3: Stand3:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand3" <line_editor follows="top|left|right" height="19" max_length="36" name="line_stand3"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_hover" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_hover" bottom_delta="-25">
Hover: Hover:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_hover" <line_editor follows="top|left|right" height="19" max_length="36" name="line_hover"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_sitting" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_sitting" bottom_delta="-25">
Sitting: Sitting:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_sitting" <line_editor follows="top|left|right" height="19" max_length="36" name="line_sitting"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_prejump" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_prejump" bottom_delta="-25">
PreJump: PreJump:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_prejump" <line_editor follows="top|left|right" height="19" max_length="36" name="line_prejump"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_falling" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_falling" bottom_delta="-25">
Falling: Falling:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_falling" <line_editor follows="top|left|right" height="19" max_length="36" name="line_falling"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_stride" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_stride" bottom_delta="-25">
Stride: Stride:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stride" <line_editor follows="top|left|right" height="19" max_length="36" name="line_stride"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_soft_landing" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_soft_landing" bottom_delta="-25">
Soft Landing: Soft Landing:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_soft_landing" <line_editor follows="top|left|right" height="19" max_length="36" name="line_soft_landing"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_medium_landing" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_medium_landing" bottom_delta="-25">
Medium Landing: Medium Landing:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_medium_landing" <line_editor follows="top|left|right" height="19" max_length="36" name="line_medium_landing"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_hard_landing" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_hard_landing" bottom_delta="-25">
Hard Landing: Hard Landing:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_hard_landing" <line_editor follows="top|left|right" height="19" max_length="36" name="line_hard_landing"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_flying_slow" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_flying_slow" bottom_delta="-25">
Flying Slow: Flying Slow:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_flying_slow" <line_editor follows="top|left|right" height="19" max_length="36" name="line_flying_slow"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
<text follows="top|left" height="15" left="10" name="text_sitting_on_ground" bottom_delta="-25"> <text follows="top|left" height="15" left="10" name="text_sitting_on_ground" bottom_delta="-25">
Sitting on Ground: Sitting on Ground:
</text> </text>
<line_editor follows="top|left|right" height="19" max_length="36" name="line_sitting_on_ground" <line_editor follows="top|left|right" height="19" max_length="36" name="line_sitting_on_ground"
width="300" left="100" bottom_delta="0" /> width="300" left="100" bottom_delta="0" />
</floater> </floater>