Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate

This commit is contained in:
Lirusaito
2013-06-23 22:36:55 -04:00
16 changed files with 268 additions and 409 deletions

View File

@@ -773,12 +773,16 @@ BOOL LLPanel::childHasFocus(const std::string& id)
} }
} }
void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata ) // *TODO: Deprecate; for backwards compatability only:
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data)
{ {
LLUICtrl* child = getChild<LLUICtrl>(id, true); LLUICtrl* child = findChild<LLUICtrl>(id);
if (child) if (child)
{ {
child->setCommitCallback(cb, userdata); child->setCommitCallback(boost::bind(cb, child, data));
} }
} }

View File

@@ -172,7 +172,12 @@ public:
void childSetFocus(const std::string& id, BOOL focus = TRUE); void childSetFocus(const std::string& id, BOOL focus = TRUE);
BOOL childHasFocus(const std::string& id); BOOL childHasFocus(const std::string& id);
void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); // *TODO: Deprecate; for backwards compatability only:
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data = NULL);
void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) );
void childSetColor(const std::string& id, const LLColor4& color); void childSetColor(const std::string& id, const LLColor4& color);

View File

@@ -718,6 +718,17 @@
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>LiruScriptErrorsStealFocus</key>
<map>
<key>Comment</key>
<string>When false, scripts that have errors won't steal focus once they've been failed to compile</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruSensibleARC</key> <key>LiruSensibleARC</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -51,14 +51,14 @@ LLPrefsAscentChat::LLPrefsAscentChat()
{ {
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_chat.xml"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_chat.xml");
childSetCommitCallback("SpellBase", onSpellBaseComboBoxCommit, this); getChild<LLUICtrl>("SpellBase")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellBaseComboBoxCommit, this, _2));
childSetAction("EmSpell_EditCustom", onSpellEditCustom, this); getChild<LLUICtrl>("EmSpell_EditCustom")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellEditCustom, this));
childSetAction("EmSpell_GetMore", onSpellGetMore, this); getChild<LLUICtrl>("EmSpell_GetMore")->setCommitCallback(boost::bind(&lggHunSpell_Wrapper::getMoreButton, glggHunSpell, this));
childSetAction("EmSpell_Add", onSpellAdd, this); getChild<LLUICtrl>("EmSpell_Add")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellAdd, this));
childSetAction("EmSpell_Remove", onSpellRemove, this); getChild<LLUICtrl>("EmSpell_Remove")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onSpellRemove, this));
childSetCommitCallback("time_format_combobox", onCommitTimeDate, this); getChild<LLUICtrl>("time_format_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitTimeDate, this, _1));
childSetCommitCallback("date_format_combobox", onCommitTimeDate, this); getChild<LLUICtrl>("date_format_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitTimeDate, this, _1));
bool started = (LLStartUp::getStartupState() == STATE_STARTED); bool started = (LLStartUp::getStartupState() == STATE_STARTED);
if (!started) // Disable autoresponse when not logged in if (!started) // Disable autoresponse when not logged in
@@ -87,19 +87,19 @@ LLPrefsAscentChat::LLPrefsAscentChat()
childSetValue("BusyModeResponseShow", gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")); childSetValue("BusyModeResponseShow", gSavedPerAccountSettings.getBOOL("BusyModeResponseShow"));
childSetEnabled("reset_antispam", started); childSetEnabled("reset_antispam", started);
childSetCommitCallback("reset_antispam", onCommitResetAS, this); getChild<LLUICtrl>("reset_antispam")->setCommitCallback(boost::bind(NACLAntiSpamRegistry::purgeAllQueues));
childSetCommitCallback("enable_as", onCommitEnableAS, this); getChild<LLUICtrl>("enable_as")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitEnableAS, this, _2));
childSetCommitCallback("antispam_checkbox", onCommitDialogBlock, this); getChild<LLUICtrl>("antispam_checkbox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
childSetCommitCallback("Group Invites", onCommitDialogBlock, this); getChild<LLUICtrl>("Group Invites")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
childSetCommitCallback("KeywordsOn", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsList", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsList")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsSound", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsSound")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsInChat", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsInChat")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsInIM", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsInIM")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsChangeColor", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsChangeColor")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsColor", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsColor")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
childSetCommitCallback("KeywordsPlaySound", onCommitKeywords, this); getChild<LLUICtrl>("KeywordsPlaySound")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
refreshValues(); refreshValues();
refresh(); refresh();
@@ -109,73 +109,43 @@ LLPrefsAscentChat::~LLPrefsAscentChat()
{ {
} }
//static void LLPrefsAscentChat::onSpellAdd()
void LLPrefsAscentChat::onSpellAdd(void* data)
{ {
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data; glggHunSpell->addButton(childGetValue("EmSpell_Avail").asString());
refresh();
if(self)
{
glggHunSpell->addButton(self->childGetValue("EmSpell_Avail").asString());
} }
self->refresh(); void LLPrefsAscentChat::onSpellRemove()
}
//static
void LLPrefsAscentChat::onSpellRemove(void* data)
{ {
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data; glggHunSpell->removeButton(childGetValue("EmSpell_Installed").asString());
refresh();
if(self)
{
glggHunSpell->removeButton(self->childGetValue("EmSpell_Installed").asString());
} }
self->refresh(); void LLPrefsAscentChat::onSpellEditCustom()
}
//static
void LLPrefsAscentChat::onSpellGetMore(void* data)
{
glggHunSpell->getMoreButton(data);
}
//static
void LLPrefsAscentChat::onSpellEditCustom(void* data)
{ {
glggHunSpell->editCustomButton(); glggHunSpell->editCustomButton();
} }
//static void LLPrefsAscentChat::onSpellBaseComboBoxCommit(const LLSD& value)
void LLPrefsAscentChat::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata)
{ {
LLComboBox* box = (LLComboBox*)ctrl; glggHunSpell->newDictSelection(value.asString());
if (box)
{
glggHunSpell->newDictSelection(box->getValue().asString());
}
} }
//static void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl)
void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
{ {
LLPrefsAscentChat* self = (LLPrefsAscentChat*)userdata; LLComboBox* combo = static_cast<LLComboBox*>(ctrl);
LLComboBox* combo = (LLComboBox*)ctrl;
if (ctrl->getName() == "time_format_combobox") if (ctrl->getName() == "time_format_combobox")
{ {
self->tempTimeFormat = combo->getCurrentIndex(); tempTimeFormat = combo->getCurrentIndex();
} }
else if (ctrl->getName() == "date_format_combobox") else if (ctrl->getName() == "date_format_combobox")
{ {
self->tempDateFormat = combo->getCurrentIndex(); tempDateFormat = combo->getCurrentIndex();
} }
std::string short_date, long_date, short_time, long_time, timestamp; std::string short_date, long_date, short_time, long_time, timestamp;
if (self->tempTimeFormat == 0) if (tempTimeFormat == 0)
{ {
short_time = "%H:%M"; short_time = "%H:%M";
long_time = "%H:%M:%S"; long_time = "%H:%M:%S";
@@ -188,13 +158,13 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
timestamp = " %I:%M %p"; timestamp = " %I:%M %p";
} }
if (self->tempDateFormat == 0) if (tempDateFormat == 0)
{ {
short_date = "%Y-%m-%d"; short_date = "%Y-%m-%d";
long_date = "%A %d %B %Y"; long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp; timestamp = "%a %d %b %Y" + timestamp;
} }
else if (self->tempDateFormat == 1) else if (tempDateFormat == 1)
{ {
short_date = "%d/%m/%Y"; short_date = "%d/%m/%Y";
long_date = "%A %d %B %Y"; long_date = "%A %d %B %Y";
@@ -214,70 +184,57 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
gSavedSettings.setString("TimestampFormat", timestamp); gSavedSettings.setString("TimestampFormat", timestamp);
} }
//static void LLPrefsAscentChat::onCommitEnableAS(const LLSD& value)
void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*)
{ {
NACLAntiSpamRegistry::purgeAllQueues(); bool enabled = value.asBoolean();
childSetEnabled("spammsg_checkbox", enabled);
childSetEnabled("antispamtime", enabled);
childSetEnabled("antispamamount", enabled);
childSetEnabled("antispamsoundmulti", enabled);
childSetEnabled("antispamsoundpreloadmulti", enabled);
childSetEnabled("antispamnewlines", enabled);
childSetEnabled("Notify On Spam", enabled);
} }
//static void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value)
void LLPrefsAscentChat::onCommitEnableAS(LLUICtrl* ctrl, void* user_data)
{ {
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data; childSetEnabled("Group Fee Invites", !childGetValue("antispam_checkbox").asBoolean() && !childGetValue("Group Invites").asBoolean());
bool enabled = ctrl->getValue().asBoolean(); bool enabled = value.asBoolean();
self->childSetEnabled("spammsg_checkbox", enabled);
self->childSetEnabled("antispamtime", enabled);
self->childSetEnabled("antispamamount", enabled);
self->childSetEnabled("antispamsoundmulti", enabled);
self->childSetEnabled("antispamsoundpreloadmulti", enabled);
self->childSetEnabled("antispamnewlines", enabled);
self->childSetEnabled("Notify On Spam", enabled);
}
//static
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
self->childSetEnabled("Group Fee Invites", !self->childGetValue("antispam_checkbox").asBoolean() && !self->childGetValue("Group Invites").asBoolean());
bool enabled = ctrl->getValue().asBoolean();
if (ctrl->getName() == "antispam_checkbox") if (ctrl->getName() == "antispam_checkbox")
{ {
self->childSetEnabled("Block All Dialogs From", !enabled); childSetEnabled("Block All Dialogs From", !enabled);
self->childSetEnabled("Alerts", !enabled); childSetEnabled("Alerts", !enabled);
self->childSetEnabled("Friendship Offers", !enabled); childSetEnabled("Friendship Offers", !enabled);
self->childSetEnabled("Group Invites", !enabled); childSetEnabled("Group Invites", !enabled);
self->childSetEnabled("Group Notices", !enabled); childSetEnabled("Group Notices", !enabled);
self->childSetEnabled("Item Offers", !enabled); childSetEnabled("Item Offers", !enabled);
self->childSetEnabled("Scripts", !enabled); childSetEnabled("Scripts", !enabled);
self->childSetEnabled("Teleport Offers", !enabled); childSetEnabled("Teleport Offers", !enabled);
} }
} }
//static void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl)
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data)
{ {
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
if (ctrl->getName() == "KeywordsOn") if (ctrl->getName() == "KeywordsOn")
{ {
bool enabled = self->childGetValue("KeywordsOn").asBoolean(); bool enabled = childGetValue("KeywordsOn").asBoolean();
self->childSetEnabled("KeywordsList", enabled); childSetEnabled("KeywordsList", enabled);
self->childSetEnabled("KeywordsInChat", enabled); childSetEnabled("KeywordsInChat", enabled);
self->childSetEnabled("KeywordsInIM", enabled); childSetEnabled("KeywordsInIM", enabled);
self->childSetEnabled("KeywordsChangeColor", enabled); childSetEnabled("KeywordsChangeColor", enabled);
self->childSetEnabled("KeywordsColor", enabled); childSetEnabled("KeywordsColor", enabled);
self->childSetEnabled("KeywordsPlaySound", enabled); childSetEnabled("KeywordsPlaySound", enabled);
self->childSetEnabled("KeywordsSound", enabled); childSetEnabled("KeywordsSound", enabled);
} }
gSavedPerAccountSettings.setBOOL("KeywordsOn", self->childGetValue("KeywordsOn")); gSavedPerAccountSettings.setBOOL("KeywordsOn", childGetValue("KeywordsOn"));
gSavedPerAccountSettings.setString("KeywordsList", self->childGetValue("KeywordsList")); gSavedPerAccountSettings.setString("KeywordsList", childGetValue("KeywordsList"));
gSavedPerAccountSettings.setBOOL("KeywordsInChat", self->childGetValue("KeywordsInChat")); gSavedPerAccountSettings.setBOOL("KeywordsInChat", childGetValue("KeywordsInChat"));
gSavedPerAccountSettings.setBOOL("KeywordsInIM", self->childGetValue("KeywordsInIM")); gSavedPerAccountSettings.setBOOL("KeywordsInIM", childGetValue("KeywordsInIM"));
gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", self->childGetValue("KeywordsChangeColor")); gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", childGetValue("KeywordsChangeColor"));
gSavedPerAccountSettings.setColor4("KeywordsColor", self->childGetValue("KeywordsColor")); gSavedPerAccountSettings.setColor4("KeywordsColor", childGetValue("KeywordsColor"));
gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", self->childGetValue("KeywordsPlaySound")); gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", childGetValue("KeywordsPlaySound"));
gSavedPerAccountSettings.setString("KeywordsSound", self->childGetValue("KeywordsSound")); gSavedPerAccountSettings.setString("KeywordsSound", childGetValue("KeywordsSound"));
} }
// Store current settings for cancel // Store current settings for cancel

View File

@@ -47,16 +47,14 @@ public:
void refreshValues(); void refreshValues();
protected: protected:
static void onSpellAdd(void* data); void onSpellAdd();
static void onSpellRemove(void* data); void onSpellRemove();
static void onSpellGetMore(void* data); void onSpellEditCustom();
static void onSpellEditCustom(void* data); void onSpellBaseComboBoxCommit(const LLSD& value);
static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); void onCommitTimeDate(LLUICtrl* ctrl);
static void onCommitTimeDate(LLUICtrl* ctrl, void *userdata); void onCommitEnableAS(const LLSD& value);
static void onCommitResetAS(LLUICtrl*,void*); void onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value);
static void onCommitEnableAS(LLUICtrl*, void*); void onCommitKeywords(LLUICtrl* ctrl);
static void onCommitDialogBlock(LLUICtrl*, void*);
static void onCommitKeywords(LLUICtrl* ctrl, void* user_data);
//Chat/IM ----------------------------------------------------------------------------- //Chat/IM -----------------------------------------------------------------------------
BOOL mIMAnnounceIncoming; BOOL mIMAnnounceIncoming;

View File

@@ -51,41 +51,41 @@ LLPrefsAscentSys::LLPrefsAscentSys()
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml");
//General ----------------------------------------------------------------------------- //General -----------------------------------------------------------------------------
childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); getChild<LLUICtrl>("speed_rez_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("double_click_teleport_check", onCommitCheckBox, this); getChild<LLUICtrl>("double_click_teleport_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("system_folder_check", onCommitCheckBox, this); getChild<LLUICtrl>("system_folder_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("show_look_at_check", onCommitCheckBox, this); getChild<LLUICtrl>("show_look_at_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("enable_clouds", onCommitCheckBox, this); getChild<LLUICtrl>("enable_clouds")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("power_user_check", onCommitCheckBox, this); getChild<LLUICtrl>("power_user_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("power_user_confirm_check", onCommitCheckBox, this); getChild<LLUICtrl>("power_user_confirm_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
//Command Line ------------------------------------------------------------------------ //Command Line ------------------------------------------------------------------------
childSetCommitCallback("chat_cmd_toggle", onCommitCmdLine, this); getChild<LLUICtrl>("chat_cmd_toggle")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLinePos", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLinePos")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineGround", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineGround")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineHeight", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineHeight")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineTeleportHome", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineTeleportHome")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineRezPlatform", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineRezPlatform")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineCalc", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineCalc")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineClearChat", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineClearChat")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineDrawDistance", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineDrawDistance")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdTeleportToCam", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdTeleportToCam")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineKeyToName", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineKeyToName")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineOfferTp", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineOfferTp")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineMapTo", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineMapTo")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("AscentCmdLineTP2", onCommitCmdLine, this); getChild<LLUICtrl>("AscentCmdLineTP2")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
childSetCommitCallback("SinguCmdLineAway", onCommitCmdLine, this); getChild<LLUICtrl>("SinguCmdLineAway")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCmdLine, this, _1, _2));
//Security ---------------------------------------------------------------------------- //Security ----------------------------------------------------------------------------
childSetCommitCallback("disable_click_sit_check", onCommitCheckBox, this); getChild<LLUICtrl>("disable_click_sit_check")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
//Build ------------------------------------------------------------------------------- //Build -------------------------------------------------------------------------------
childSetCommitCallback("next_owner_copy", onCommitCheckBox, this); getChild<LLUICtrl>("next_owner_copy")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitCheckBox, this, _1, _2));
childSetEnabled("next_owner_transfer", gSavedSettings.getBOOL("NextOwnerCopy")); childSetEnabled("next_owner_transfer", gSavedSettings.getBOOL("NextOwnerCopy"));
childSetCommitCallback("material", onCommitComboBox, this); getChild<LLUICtrl>("material")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitComboBox, this, _1, _2));
childSetCommitCallback("combobox shininess", onCommitComboBox, this); getChild<LLUICtrl>("combobox shininess")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitComboBox, this, _1, _2));
getChild<LLTextureCtrl>("texture control")->setDefaultImageAssetID(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture"))); getChild<LLTextureCtrl>("texture control")->setDefaultImageAssetID(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture")));
childSetCommitCallback("texture control", onCommitTexturePicker, this); getChild<LLUICtrl>("texture control")->setCommitCallback(boost::bind(&LLPrefsAscentSys::onCommitTexturePicker, this, _1));
refreshValues(); refreshValues();
refresh(); refresh();
@@ -95,37 +95,34 @@ LLPrefsAscentSys::~LLPrefsAscentSys()
{ {
} }
//static void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value)
void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
{ {
LLPrefsAscentSys* self = static_cast<LLPrefsAscentSys*>(user_data);
// llinfos << "Change to " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl; // llinfos << "Change to " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl;
const std::string name = ctrl->getName(); const std::string name = ctrl->getName();
bool enabled = ctrl->getValue().asBoolean(); bool enabled = value.asBoolean();
if (name == "speed_rez_check") if (name == "speed_rez_check")
{ {
self->childSetEnabled("speed_rez_interval", enabled); childSetEnabled("speed_rez_interval", enabled);
self->childSetEnabled("speed_rez_seconds", enabled); childSetEnabled("speed_rez_seconds", enabled);
} }
else if (name == "double_click_teleport_check") else if (name == "double_click_teleport_check")
{ {
self->childSetEnabled("center_after_teleport_check", enabled); childSetEnabled("center_after_teleport_check", enabled);
self->childSetEnabled("offset_teleport_check", enabled); childSetEnabled("offset_teleport_check", enabled);
} }
else if (name == "system_folder_check") else if (name == "system_folder_check")
{ {
self->childSetEnabled("temp_in_system_check", enabled); childSetEnabled("temp_in_system_check", enabled);
} }
else if (name == "enable_clouds") else if (name == "enable_clouds")
{ {
self->childSetEnabled("enable_classic_clouds", enabled); childSetEnabled("enable_classic_clouds", enabled);
} }
else if (name == "power_user_check") else if (name == "power_user_check")
{ {
self->childSetEnabled("power_user_confirm_check", enabled); childSetEnabled("power_user_confirm_check", enabled);
self->childSetValue("power_user_confirm_check", false); childSetValue("power_user_confirm_check", false);
} }
else if (name == "power_user_confirm_check") else if (name == "power_user_confirm_check")
{ {
@@ -143,79 +140,65 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
} }
else if (name == "disable_click_sit_check") else if (name == "disable_click_sit_check")
{ {
self->childSetEnabled("disable_click_sit_own_check", !enabled); childSetEnabled("disable_click_sit_own_check", !enabled);
} }
else if (name == "next_owner_copy") else if (name == "next_owner_copy")
{ {
if (!enabled) gSavedSettings.setBOOL("NextOwnerTransfer", true); if (!enabled) gSavedSettings.setBOOL("NextOwnerTransfer", true);
self->childSetEnabled("next_owner_transfer", enabled); childSetEnabled("next_owner_transfer", enabled);
} }
} }
//static void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, const LLSD& value)
void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, void* user_data)
{ {
LLPrefsAscentSys* self = (LLPrefsAscentSys*)user_data; const std::string& name = ctrl->getName();
if (name == "chat_cmd_toggle")
if (ctrl->getName() == "chat_cmd_toggle")
{ {
bool enabled = self->childGetValue("chat_cmd_toggle").asBoolean(); bool enabled = value.asBoolean();
self->childSetEnabled("cmd_line_text_2", enabled); childSetEnabled("cmd_line_text_2", enabled);
self->childSetEnabled("cmd_line_text_3", enabled); childSetEnabled("cmd_line_text_3", enabled);
self->childSetEnabled("cmd_line_text_4", enabled); childSetEnabled("cmd_line_text_4", enabled);
self->childSetEnabled("cmd_line_text_5", enabled); childSetEnabled("cmd_line_text_5", enabled);
self->childSetEnabled("cmd_line_text_6", enabled); childSetEnabled("cmd_line_text_6", enabled);
self->childSetEnabled("cmd_line_text_7", enabled); childSetEnabled("cmd_line_text_7", enabled);
self->childSetEnabled("cmd_line_text_8", enabled); childSetEnabled("cmd_line_text_8", enabled);
self->childSetEnabled("cmd_line_text_9", enabled); childSetEnabled("cmd_line_text_9", enabled);
self->childSetEnabled("cmd_line_text_10", enabled); childSetEnabled("cmd_line_text_10", enabled);
self->childSetEnabled("cmd_line_text_11", enabled); childSetEnabled("cmd_line_text_11", enabled);
self->childSetEnabled("cmd_line_text_12", enabled); childSetEnabled("cmd_line_text_12", enabled);
self->childSetEnabled("cmd_line_text_13", enabled); childSetEnabled("cmd_line_text_13", enabled);
self->childSetEnabled("cmd_line_text_15", enabled); childSetEnabled("cmd_line_text_15", enabled);
self->childSetEnabled("AscentCmdLinePos", enabled); childSetEnabled("AscentCmdLinePos", enabled);
self->childSetEnabled("AscentCmdLineGround", enabled); childSetEnabled("AscentCmdLineGround", enabled);
self->childSetEnabled("AscentCmdLineHeight", enabled); childSetEnabled("AscentCmdLineHeight", enabled);
self->childSetEnabled("AscentCmdLineTeleportHome", enabled); childSetEnabled("AscentCmdLineTeleportHome", enabled);
self->childSetEnabled("AscentCmdLineRezPlatform", enabled); childSetEnabled("AscentCmdLineRezPlatform", enabled);
self->childSetEnabled("AscentPlatformSize", enabled); childSetEnabled("AscentPlatformSize", enabled);
self->childSetEnabled("AscentCmdLineCalc", enabled); childSetEnabled("AscentCmdLineCalc", enabled);
self->childSetEnabled("AscentCmdLineClearChat", enabled); childSetEnabled("AscentCmdLineClearChat", enabled);
self->childSetEnabled("AscentCmdLineDrawDistance", enabled); childSetEnabled("AscentCmdLineDrawDistance", enabled);
self->childSetEnabled("AscentCmdTeleportToCam", enabled); childSetEnabled("AscentCmdTeleportToCam", enabled);
self->childSetEnabled("AscentCmdLineKeyToName", enabled); childSetEnabled("AscentCmdLineKeyToName", enabled);
self->childSetEnabled("AscentCmdLineOfferTp", enabled); childSetEnabled("AscentCmdLineOfferTp", enabled);
self->childSetEnabled("AscentCmdLineMapTo", enabled); childSetEnabled("AscentCmdLineMapTo", enabled);
self->childSetEnabled("map_to_keep_pos", enabled); childSetEnabled("map_to_keep_pos", enabled);
self->childSetEnabled("AscentCmdLineTP2", enabled); childSetEnabled("AscentCmdLineTP2", enabled);
self->childSetEnabled("SinguCmdLineAway", enabled); childSetEnabled("SinguCmdLineAway", enabled);
}
else
{
gSavedSettings.setString(name, value); // Singu Note: Keep commandline settings using the same name as their settings
}
} }
gSavedSettings.setString("AscentCmdLinePos", self->childGetValue("AscentCmdLinePos")); void LLPrefsAscentSys::onCommitComboBox(LLUICtrl* ctrl, const LLSD& value)
gSavedSettings.setString("AscentCmdLineGround", self->childGetValue("AscentCmdLineGround")); {
gSavedSettings.setString("AscentCmdLineHeight", self->childGetValue("AscentCmdLineHeight")); gSavedSettings.setString(ctrl->getControlName(), value.asString());
gSavedSettings.setString("AscentCmdLineTeleportHome", self->childGetValue("AscentCmdLineTeleportHome"));
gSavedSettings.setString("AscentCmdLineRezPlatform", self->childGetValue("AscentCmdLineRezPlatform"));
gSavedSettings.setString("AscentCmdLineCalc", self->childGetValue("AscentCmdLineCalc"));
gSavedSettings.setString("AscentCmdLineClearChat", self->childGetValue("AscentCmdLineClearChat"));
gSavedSettings.setString("AscentCmdLineDrawDistance", self->childGetValue("AscentCmdLineDrawDistance"));
gSavedSettings.setString("AscentCmdTeleportToCam", self->childGetValue("AscentCmdTeleportToCam"));
gSavedSettings.setString("AscentCmdLineKeyToName", self->childGetValue("AscentCmdLineKeyToName"));
gSavedSettings.setString("AscentCmdLineOfferTp", self->childGetValue("AscentCmdLineOfferTp"));
gSavedSettings.setString("AscentCmdLineMapTo", self->childGetValue("AscentCmdLineMapTo"));
gSavedSettings.setString("AscentCmdLineTP2", self->childGetValue("AscentCmdLineTP2"));
gSavedSettings.setString("SinguCmdLineAway", self->childGetValue("SinguCmdLineAway"));
} }
void LLPrefsAscentSys::onCommitComboBox(LLUICtrl* ctrl, void* userdata) void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl)
{ {
LLComboBox* box = (LLComboBox*)ctrl; LLTextureCtrl* image_ctrl = static_cast<LLTextureCtrl*>(ctrl);
if(box) gSavedSettings.setString(box->getControlName(), box->getValue().asString());
}
void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl, void* userdata)
{
LLTextureCtrl* image_ctrl = (LLTextureCtrl*)ctrl;
if(image_ctrl) gSavedSettings.setString("EmeraldBuildPrefs_Texture", image_ctrl->getImageAssetID().asString()); if(image_ctrl) gSavedSettings.setString("EmeraldBuildPrefs_Texture", image_ctrl->getImageAssetID().asString());
} }

View File

@@ -47,10 +47,10 @@ public:
void refreshValues(); void refreshValues();
protected: protected:
static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
static void onCommitCmdLine(LLUICtrl* ctrl, void* user_data); void onCommitCmdLine(LLUICtrl* ctrl, const LLSD& value);
static void onCommitComboBox(LLUICtrl* ctrl, void* user_data); void onCommitComboBox(LLUICtrl* ctrl, const LLSD& value);
static void onCommitTexturePicker(LLUICtrl* ctrl, void* user_data); void onCommitTexturePicker(LLUICtrl* ctrl);
//General ----------------------------------------------------------------------------- //General -----------------------------------------------------------------------------
BOOL mDoubleClickTeleport; BOOL mDoubleClickTeleport;

View File

@@ -59,22 +59,18 @@ LLPrefsAscentVan::LLPrefsAscentVan()
childSetVisible("announce_stream_metadata", gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData()); childSetVisible("announce_stream_metadata", gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData());
childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this); getChild<LLUICtrl>("tag_spoofing_combobox")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitClientTag, this, _1));
childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this); getChild<LLUICtrl>("show_my_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("show_self_tag_check", onCommitCheckBox, this); getChild<LLUICtrl>("show_self_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("show_self_tag_color_check", onCommitCheckBox, this); getChild<LLUICtrl>("show_self_tag_color_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("customize_own_tag_check", onCommitCheckBox, this); getChild<LLUICtrl>("customize_own_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("show_friend_tag_check", onCommitCheckBox, this); getChild<LLUICtrl>("show_friend_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("use_status_check", onCommitCheckBox, this); getChild<LLUICtrl>("use_status_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
childSetCommitCallback("custom_tag_label_box", onCommitTextModified, this); getChild<LLUICtrl>("custom_tag_label_box")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitTextModified, this, _1, _2));
childSetCommitCallback("X Modifier", onCommitUpdateAvatarOffsets); getChild<LLUICtrl>("update_clientdefs")->setCommitCallback(boost::bind(LLPrefsAscentVan::onManualClientUpdate));
childSetCommitCallback("Y Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Z Modifier", onCommitUpdateAvatarOffsets);
childSetAction("update_clientdefs", onManualClientUpdate, this);
refreshValues(); refreshValues();
refresh(); refresh();
@@ -84,20 +80,16 @@ LLPrefsAscentVan::~LLPrefsAscentVan()
{ {
} }
//static void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl)
void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
{ {
std::string client_uuid; std::string client_uuid;
U32 client_index; U32 client_index;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata; LLComboBox* combo = static_cast<LLComboBox*>(ctrl);
LLComboBox* combo = (LLComboBox*)ctrl;
if (combo)
{
client_index = combo->getCurrentIndex(); client_index = combo->getCurrentIndex();
//Don't rebake if it's not neccesary. //Don't rebake if it's not neccesary.
if (client_index != self->mSelectedClient) if (client_index != mSelectedClient)
{ {
client_uuid = combo->getSelectedValue().asString(); client_uuid = combo->getSelectedValue().asString();
gSavedSettings.setString("AscentReportClientUUID", client_uuid); gSavedSettings.setString("AscentReportClientUUID", client_uuid);
@@ -111,30 +103,17 @@ void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
} }
} }
} }
}
//static void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, const LLSD& value)
void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata)
{ {
//if (!gAgent.getID().isNull())
//{
// gAgent.sendAgentSetAppearance();
//}
}
//static
void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, void* userdata)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
if (ctrl->getName() == "custom_tag_label_box") if (ctrl->getName() == "custom_tag_label_box")
{ {
gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); gSavedSettings.setString("AscentCustomTagLabel", value);
} }
} }
//static //static
void LLPrefsAscentVan::onManualClientUpdate(void* data) void LLPrefsAscentVan::onManualClientUpdate()
{ {
LLChat chat("Definitions already up-to-date."); LLChat chat("Definitions already up-to-date.");
chat.mSourceType = CHAT_SOURCE_SYSTEM; chat.mSourceType = CHAT_SOURCE_SYSTEM;
@@ -148,33 +127,26 @@ void LLPrefsAscentVan::onManualClientUpdate(void* data)
LLFloaterChat::addChat(chat); LLFloaterChat::addChat(chat);
} }
//static void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value)
void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
{ {
LLPrefsAscentVan* self = (LLPrefsAscentVan*)user_data;
// llinfos << "Control named " << ctrl->getControlName() << llendl; // llinfos << "Control named " << ctrl->getControlName() << llendl;
if (ctrl->getName() == "use_status_check") if (ctrl->getName() == "use_status_check")
{ {
bool showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors"); bool showCustomColors = value.asBoolean();
self->childSetEnabled("friends_color_textbox", showCustomColors); childSetEnabled("friends_color_textbox", showCustomColors);
bool frColors = gSavedSettings.getBOOL("ColorFriendChat"); childSetEnabled("friend_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorFriendChat"));
self->childSetEnabled("friend_color_swatch", showCustomColors || frColors); childSetEnabled("estate_owner_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorEstateOwnerChat"));
bool eoColors = gSavedSettings.getBOOL("ColorEstateOwnerChat"); childSetEnabled("linden_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorLindenChat"));
self->childSetEnabled("estate_owner_color_swatch", showCustomColors || eoColors); childSetEnabled("muted_color_swatch", showCustomColors || gSavedSettings.getBOOL("ColorMutedChat"));
bool lindColors = gSavedSettings.getBOOL("ColorLindenChat");
self->childSetEnabled("linden_color_swatch", showCustomColors || lindColors);
bool muteColors = gSavedSettings.getBOOL("ColorMutedChat");
self->childSetEnabled("muted_color_swatch", showCustomColors || muteColors);
} }
else if (ctrl->getName() == "customize_own_tag_check") else if (ctrl->getName() == "customize_own_tag_check")
{ {
BOOL showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag"); bool showCustomOptions = value.asBoolean();
self->childSetEnabled("custom_tag_label_text", showCustomOptions); childSetEnabled("custom_tag_label_text", showCustomOptions);
self->childSetEnabled("custom_tag_label_box", showCustomOptions); childSetEnabled("custom_tag_label_box", showCustomOptions);
self->childSetEnabled("custom_tag_color_text", showCustomOptions); childSetEnabled("custom_tag_color_text", showCustomOptions);
self->childSetEnabled("custom_tag_color_swatch", showCustomOptions); childSetEnabled("custom_tag_color_swatch", showCustomOptions);
} }
} }
@@ -193,6 +165,7 @@ void LLPrefsAscentVan::refreshValues()
mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata");
mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque"); mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque");
mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles"); mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles");
mScriptErrorsStealFocus = gSavedSettings.getBOOL("LiruScriptErrorsStealFocus");
//Tags\Colors ---------------------------------------------------------------------------- //Tags\Colors ----------------------------------------------------------------------------
mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag"); mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag");
@@ -263,6 +236,7 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata);
gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque); gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque);
gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles); gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles);
gSavedSettings.setBOOL("LiruScriptErrorsStealFocus", mScriptErrorsStealFocus);
//Tags\Colors ---------------------------------------------------------------------------- //Tags\Colors ----------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag); gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag);

View File

@@ -47,11 +47,10 @@ public:
void refreshValues(); void refreshValues();
protected: protected:
static void onCommitClientTag(LLUICtrl* ctrl, void* userdata); void onCommitClientTag(LLUICtrl* ctrl);
static void onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata); void onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value);
static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); void onCommitTextModified(LLUICtrl* ctrl, const LLSD& value);
static void onCommitTextModified(LLUICtrl* ctrl, void* userdata); static void onManualClientUpdate();
static void onManualClientUpdate(void* data);
//Main //Main
BOOL mUseAccountSettings; BOOL mUseAccountSettings;
BOOL mShowTPScreen; BOOL mShowTPScreen;
@@ -64,6 +63,7 @@ protected:
bool mAnnounceStreamMetadata; bool mAnnounceStreamMetadata;
bool mUnfocusedFloatersOpaque; bool mUnfocusedFloatersOpaque;
bool mCompleteNameProfiles; bool mCompleteNameProfiles;
bool mScriptErrorsStealFocus;
//Tags\Colors //Tags\Colors
BOOL mAscentBroadcastTag; BOOL mAscentBroadcastTag;
std::string mReportClientUUID; std::string mReportClientUUID;

View File

@@ -76,8 +76,6 @@ const F32 CONTEXT_FADE_TIME = 0.08f;
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// default ctor
LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
: LLFloater (std::string("Color Picker Floater")), : LLFloater (std::string("Color Picker Floater")),
mComponents ( 3 ), mComponents ( 3 ),
@@ -113,6 +111,10 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show
mCanApplyImmediately ( show_apply_immediate ), mCanApplyImmediately ( show_apply_immediate ),
mContextConeOpacity ( 0.f ) mContextConeOpacity ( 0.f )
{ {
// build the majority of the gui using the factory builder
LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" );
setVisible ( FALSE );
// create user interface for this picker // create user interface for this picker
createUI (); createUI ();
@@ -133,10 +135,6 @@ LLFloaterColorPicker::~LLFloaterColorPicker()
// //
void LLFloaterColorPicker::createUI () void LLFloaterColorPicker::createUI ()
{ {
// build the majority of the gui using the factory builder
LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" );
setVisible ( FALSE );
// create RGB type area (not really RGB but it's got R,G & B in it.,.. // create RGB type area (not really RGB but it's got R,G & B in it.,..
LLPointer<LLImageRaw> raw = new LLImageRaw ( mRGBViewerImageWidth, mRGBViewerImageHeight, mComponents ); LLPointer<LLImageRaw> raw = new LLImageRaw ( mRGBViewerImageWidth, mRGBViewerImageHeight, mComponents );
@@ -184,7 +182,6 @@ void LLFloaterColorPicker::showUI ()
setVisible ( TRUE ); setVisible ( TRUE );
setFocus ( TRUE ); setFocus ( TRUE );
// HACK: if system color picker is required - close the SL one we made and use default system dialog // HACK: if system color picker is required - close the SL one we made and use default system dialog
if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) ) if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
{ {
@@ -237,7 +234,7 @@ BOOL LLFloaterColorPicker::postBuild()
childSetCommitCallback("hspin", onTextCommit, (void*)this ); childSetCommitCallback("hspin", onTextCommit, (void*)this );
childSetCommitCallback("sspin", onTextCommit, (void*)this ); childSetCommitCallback("sspin", onTextCommit, (void*)this );
childSetCommitCallback("lspin", onTextCommit, (void*)this ); childSetCommitCallback("lspin", onTextCommit, (void*)this );
childSetCommitCallback("hexval", onHexCommit, (void*)this ); getChild<LLUICtrl>("hexval")->setCommitCallback(boost::bind(&LLFloaterColorPicker::onHexCommit, this, _2) );
LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterColorPicker::onColorSelect, this, _1)); LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterColorPicker::onColorSelect, this, _1));
@@ -248,9 +245,6 @@ BOOL LLFloaterColorPicker::postBuild()
// //
void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn ) void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
{ {
// start catching lose-focus events from entry widgets
enableTextCallbacks ( TRUE );
// under some circumstances, we get rogue values that can be calmed by clamping... // under some circumstances, we get rogue values that can be calmed by clamping...
rValIn = llclamp ( rValIn, 0.0f, 1.0f ); rValIn = llclamp ( rValIn, 0.0f, 1.0f );
gValIn = llclamp ( gValIn, 0.0f, 1.0f ); gValIn = llclamp ( gValIn, 0.0f, 1.0f );
@@ -360,12 +354,8 @@ void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
// update corresponding HSL values and // update corresponding HSL values and
LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL); LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL);
// color changed so update text fields (fixes SL-16968) // color changed so update text fields
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
// CP: this was required when I first wrote the code but this may not be necessary anymore - leaving it there just in case
enableTextCallbacks( FALSE );
updateTextEntry(); updateTextEntry();
enableTextCallbacks( TRUE );
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@@ -497,7 +487,7 @@ void LLFloaterColorPicker::draw()
mSwatch->localRectToOtherView(mSwatch->getLocalRect(), &swatch_rect, this); mSwatch->localRectToOtherView(mSwatch->getLocalRect(), &swatch_rect, this);
// draw context cone connecting color picker with color swatch in parent floater // draw context cone connecting color picker with color swatch in parent floater
LLRect local_rect = getLocalRect(); LLRect local_rect = getLocalRect();
if (gFocusMgr.childHasKeyboardFocus(this) && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f) if (hasFocus() && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f)
{ {
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable(GL_CULL_FACE); LLGLEnable(GL_CULL_FACE);
@@ -716,77 +706,36 @@ std::string RGBToHex(int rNum, int gNum, int bNum)
} }
//Called when a hex value is entered into the Hex field - Convert and set values. //Called when a hex value is entered into the Hex field - Convert and set values.
void LLFloaterColorPicker::onHexCommit ( LLUICtrl* ctrl, void* data ) void LLFloaterColorPicker::onHexCommit(const LLSD& value)
{
if ( data )
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{ {
char* pStop; char* pStop;
int num = strtol(ctrl->getValue().asString().c_str(), &pStop, 16); int num = strtol(value.asString().c_str(), &pStop, 16);
int r = (num & 0xFF0000) >> 16; int r = (num & 0xFF0000) >> 16;
int g = (num & 0xFF00) >> 8; int g = (num & 0xFF00) >> 8;
int b = num & 0xFF; int b = num & 0xFF;
self->setCurRgb (r / 255.0f, g / 255.0f, b / 255.0f); setCurRgb (r / 255.0f, g / 255.0f, b / 255.0f);
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion updateTextEntry();
self->enableTextCallbacks ( FALSE ); if (mApplyImmediateCheck->get())
self->updateTextEntry ();
self->enableTextCallbacks ( TRUE );
if (self->mApplyImmediateCheck->get())
{ {
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); LLColorSwatchCtrl::onColorChanged(getSwatch(), LLColorSwatchCtrl::COLOR_CHANGE);
}
}
} }
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// update text entry values for RGB/HSL (can't be done in ::draw () since this overwrites input // update text entry values for RGB/HSL (can't be done in ::draw () since this overwrites input
void void LLFloaterColorPicker::updateTextEntry ()
LLFloaterColorPicker::
updateTextEntry ()
{ {
// set values in spinners // set values in spinners
childSetValue("rspin", ( getCurR () * 255.0f ) ); getChild<LLUICtrl>("rspin")->setValue(( getCurR () * 255.0f ) );
childSetValue("gspin", ( getCurG () * 255.0f ) ); getChild<LLUICtrl>("gspin")->setValue(( getCurG () * 255.0f ) );
childSetValue("bspin", ( getCurB () * 255.0f ) ); getChild<LLUICtrl>("bspin")->setValue(( getCurB () * 255.0f ) );
childSetValue("hspin", ( getCurH () * 360.0f ) ); getChild<LLUICtrl>("hspin")->setValue(( getCurH () * 360.0f ) );
childSetValue("sspin", ( getCurS () * 100.0f ) ); getChild<LLUICtrl>("sspin")->setValue(( getCurS () * 100.0f ) );
childSetValue("lspin", ( getCurL () * 100.0f ) ); getChild<LLUICtrl>("lspin")->setValue(( getCurL () * 100.0f ) );
childSetValue("hexval", RGBToHex(getCurR() * 255, getCurG() * 255, getCurB() * 255)); getChild<LLUICtrl>("hexval")->setValue(RGBToHex(getCurR() * 255, getCurG() * 255, getCurB() * 255));
} }
//////////////////////////////////////////////////////////////////////////////
// turns on or off text entry commit call backs
void
LLFloaterColorPicker::
enableTextCallbacks ( BOOL stateIn )
{
if ( stateIn )
{
childSetCommitCallback("rspin", onTextCommit, (void*)this );
childSetCommitCallback("gspin", onTextCommit, (void*)this );
childSetCommitCallback("bspin", onTextCommit, (void*)this );
childSetCommitCallback("hspin", onTextCommit, (void*)this );
childSetCommitCallback("sspin", onTextCommit, (void*)this );
childSetCommitCallback("lspin", onTextCommit, (void*)this );
childSetCommitCallback("hexval", onHexCommit, (void*)this );
}
else
{
childSetCommitCallback("rspin", 0, (void*)this );
childSetCommitCallback("gspin", 0, (void*)this );
childSetCommitCallback("bspin", 0, (void*)this );
childSetCommitCallback("hspin", 0, (void*)this );
childSetCommitCallback("sspin", 0, (void*)this );
childSetCommitCallback("lspin", 0, (void*)this );
childSetCommitCallback("hexval", 0, (void*)this );
}
}
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl ) void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
@@ -818,10 +767,7 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
// update current RGB (and implicitly HSL) // update current RGB (and implicitly HSL)
setCurRgb ( rVal, gVal, bVal ); setCurRgb ( rVal, gVal, bVal );
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry (); updateTextEntry ();
enableTextCallbacks ( TRUE );
} }
else else
// value in HSL boxes changed // value in HSL boxes changed
@@ -844,10 +790,7 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl )
// update current HSL (and implicitly RGB) // update current HSL (and implicitly RGB)
setCurHsl ( hVal, sVal, lVal ); setCurHsl ( hVal, sVal, lVal );
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry (); updateTextEntry ();
enableTextCallbacks ( TRUE );
} }
if (mApplyImmediateCheck->get()) if (mApplyImmediateCheck->get())
@@ -980,10 +923,7 @@ BOOL LLFloaterColorPicker::handleMouseDown ( S32 x, S32 y, MASK mask )
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
} }
// HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
enableTextCallbacks ( FALSE );
updateTextEntry (); updateTextEntry ();
enableTextCallbacks ( TRUE );
} }
return TRUE; return TRUE;
@@ -1152,9 +1092,6 @@ void LLFloaterColorPicker::cancelSelection ()
// restore the previous color selection // restore the previous color selection
setCurRgb ( getOrigR (), getOrigG (), getOrigB () ); setCurRgb ( getOrigR (), getOrigG (), getOrigB () );
// we're going away and when we do and the entry widgets lose focus, they do bad things so turn them off
enableTextCallbacks ( FALSE );
// update in world item with original color via current swatch // update in world item with original color via current swatch
LLColorSwatchCtrl::onColorChanged( getSwatch(), LLColorSwatchCtrl::COLOR_CANCEL ); LLColorSwatchCtrl::onColorChanged( getSwatch(), LLColorSwatchCtrl::COLOR_CANCEL );

View File

@@ -126,12 +126,9 @@ class LLFloaterColorPicker
void onClickPipette ( ); void onClickPipette ( );
static void onTextCommit ( LLUICtrl* ctrl, void* data ); static void onTextCommit ( LLUICtrl* ctrl, void* data );
static void onImmediateCheck ( LLUICtrl* ctrl, void* data ); static void onImmediateCheck ( LLUICtrl* ctrl, void* data );
static void onHexCommit ( LLUICtrl* ctrl, void* data ); void onHexCommit(const LLSD& value);
void onColorSelect( const LLTextureEntry& te ); void onColorSelect( const LLTextureEntry& te );
private: private:
// turns on or off text entry commit call backs
void enableTextCallbacks ( BOOL stateIn );
// draws color selection palette // draws color selection palette
void drawPalette (); void drawPalette ();

View File

@@ -546,7 +546,7 @@ BOOL LLPanelAvatarFirstLife::postBuild(void)
BOOL LLPanelAvatarNotes::postBuild(void) BOOL LLPanelAvatarNotes::postBuild(void)
{ {
childSetCommitCallback("notes edit",onCommitNotes,this); getChild<LLUICtrl>("notes edit")->setCommitCallback(boost::bind(&LLPanelAvatar::sendAvatarNotesUpdate, getPanelAvatar()));
LLTextEditor* te = getChild<LLTextEditor>("notes edit"); LLTextEditor* te = getChild<LLTextEditor>("notes edit");
if(te) te->setCommitOnFocusLost(TRUE); if(te) te->setCommitOnFocusLost(TRUE);
@@ -897,14 +897,6 @@ void LLPanelAvatarNotes::clearControls()
childSetEnabled("notes edit", false); childSetEnabled("notes edit", false);
} }
// static
void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata)
{
LLPanelAvatarNotes* self = (LLPanelAvatarNotes*)userdata;
self->getPanelAvatar()->sendAvatarNotesUpdate();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LLPanelAvatarClassified() // LLPanelAvatarClassified()

View File

@@ -216,8 +216,6 @@ public:
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type){} /*virtual*/ void processProperties(void* data, EAvatarProcessorType type){}
void clearControls(); void clearControls();
static void onCommitNotes(LLUICtrl* field, void* userdata);
}; };

View File

@@ -60,6 +60,7 @@ LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings()
LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings() LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings()
{ {
if (getVisible()) cleanup(); // Singu Note: If we're still visible, we'll need to cleanup
} }
BOOL LLPanelVoiceDeviceSettings::postBuild() BOOL LLPanelVoiceDeviceSettings::postBuild()

View File

@@ -1155,6 +1155,7 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data)
//llinfos << "LLScriptEdCore::onErrorList() - " << row << ", " //llinfos << "LLScriptEdCore::onErrorList() - " << row << ", "
//<< column << llendl; //<< column << llendl;
self->mEditor->setCursor(row, column); self->mEditor->setCursor(row, column);
if (gSavedSettings.getBOOL("LiruScriptErrorsStealFocus"))
self->mEditor->setFocus(TRUE); self->mEditor->setFocus(TRUE);
} }
} }

View File

@@ -13,6 +13,7 @@
<check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/> <check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
<check_box bottom_delta="-20" control_name="FloaterUnfocusedBackgroundOpaque" follows="top" height="16" label="Make unfocused floaters opaque (requires refocusing each floater to take effect)" tool_tip="When a floater loses focus, it won't turn transparent with this enabled. This may conflict with some skins." name="unfocused_floaters_opaque"/> <check_box bottom_delta="-20" control_name="FloaterUnfocusedBackgroundOpaque" follows="top" height="16" label="Make unfocused floaters opaque (requires refocusing each floater to take effect)" tool_tip="When a floater loses focus, it won't turn transparent with this enabled. This may conflict with some skins." name="unfocused_floaters_opaque"/>
<check_box bottom_delta="-20" control_name="SinguCompleteNameProfiles" follows="top" height="16" label="Show complete names (display name and username) in profiles" tool_tip="Disregards the global name display settings, will not work if display names are switched off." name="complete_name_profiles"/> <check_box bottom_delta="-20" control_name="SinguCompleteNameProfiles" follows="top" height="16" label="Show complete names (display name and username) in profiles" tool_tip="Disregards the global name display settings, will not work if display names are switched off." name="complete_name_profiles"/>
<check_box bottom_delta="-20" control_name="LiruScriptErrorsStealFocus" follows="top" height="16" label="Let scripts steal focus when they can't compile due to errors"/>
</panel> </panel>
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors"> <panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors">
<!-- Client tag options --> <!-- Client tag options -->