[Preferences Refactor] Clean up of useless code for enablement and callbacks.

This tag will be used for refactor and updating of most of our preferences panels:
  This will include code changes that remove or condense old code
  This will include preferences being moved around to more logical locations
  This may include splitting up and/or condensing of tabs and/or subtabs for more logical placement of preferences
  This may include code changes that allow making changes to preferences faster and easier
  This will not include adding preferences
This commit is contained in:
Inusaito Sayori
2014-05-07 03:20:04 -04:00
parent a02ad53c73
commit 11098cd6d4
9 changed files with 87 additions and 283 deletions

View File

@@ -89,9 +89,6 @@ LLPrefsAscentChat::LLPrefsAscentChat()
childSetEnabled("reset_antispam", started);
getChild<LLUICtrl>("reset_antispam")->setCommitCallback(boost::bind(NACLAntiSpamRegistry::purgeAllQueues));
getChild<LLUICtrl>("enable_as")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitEnableAS, this, _2));
getChild<LLUICtrl>("antispam_checkbox")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
getChild<LLUICtrl>("Group Invites")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitDialogBlock, this, _1, _2));
getChild<LLUICtrl>("autoreplace")->setCommitCallback(boost::bind(LLFloaterAutoReplaceSettings::showInstance, LLSD()));
getChild<LLUICtrl>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));
@@ -186,39 +183,6 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl)
gSavedSettings.setString("TimestampFormat", timestamp);
}
void LLPrefsAscentChat::onCommitEnableAS(const LLSD& value)
{
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);
}
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value)
{
childSetEnabled("Group Fee Invites", !childGetValue("antispam_checkbox").asBoolean() && !childGetValue("Group Invites").asBoolean());
bool enabled = value.asBoolean();
if (ctrl->getName() == "antispam_checkbox")
{
childSetEnabled("Block All Dialogs From", !enabled);
childSetEnabled("Alerts", !enabled);
childSetEnabled("Friendship Offers", !enabled);
childSetEnabled("Group Invites", !enabled);
childSetEnabled("Group Notices", !enabled);
childSetEnabled("Item Offers", !enabled);
childSetEnabled("Scripts", !enabled);
childSetEnabled("Teleport Offers", !enabled);
childSetEnabled("Teleport Requests", !enabled);
childSetEnabled("Except those from:", !enabled);
childSetEnabled("My objects", !enabled);
childSetEnabled("My friends", !enabled);
}
}
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl)
{
if (ctrl->getName() == "KeywordsOn")
@@ -394,26 +358,6 @@ void LLPrefsAscentChat::refresh()
if (combo = getChild<LLComboBox>("speaker_namesystem_combobox"))
combo->setCurrentByIndex(mSpeakerNames);
//Antispam ------------------------------------------------------------------------
// sensitivity tuners
childSetEnabled("spammsg_checkbox", mEnableAS);
childSetEnabled("antispamtime", mEnableAS);
childSetEnabled("antispamamount", mEnableAS);
childSetEnabled("antispamsoundmulti", mEnableAS);
childSetEnabled("antispamsoundpreloadmulti", mEnableAS);
childSetEnabled("antispamnewlines", mEnableAS);
childSetEnabled("Notify On Spam", mEnableAS);
// dialog blocking tuners
childSetEnabled("Block All Dialogs From", !mBlockDialogSpam);
childSetEnabled("Alerts", !mBlockDialogSpam);
childSetEnabled("Friendship Offers", !mBlockDialogSpam);
childSetEnabled("Group Invites", !mBlockDialogSpam);
childSetEnabled("Group Fee Invites", !mBlockDialogSpam && !mBlockGroupInviteSpam);
childSetEnabled("Group Notices", !mBlockDialogSpam);
childSetEnabled("Item Offers", !mBlockDialogSpam);
childSetEnabled("Scripts", !mBlockDialogSpam);
childSetEnabled("Teleport Offers", !mBlockDialogSpam);
//Text Options ------------------------------------------------------------------------
combo = getChild<LLComboBox>("SpellBase");