Files
SingularityViewer/indra/newview/ascentprefschat.cpp
Lirusaito 0846f8a963 Fixeds and ToDones
-Color Fixies-
Fixed Gemini skin not looking as it originally did.
We now use DefaultListText to color all otherwise uncolored text in scroll list cells.
All of our dark skins have been updated to use white here, as dark skins are intended to have white text...
This includes the Dark we ship with.

LLFloaterActiveSpeakers no longer uses hard coded font colors, it uses SpeakersInactive, DefaultListText, and SpeakersGhost.

LLFloaterAvatarList no longer uses hard coded font colors, it uses DefaultListText, RadarTextChatRange, RadarTextShoutRange, and RadarTextDrawDist, in place of previously hard coded font colors
Since the tooltip defines color meaning, these new colors should only be skinned to change shade.

DefaultListText defaults to black; SpeaksInactive, gray(grey4); SpeakersGhost, Red; RadarTextChatRange, Red; RadarTextShoutRange, Yellow(yellow1); RadarTextDrawDist, Green(green2).


-Translation update and fixies-
Partial credit to viewer-development, thanks for hanging onto old strings!  Also, updated to look more like v-d in translated areas.
Punctuation strings can be used quite a lot.  Brought them all in, just in case.

AscentPrefs*:
Drag and Drop points now use CurrentlySetTo, CurrentlyNotSet, AnItemNotOnThisAccount, and NotLoggedIn. (applies, as well, to FloaterAO)
Power User message is now built from PowerUser1, PowerUser2, Unlocked:, PowerUser3, RightClick, PowerUser4 and PowerUser5; this should give translators enough space to explain any tough to translate, and make the message easier to alter in the future, if necessary.

LLCompileQueue:
Now uses translation strings from upstream
Starting, Done, Resetting, Running, and NotRunning in its xml.
CompileQueueTitle, CompileQueueStart, CompileQueueDownloadedCompiling, CompileQueueScriptNotFound, CompileQueueProblemDownloading, CompileQueueInsufficientPermDownload, CompileQueueInsufficientPermFor, CompileQueueUnknownFailure, ResetQueueTitle, ResetQueueStart, NotRunQueueTitle, and NotRunQueueStart from strings.

LLFloaterAvatarList(floater_radar) now uses has_entered, has_left, the_sim, draw_distance, shout_range, and chat_range in its xml for translatable alerts.

LLFloaterLand(floater_about_land) now uses minutes, 1_minute, 1_second, seconds, and remaining from its xml.
LLFloaterLand, LLFolderView, LLPanelDirBrowser now make use of InventoryNoMatchingItems, NoneFound, and Searching in their searches.
LLFolderView was brought closer to v-d in translation.

LLGroupNotify now uses GroupNotifyGroupNotice, GroupNotifySentBy, GroupNotifyAttached, next (also now used by LLNotify), ok, GroupNotifyGroupNotices, GroupNotifyViewPastNotices, GroupNotifyOpenAttachment, and GroupNotifySaveAttachment.

LLInventoryFilter synced with V-D for translation:
Now uses Animations, Calling Cards, Clothing, Gestures, Landmarks, Notecards, Objects, Scripts, Sounds, Textures, Snapshots, No Filters, Since Logoff, and Worn.

LLManipRotate now uses Direction_Forward, Direction_Left, Direction_Right, Direction_Back, Direction_North, Direction_South, Direction_West, Direction_East, Direction_Up, and Direction_Down, like upstream v-d.

LLPanelAvatar(panel_avatar) now uses None string in its xml for when there are no groups, also removed cruft. Though the None has not been showing up for quite some time, anyway...

LLPanelObjectInventory now uses Buy, LoadingContents and NoContents,
however the last two strings did not seem to show up anyway...
thanks to Latif Khalifa, Jean Horten, theGenius Indigo and Cubbi Bearcat for confirming this happens across many different versions and on both Windows and linux(32 and 64).

LLPreviewScript now uses CompileSuccessful, SaveComplete, ObjectOutOfRange, and CompileSuccessfulSaving.

LLScrollingPanelParam now translates Less and More.
Avatar Shape Information strings now used for customize appearance panels.

LLTextureCtrl now uses multiple_textures.

LLToolpie has been updated to use v-d include order and now uses UnmuteAvatar, MuteAvatar, UnmuteObject, and MuteObject2 strings.
LLVOAvatarSelf now uses BodyParts* strings for translation of toolpie entries pertaining to bodyparts.

LLViewerMenuFile now uses UnknownFileExtension, and UploadingCosts.

LLViewerMessage now uses Cancel(also used by LLViewerDisplay), AcquiredItems, Saved_message, IM_autoresponse_sent_item, IM_autoresponded_to, IM_announce_incoming, InvOfferDecline, InvOfferGaveYou, InvOfferOwnedByUnknownUser, InvOfferAnObjectNamed, InvOfferOwnedBy, InvOfferOwnedByUnknownGroup, and InvOfferOwnedByGroup.


-AvatarRadar Update-
AvatarRadar enhanced with code from both Cool VL Viewer and some avian corpse.
e_radar_alert_type has been reworked to allow bitwise usage in the future.

Cool stuff:
gSavedSettings for radar are now CachedControls,
entering boolean is now checked before going into the switchcase,
Style changes, yay C++ style.

Avian Flu:
Distance for shout range corrected to be 96.
handleKeyHere: If the user hits enter with an avatar on the radar selected, focus camera on selected avatar; ctrl-enter, teleport to selected avatar.

Otherwise:
Tiny spelling fixies, and a suggestive comment.
2012-08-05 20:40:02 -04:00

589 lines
25 KiB
C++

/**
* @file ascentprefssys.cpp
* @Ascent Viewer preferences panel
*
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008, Henri Beauchamp.
* Rewritten in its entirety 2010 Hg Beeks.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
//File include
#include "ascentprefschat.h"
#include "llagent.h"
#include "llcolorswatch.h"
#include "llcombobox.h"
#include "llradiogroup.h"
#include "lluictrlfactory.h"
#include "llviewercontrol.h"
#include "NACLantispam.h"
#include "lgghunspell_wrapper.h"
#include "lltrans.h"
#include "llstartup.h"
LLDropTarget* mObjectDropTarget;
LLPrefsAscentChat* LLPrefsAscentChat::sInst;
LLPrefsAscentChat::LLPrefsAscentChat()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_chat.xml");
childSetCommitCallback("SpellBase", onSpellBaseComboBoxCommit, this);
childSetAction("EmSpell_EditCustom", onSpellEditCustom, this);
childSetAction("EmSpell_GetMore", onSpellGetMore, this);
childSetAction("EmSpell_Add", onSpellAdd, this);
childSetAction("EmSpell_Remove", onSpellRemove, this);
childSetCommitCallback("time_format_combobox", onCommitTimeDate, this);
childSetCommitCallback("date_format_combobox", onCommitTimeDate, this);
childSetCommitCallback("AscentInstantMessageResponseAnyone", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageResponseFriends", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageResponseMuted", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageShowOnTyping", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageShowResponded", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageResponseRepeat", onCommitAutoResponse, this);
childSetCommitCallback("AscentInstantMessageResponseItem", onCommitAutoResponse, this);
if(sInst)delete sInst; sInst = this;
LLView* target_view = getChild<LLView>("im_give_drop_target_rect");
if (target_view)
{
const std::string drop="drop target";
if (mObjectDropTarget) delete mObjectDropTarget;
mObjectDropTarget = new LLDropTarget(drop, target_view->getRect(), SinguIMResponseItemDrop);//, mAvatarID);
addChild(mObjectDropTarget);
}
bool started = LLStartUp::getStartupState() == STATE_STARTED;
if (started)
{
LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("AscentInstantMessageResponseItemData");
LLViewerInventoryItem* item = gInventory.getItem(itemid);
if (item) childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +item->getName());
else if (itemid.isNull()) childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlyNotSet"));
else childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + " " + LLTrans::getString("AnItemNotOnThisAccount"));
}
else childSetValue("im_give_disp_rect_txt", LLTrans::getString("NotLoggedIn"));
childSetCommitCallback("im_response", onCommitAutoResponse, this);
childSetEnabled("reset_antispam", started);
childSetCommitCallback("reset_antispam", onCommitResetAS, this);
childSetCommitCallback("antispam_checkbox", onCommitDialogBlock, this);
childSetCommitCallback("KeywordsOn", onCommitKeywords, this);
childSetCommitCallback("KeywordsList", onCommitKeywords, this);
childSetCommitCallback("KeywordsSound", onCommitKeywords, this);
childSetCommitCallback("KeywordsInChat", onCommitKeywords, this);
childSetCommitCallback("KeywordsInIM", onCommitKeywords, this);
childSetCommitCallback("KeywordsChangeColor", onCommitKeywords, this);
childSetCommitCallback("KeywordsColor", onCommitKeywords, this);
childSetCommitCallback("KeywordsPlaySound", onCommitKeywords, this);
refreshValues();
refresh();
}
LLPrefsAscentChat::~LLPrefsAscentChat()
{
sInst=NULL;
delete mObjectDropTarget; mObjectDropTarget=NULL;
}
//static
void LLPrefsAscentChat::onSpellAdd(void* data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data;
if(self)
{
glggHunSpell->addButton(self->childGetValue("EmSpell_Avail").asString());
}
self->refresh();
}
//static
void LLPrefsAscentChat::onSpellRemove(void* data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)data;
if(self)
{
glggHunSpell->removeButton(self->childGetValue("EmSpell_Installed").asString());
}
self->refresh();
}
//static
void LLPrefsAscentChat::onSpellGetMore(void* data)
{
glggHunSpell->getMoreButton(data);
}
//static
void LLPrefsAscentChat::onSpellEditCustom(void* data)
{
glggHunSpell->editCustomButton();
}
//static
void LLPrefsAscentChat::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata)
{
LLComboBox* box = (LLComboBox*)ctrl;
if (box)
{
glggHunSpell->newDictSelection(box->getValue().asString());
}
}
//static
void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)userdata;
LLComboBox* combo = (LLComboBox*)ctrl;
if (ctrl->getName() == "time_format_combobox")
{
self->tempTimeFormat = combo->getCurrentIndex();
}
else if (ctrl->getName() == "date_format_combobox")
{
self->tempDateFormat = combo->getCurrentIndex();
}
std::string short_date, long_date, short_time, long_time, timestamp;
if (self->tempTimeFormat == 0)
{
short_time = "%H:%M";
long_time = "%H:%M:%S";
timestamp = " %H:%M:%S";
}
else
{
short_time = "%I:%M %p";
long_time = "%I:%M:%S %p";
timestamp = " %I:%M %p";
}
if (self->tempDateFormat == 0)
{
short_date = "%Y-%m-%d";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else if (self->tempDateFormat == 1)
{
short_date = "%d/%m/%Y";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else
{
short_date = "%m/%d/%Y";
long_date = "%A, %B %d %Y";
timestamp = "%a %b %d %Y" + timestamp;
}
gSavedSettings.setString("ShortDateFormat", short_date);
gSavedSettings.setString("LongDateFormat", long_date);
gSavedSettings.setString("ShortTimeFormat", short_time);
gSavedSettings.setString("LongTimeFormat", long_time);
gSavedSettings.setString("TimestampFormat", timestamp);
}
//static
void LLPrefsAscentChat::onCommitAutoResponse(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", self->childGetValue("AscentInstantMessageResponseAnyone"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", self->childGetValue("AscentInstantMessageResponseFriends"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", self->childGetValue("AscentInstantMessageResponseMuted"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowOnTyping", self->childGetValue("AscentInstantMessageShowOnTyping"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowResponded", self->childGetValue("AscentInstantMessageShowResponded"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", self->childGetValue("AscentInstantMessageResponseRepeat"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseItem", self->childGetValue("AscentInstantMessageResponseItem"));
gSavedPerAccountSettings.setString("AscentInstantMessageResponse", self->childGetValue("im_response"));
}
//static
void LLPrefsAscentChat::SinguIMResponseItemDrop(LLViewerInventoryItem* item)
{
gSavedPerAccountSettings.setString("AscentInstantMessageResponseItemData", item->getUUID().asString());
sInst->childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +item->getName());
}
//static
void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*)
{
NACLAntiSpamRegistry::purgeAllQueues();
}
//static
void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
bool enabled = ctrl->getValue().asBoolean();
self->childSetEnabled("Block All Dialogs From", !enabled);
self->childSetEnabled("Alerts", !enabled);
self->childSetEnabled("Friendship Offers", !enabled);
self->childSetEnabled("Group Invites", !enabled);
self->childSetEnabled("Group Notices", !enabled);
self->childSetEnabled("Item Offers", !enabled);
self->childSetEnabled("Scripts", !enabled);
self->childSetEnabled("Teleport Offers", !enabled);
}
//static
void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data;
if (ctrl->getName() == "KeywordsOn")
{
bool enabled = self->childGetValue("KeywordsOn").asBoolean();
self->childSetEnabled("KeywordsList", enabled);
self->childSetEnabled("KeywordsInChat", enabled);
self->childSetEnabled("KeywordsInIM", enabled);
self->childSetEnabled("KeywordsChangeColor", enabled);
self->childSetEnabled("KeywordsColor", enabled);
self->childSetEnabled("KeywordsPlaySound", enabled);
self->childSetEnabled("KeywordsSound", enabled);
}
gSavedPerAccountSettings.setBOOL("KeywordsOn", self->childGetValue("KeywordsOn"));
gSavedPerAccountSettings.setString("KeywordsList", self->childGetValue("KeywordsList"));
gSavedPerAccountSettings.setBOOL("KeywordsInChat", self->childGetValue("KeywordsInChat"));
gSavedPerAccountSettings.setBOOL("KeywordsInIM", self->childGetValue("KeywordsInIM"));
gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", self->childGetValue("KeywordsChangeColor"));
gSavedPerAccountSettings.setColor4("KeywordsColor", self->childGetValue("KeywordsColor"));
gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", self->childGetValue("KeywordsPlaySound"));
gSavedPerAccountSettings.setString("KeywordsSound", self->childGetValue("KeywordsSound"));
}
// Store current settings for cancel
void LLPrefsAscentChat::refreshValues()
{
//Chat/IM -----------------------------------------------------------------------------
mWoLfVerticalIMTabs = gSavedSettings.getBOOL("WoLfVerticalIMTabs");
mIMAnnounceIncoming = gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming");
mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification");
mShowGroupNameInChatIM = gSavedSettings.getBOOL("OptionShowGroupNameInChatIM");
mPlayTypingSound = gSavedSettings.getBOOL("PlayTypingSound");
mHideNotificationsInChat = gSavedSettings.getBOOL("HideNotificationsInChat");
mEnableMUPose = gSavedSettings.getBOOL("AscentAllowMUpose");
mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC");
mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects");
mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs");
std::string format = gSavedSettings.getString("ShortTimeFormat");
if (format.find("%p") == -1)
{
mTimeFormat = 0;
}
else
{
mTimeFormat = 1;
}
format = gSavedSettings.getString("ShortDateFormat");
if (format.find("%m/%d/%") != -1)
{
mDateFormat = 2;
}
else if (format.find("%d/%m/%") != -1)
{
mDateFormat = 1;
}
else
{
mDateFormat = 0;
}
tempTimeFormat = mTimeFormat;
tempDateFormat = mDateFormat;
mIMResponseAnyone = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseAnyone");
mIMResponseFriends = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseFriends");
mIMResponseMuted = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseMuted");
mIMShowOnTyping = gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowOnTyping");
mIMShowResponded = gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowResponded");
mIMResponseRepeat = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat");
mIMResponseItem = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseItem");
mIMResponseText = gSavedPerAccountSettings.getString("AscentInstantMessageResponse");
//Spam --------------------------------------------------------------------------------
mGlobalQueue = gSavedSettings.getBOOL("_NACL_AntiSpamGlobalQueue");
mChatSpamCount = gSavedSettings.getU32("_NACL_AntiSpamAmount");
mChatSpamTime = gSavedSettings.getU32("_NACL_AntiSpamTime");
mBlockDialogSpam = gSavedSettings.getBOOL("_NACL_Antispam");
mBlockAlertSpam = gSavedSettings.getBOOL("AntiSpamAlerts");
mBlockFriendSpam = gSavedSettings.getBOOL("AntiSpamFriendshipOffers");
mBlockGroupInviteSpam = gSavedSettings.getBOOL("AntiSpamGroupInvites");
mBlockGroupNoticeSpam = gSavedSettings.getBOOL("AntiSpamGroupNotices");
mBlockItemOfferSpam = gSavedSettings.getBOOL("AntiSpamItemOffers");
mBlockScriptSpam = gSavedSettings.getBOOL("AntiSpamScripts");
mBlockTeleportSpam = gSavedSettings.getBOOL("AntiSpamTeleports");
mNotifyOnSpam = gSavedSettings.getBOOL("AntiSpamNotify");
mSoundMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundMulti");
mNewLines = gSavedSettings.getU32("_NACL_AntiSpamNewlines");
mPreloadMulti = gSavedSettings.getU32("_NACL_AntiSpamSoundPreloadMulti");
//Text Options ------------------------------------------------------------------------
mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay");
mKeywordsOn = gSavedPerAccountSettings.getBOOL("KeywordsOn");
mKeywordsList = gSavedPerAccountSettings.getString("KeywordsList");
mKeywordsInChat = gSavedPerAccountSettings.getBOOL("KeywordsInChat");
mKeywordsInIM = gSavedPerAccountSettings.getBOOL("KeywordsInIM");
mKeywordsChangeColor = gSavedPerAccountSettings.getBOOL("KeywordsChangeColor");
mKeywordsColor = gSavedPerAccountSettings.getColor4("KeywordsColor");
mKeywordsPlaySound = gSavedPerAccountSettings.getBOOL("KeywordsPlaySound");
mKeywordsSound = static_cast<LLUUID>(gSavedPerAccountSettings.getString("KeywordsSound"));
}
// Update controls based on current settings
void LLPrefsAscentChat::refresh()
{
//Chat --------------------------------------------------------------------------------
// time format combobox
LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mTimeFormat);
}
// date format combobox
combo = getChild<LLComboBox>("date_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mDateFormat);
}
childSetValue("AscentInstantMessageResponseAnyone", mIMResponseAnyone);
childSetValue("AscentInstantMessageResponseFriends", mIMResponseFriends);
childSetValue("AscentInstantMessageResponseMuted", mIMResponseMuted);
childSetValue("AscentInstantMessageShowOnTyping", mIMShowOnTyping);
childSetValue("AscentInstantMessageShowResponded", mIMShowResponded);
childSetValue("AscentInstantMessageResponseRepeat", mIMResponseRepeat);
childSetValue("AscentInstantMessageResponseItem", mIMResponseItem);
LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") );
LLWStringUtil::replaceChar(auto_response, '^', '\n');
LLWStringUtil::replaceChar(auto_response, '%', ' ');
childSetText("im_response", wstring_to_utf8str(auto_response));
//Antispam ------------------------------------------------------------------------
childSetEnabled("Block All Dialogs From", !mBlockDialogSpam);
childSetEnabled("Alerts", !mBlockDialogSpam);
childSetEnabled("Friendship Offers", !mBlockDialogSpam);
childSetEnabled("Group Invites", !mBlockDialogSpam);
childSetEnabled("Group Notices", !mBlockDialogSpam);
childSetEnabled("Item Offers", !mBlockDialogSpam);
childSetEnabled("Scripts", !mBlockDialogSpam);
childSetEnabled("Teleport Offers", !mBlockDialogSpam);
//Text Options ------------------------------------------------------------------------
combo = getChild<LLComboBox>("SpellBase");
if (combo != NULL)
{
combo->removeall();
std::vector<std::string> names = glggHunSpell->getDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(gSavedSettings.getString("SpellBase"));
}
combo = getChild<LLComboBox>("EmSpell_Avail");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getAvailDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
combo = getChild<LLComboBox>("EmSpell_Installed");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getInstalledDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
childSetEnabled("KeywordsList", mKeywordsOn);
childSetEnabled("KeywordsInChat", mKeywordsOn);
childSetEnabled("KeywordsInIM", mKeywordsOn);
childSetEnabled("KeywordsChangeColor", mKeywordsOn);
childSetEnabled("KeywordsColor", mKeywordsOn);
childSetEnabled("KeywordsPlaySound", mKeywordsOn);
childSetEnabled("KeywordsSound", mKeywordsOn);
childSetValue("KeywordsOn", mKeywordsOn);
childSetValue("KeywordsList", mKeywordsList);
childSetValue("KeywordsInChat", mKeywordsInChat);
childSetValue("KeywordsInIM", mKeywordsInIM);
childSetValue("KeywordsChangeColor", mKeywordsChangeColor);
LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("KeywordsColor");
colorctrl->set(LLColor4(mKeywordsColor),TRUE);
childSetValue("KeywordsPlaySound", mKeywordsPlaySound);
childSetValue("KeywordsSound", mKeywordsSound);
}
// Reset settings to local copy
void LLPrefsAscentChat::cancel()
{
//Chat/IM -----------------------------------------------------------------------------
gSavedSettings.setBOOL("WoLfVerticalIMTabs", mWoLfVerticalIMTabs);
gSavedSettings.setBOOL("AscentInstantMessageAnnounceIncoming", mIMAnnounceIncoming);
gSavedSettings.setBOOL("AscentHideTypingNotification", mHideTypingNotification);
gSavedSettings.setBOOL("OptionShowGroupNameInChatIM", mShowGroupNameInChatIM);
gSavedSettings.setBOOL("PlayTypingSound", mPlayTypingSound);
gSavedSettings.setBOOL("HideNotificationsInChat", mHideNotificationsInChat);
gSavedSettings.setBOOL("AscentAllowMUpose", mEnableMUPose);
gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose);
gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects);
gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs);
std::string short_date, long_date, short_time, long_time, timestamp;
if (mTimeFormat == 0)
{
short_time = "%H:%M";
long_time = "%H:%M:%S";
timestamp = " %H:%M:%S";
}
else
{
short_time = "%I:%M %p";
long_time = "%I:%M:%S %p";
timestamp = " %I:%M %p";
}
if (mDateFormat == 0)
{
short_date = "%Y-%m-%d";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else if (mDateFormat == 1)
{
short_date = "%d/%m/%Y";
long_date = "%A %d %B %Y";
timestamp = "%a %d %b %Y" + timestamp;
}
else
{
short_date = "%m/%d/%Y";
long_date = "%A, %B %d %Y";
timestamp = "%a %b %d %Y" + timestamp;
}
gSavedSettings.setString("ShortDateFormat", short_date);
gSavedSettings.setString("LongDateFormat", long_date);
gSavedSettings.setString("ShortTimeFormat", short_time);
gSavedSettings.setString("LongTimeFormat", long_time);
gSavedSettings.setString("TimestampFormat", timestamp);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", mIMResponseAnyone);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", mIMResponseFriends);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", mIMResponseMuted);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowOnTyping", mIMShowOnTyping);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowResponded", mIMShowResponded);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", mIMResponseRepeat);
gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseItem", mIMResponseItem);
gSavedPerAccountSettings.setString("AscentInstantMessageResponse", mIMResponseText);
//Spam --------------------------------------------------------------------------------
gSavedSettings.setBOOL("_NACL_AntiSpamGlobalQueue", mGlobalQueue);
gSavedSettings.setU32("_NACL_AntiSpamAmount", mChatSpamCount);
gSavedSettings.setU32("_NACL_AntiSpamTime", mChatSpamTime);
gSavedSettings.setBOOL("_NACL_Antispam", mBlockDialogSpam);
gSavedSettings.setBOOL("AntiSpamAlerts", mBlockAlertSpam);
gSavedSettings.setBOOL("AntiSpamFriendshipOffers", mBlockFriendSpam);
gSavedSettings.setBOOL("AntiSpamGroupNotices", mBlockGroupNoticeSpam);
gSavedSettings.setBOOL("AntiSpamGroupInvites", mBlockGroupInviteSpam);
gSavedSettings.setBOOL("AntiSpamItemOffers", mBlockItemOfferSpam);
gSavedSettings.setBOOL("AntiSpamScripts", mBlockScriptSpam);
gSavedSettings.setBOOL("AntiSpamTeleports", mBlockTeleportSpam);
gSavedSettings.setBOOL("AntiSpamNotify", mNotifyOnSpam);
gSavedSettings.setU32("_NACL_AntiSpamSoundMulti", mSoundMulti);
gSavedSettings.setU32("_NACL_AntiSpamNewlines", mNewLines);
gSavedSettings.setU32("_NACL_AntiSpamSoundPreloadMulti", mPreloadMulti);
//Text Options ------------------------------------------------------------------------
gSavedSettings.setBOOL("SpellDisplay", mSpellDisplay);
gSavedPerAccountSettings.setBOOL("KeywordsOn", mKeywordsOn);
gSavedPerAccountSettings.setString("KeywordsList", mKeywordsList);
gSavedPerAccountSettings.setBOOL("KeywordsInChat", mKeywordsInChat);
gSavedPerAccountSettings.setBOOL("KeywordsInIM", mKeywordsInIM);
gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", mKeywordsChangeColor);
gSavedPerAccountSettings.setColor4("KeywordsColor", mKeywordsColor);
gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", mKeywordsPlaySound);
gSavedPerAccountSettings.setString("KeywordsSound", mKeywordsSound.asString());
}
// Update local copy so cancel has no effect
void LLPrefsAscentChat::apply()
{
gSavedPerAccountSettings.setString("AscentInstantMessageResponse", childGetValue("im_response"));
refreshValues();
refresh();
}