diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 13b99550b..cf3bf9e3e 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -61,6 +61,13 @@ typedef enum e_chat_audible_level CHAT_AUDIBLE_FULLY = 1 } EChatAudible; +typedef enum e_chat_style +{ + CHAT_STYLE_NORMAL, + CHAT_STYLE_IRC, + CHAT_STYLE_HISTORY +}EChatStyle; + // A piece of chat class LLChat { @@ -80,7 +87,8 @@ public: // [/RLVa:KB] mTime(0.0), mPosAgent(), - mURL() + mURL(), + mChatStyle(CHAT_STYLE_NORMAL) { } LLChat(const LLChat &chat) @@ -93,7 +101,8 @@ public: mMuted(chat.mMuted), mTime(chat.mTime), mPosAgent(chat.mPosAgent), - mURL(chat.mURL) + mURL(chat.mURL), + mChatStyle(chat.mChatStyle) { } std::string mText; // UTF-8 line of text @@ -110,6 +119,7 @@ public: F64 mTime; // viewer only, seconds from viewer start LLVector3 mPosAgent; std::string mURL; + EChatStyle mChatStyle; }; #endif diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d62dc5bd6..35d0a6773 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -681,6 +681,17 @@ Value 0 + LiruItalicizeActions + + Comment + When enabled, /me chat will be italicized. + Persist + 1 + Type + Boolean + Value + 0 + LiruFlyAfterTeleport Comment @@ -15568,6 +15579,17 @@ This should be as low as possible, but too low may break functionality Value 0 + InstantMessagesFriendsOnly + + Comment + Only accept instant messages from residents on your friends list + Persist + 1 + Type + Boolean + Value + 0 + AutoDisengageMic Comment @@ -16415,6 +16437,17 @@ This should be as low as possible, but too low may break functionality Value 0 + ClearBeaconAfterTeleport + + Comment + Clear the red tracker beacon after you teleport + Persist + 1 + Type + Boolean + Value + 0 + LogTextureDownloadsToViewerLog Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index b591a82db..d389c3b8d 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -199,9 +199,9 @@ - - - + + + AscentContactGroups Comment @@ -215,72 +215,7 @@ - AscentInstantMessageResponse - - Comment - Auto response to instant messages - Persist - 1 - Type - String - Value - This is an autoresponse! - - AscentInstantMessageResponseAnyone - - Comment - Whether to auto-respond to anyone - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseFriends - - Comment - Whether to auto-respond to non-friends - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseItem - - Comment - Whether to send a item along with the autoresponse - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseItemData - - Comment - UUID - Persist - 1 - Type - String - Value - - - AscentInstantMessageResponseMuted - - Comment - Whether to auto-respond to muted people - Persist - 1 - Type - Boolean - Value - 0 - + AscentInstantMessageResponseRepeat Comment @@ -292,21 +227,11 @@ Value 0 + AscentInstantMessageShowOnTyping Comment - Whether to perform the autorespond the moment they begin to type instead of waiting for a actual message - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageShowResponded - - Comment - Whether to hide IMs entirely from those you have chosen to send autoresponses + Whether to perform the autorespond the moment they begin to type instead of waiting for an actual message Persist 1 Type @@ -314,6 +239,219 @@ Value 0 + + + AutoresponseAnyone + + Comment + Whether to send autoresponse to anyone who isn't muted (or just friends, if AutoresponseAnyoneFriendsOnly) + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneFriendsOnly + + Comment + Whether to send AutoresponseAnyone to friends only + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneItem + + Comment + Whether to send a item along with AutoresponseAnyone + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneItemID + + Comment + UUID of item to send along with AutoresponseAnyone + Persist + 1 + Type + String + Value + + + AutoresponseAnyoneMessage + + Comment + Message to send as the autoresponse to AutoresponseAnyone + Persist + 1 + Type + String + Value + This is an autoresponse! + + AutoresponseAnyoneShow + + Comment + Whether to show that AutoresponseAnyone's were sent + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriends + + Comment + Whether to send autoresponse to nonfriends, separately using a different response + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriendsItem + + Comment + Whether to send a item along with AutoresponseNonFriends + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriendsItemID + + Comment + UUID of item to send along with AutoresponseNonFriends + Persist + 1 + Type + String + Value + + + AutoresponseNonFriendsMessage + + Comment + Message to send as the autoresponse to AutoresponseNonFriends + Persist + 1 + Type + String + Value + This is an autoresponse! + + AutoresponseNonFriendsShow + + Comment + Whether to show that AutoresponseNonFriends's were sent + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMuted + + Comment + Whether to send autoresponse to muted people + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMutedItem + + Comment + Whether to send a item along with AutoresponseMuted + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMutedItemID + + Comment + UUID of item to send along with AutoresponseMuted + Persist + 1 + Type + String + Value + + + AutoresponseMutedMessage + + Comment + Message to send as the autoresponse to AutoresponseMuted + Persist + 1 + Type + String + Value + This is an autoresponse! + + BusyModeResponse + + Comment + Auto response to instant messages while in busy mode. + Persist + 1 + Type + String + Value + The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. + + BusyModeResponseItem + + Comment + Whether to send a item along with BusyModeResponse + Persist + 1 + Type + Boolean + Value + 0 + + BusyModeResponseItemID + + Comment + UUID of item to send along with BusyModeResponse + Persist + 1 + Type + String + Value + + + BusyModeResponseShow + + Comment + Whether to show that BusyModeResponses were sent + Persist + 1 + Type + Boolean + Value + 0 + + + EveryoneExport Comment @@ -336,84 +474,7 @@ Value 1 - BusyModeResponse - - Comment - Auto response to instant messages while in busy mode. - - AO.Settings - - Comment - List for animation overrider - Persist - 1 - Type - LLSD - Value - - - - - Responder.Settings - - Comment - New organization to the Auto-Respond settings for keeping clean - Persist - 1 - Type - LLSD - Value - - Message - This is an autoresponse! - - - - rkeastInventoryPreviousCount - - Comment - Used to keep track of the number of items in inventory when fetching for progress reasons. DO NOT EDIT. - Persist - 1 - Type - S32 - Value - -1 - - rkeastInventorySearchType - - Comment - Controls what type of inventory search we perform. - Persist - 0 - Type - U32 - Value - 0 - - rkeastInventoryPartialSearch - - Comment - Toggles whether to search using partial search filters on normal (name, desc, creator) searches. - Persist - 0 - Type - Boolean - Value - 0 - - BusyModeResponse - - Comment - Auto response to instant messages while in busy mode. - Persist - 1 - Type - String - Value - The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. - IMLogTimestamp Comment diff --git a/indra/newview/app_settings/settings_per_account_ascent.xml b/indra/newview/app_settings/settings_per_account_ascent.xml index 810586528..cd73b2f33 100644 --- a/indra/newview/app_settings/settings_per_account_ascent.xml +++ b/indra/newview/app_settings/settings_per_account_ascent.xml @@ -14,72 +14,7 @@ - AscentInstantMessageResponse - - Comment - Auto response to instant messages - Persist - 1 - Type - String - Value - This is an autoresponse! - - AscentInstantMessageResponseAnyone - - Comment - Whether to auto-respond to anyone - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseFriends - - Comment - Whether to auto-respond to non-friends - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseItem - - Comment - Whether to send a item along with the autoresponse - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageResponseItemData - - Comment - UUID - Persist - 1 - Type - String - Value - - - AscentInstantMessageResponseMuted - - Comment - Whether to auto-respond to muted people - Persist - 1 - Type - Boolean - Value - 0 - + AscentInstantMessageResponseRepeat Comment @@ -91,21 +26,11 @@ Value 0 + AscentInstantMessageShowOnTyping Comment - Whether to perform the autorespond the moment they begin to type instead of waiting for a actual message - Persist - 1 - Type - Boolean - Value - 0 - - AscentInstantMessageShowResponded - - Comment - Whether to hide IMs entirely from those you have chosen to send autoresponses + Whether to perform the autorespond the moment they begin to type instead of waiting for an actual message Persist 1 Type @@ -113,5 +38,216 @@ Value 0 + + + AutoresponseAnyone + + Comment + Whether to send autoresponse to anyone who isn't muted (or just friends, if AutoresponseAnyoneFriendsOnly) + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneFriendsOnly + + Comment + Whether to send AutoresponseAnyone to friends only + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneItem + + Comment + Whether to send a item along with AutoresponseAnyone + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseAnyoneItemID + + Comment + UUID of item to send along with AutoresponseAnyone + Persist + 1 + Type + String + Value + + + AutoresponseAnyoneMessage + + Comment + Message to send as the autoresponse to AutoresponseAnyone + Persist + 1 + Type + String + Value + This is an autoresponse! + + AutoresponseAnyoneShow + + Comment + Whether to show that AutoresponseAnyone's were sent + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriends + + Comment + Whether to send autoresponse to nonfriends, separately using a different response + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriendsItem + + Comment + Whether to send a item along with AutoresponseNonFriends + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseNonFriendsItemID + + Comment + UUID of item to send along with AutoresponseNonFriends + Persist + 1 + Type + String + Value + + + AutoresponseNonFriendsMessage + + Comment + Message to send as the autoresponse to AutoresponseNonFriends + Persist + 1 + Type + String + Value + This is an autoresponse! + + AutoresponseNonFriendsShow + + Comment + Whether to show that AutoresponseNonFriends's were sent + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMuted + + Comment + Whether to send autoresponse to muted people + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMutedItem + + Comment + Whether to send a item along with AutoresponseMuted + Persist + 1 + Type + Boolean + Value + 0 + + AutoresponseMutedItemID + + Comment + UUID of item to send along with AutoresponseMuted + Persist + 1 + Type + String + Value + + + AutoresponseMutedMessage + + Comment + Message to send as the autoresponse to AutoresponseMuted + Persist + 1 + Type + String + Value + This is an autoresponse! + + BusyModeResponse + + Comment + Auto response to instant messages while in busy mode. + Persist + 1 + Type + String + Value + The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. + + BusyModeResponseItem + + Comment + Whether to send a item along with BusyModeResponse + Persist + 1 + Type + Boolean + Value + 0 + + BusyModeResponseItemID + + Comment + UUID of item to send along with BusyModeResponse + Persist + 1 + Type + String + Value + + + BusyModeResponseShow + + Comment + Whether to show that BusyModeResponses were sent + Persist + 1 + Type + Boolean + Value + 0 + - \ No newline at end of file + diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index f24724279..bc0a0f5ee 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -46,8 +46,6 @@ #include "llstartup.h" -LLDropTarget* mObjectDropTarget; -LLPrefsAscentChat* LLPrefsAscentChat::sInst; LLPrefsAscentChat::LLPrefsAscentChat() { @@ -62,44 +60,31 @@ LLPrefsAscentChat::LLPrefsAscentChat() 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("im_give_drop_target_rect"); - if (target_view) + bool started = (LLStartUp::getStartupState() == STATE_STARTED); + if (!started) // Disable autoresponse when not logged in { - const std::string drop="drop target"; - if (mObjectDropTarget) delete mObjectDropTarget; - mObjectDropTarget = new LLDropTarget(drop, target_view->getRect(), SinguIMResponseItemDrop);//, mAvatarID); - addChild(mObjectDropTarget); + LLView* autoresponse = getChildView("Autoresponse"); + autoresponse->setAllChildrenEnabled(false); + autoresponse->setToolTip(LLTrans::getString("NotLoggedIn")); } - bool started = LLStartUp::getStartupState() == STATE_STARTED; - if (started) - { - LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("AscentInstantMessageResponseItemData"); - LLViewerInventoryItem* item = gInventory.getItem(itemid); - - if (item) - { - LLStringUtil::format_map_t args; - args["[ITEM]"] = item->getName(); - childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args)); - } - else if (itemid.isNull()) - childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlyNotSet")); - else - childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount")); - } - else childSetValue("im_give_disp_rect_txt", LLTrans::getString("NotLoggedIn")); - - childSetCommitCallback("im_response", onCommitAutoResponse, this); + // Saved per account settings aren't detected by control_name, therefore autoresponse controls get their values here and have them saved during apply. + childSetValue("AscentInstantMessageResponseRepeat", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat")); + childSetValue("AutoresponseAnyone", gSavedPerAccountSettings.getBOOL("AutoresponseAnyone")); + childSetValue("AutoresponseAnyoneFriendsOnly", gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneFriendsOnly")); + childSetValue("AutoresponseAnyoneItem", gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneItem")); + childSetValue("AutoresponseAnyoneMessage", gSavedPerAccountSettings.getString("AutoresponseAnyoneMessage")); + childSetValue("AutoresponseAnyoneShow", gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneShow")); + childSetValue("AutoresponseNonFriends", gSavedPerAccountSettings.getBOOL("AutoresponseNonFriends")); + childSetValue("AutoresponseNonFriendsItem", gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsItem")); + childSetValue("AutoresponseNonFriendsMessage", gSavedPerAccountSettings.getString("AutoresponseNonFriendsMessage")); + childSetValue("AutoresponseNonFriendsShow", gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsShow")); + childSetValue("AutoresponseMuted", gSavedPerAccountSettings.getBOOL("AutoresponseMuted")); + childSetValue("AutoresponseMutedItem", gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")); + childSetValue("AutoresponseMutedMessage", gSavedPerAccountSettings.getString("AutoresponseMutedMessage")); + childSetValue("BusyModeResponse", gSavedPerAccountSettings.getString("BusyModeResponse")); + childSetValue("BusyModeResponseItem", gSavedPerAccountSettings.getBOOL("BusyModeResponseItem")); + childSetValue("BusyModeResponseShow", gSavedPerAccountSettings.getBOOL("BusyModeResponseShow")); childSetEnabled("reset_antispam", started); childSetCommitCallback("reset_antispam", onCommitResetAS, this); @@ -122,8 +107,6 @@ LLPrefsAscentChat::LLPrefsAscentChat() LLPrefsAscentChat::~LLPrefsAscentChat() { - sInst=NULL; - delete mObjectDropTarget; mObjectDropTarget=NULL; } //static @@ -231,30 +214,6 @@ void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata) 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()); - LLStringUtil::format_map_t args; - args["[ITEM]"] = item->getName(); - sInst->childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args)); -} - //static void LLPrefsAscentChat::onCommitResetAS(LLUICtrl*, void*) { @@ -327,6 +286,7 @@ void LLPrefsAscentChat::refreshValues() //Chat/IM ----------------------------------------------------------------------------- mIMAnnounceIncoming = gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming"); mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification"); + mInstantMessagesFriendsOnly = gSavedSettings.getBOOL("InstantMessagesFriendsOnly"); mShowGroupNameInChatIM = gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"); mShowDisplayNameChanges = gSavedSettings.getBOOL("ShowDisplayNameChanges"); mUseTypingBubbles = gSavedSettings.getBOOL("UseTypingBubbles"); @@ -365,15 +325,6 @@ void LLPrefsAscentChat::refreshValues() 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"); - //Chat UI ----------------------------------------------------------------------------- mWoLfVerticalIMTabs = gSavedSettings.getBOOL("WoLfVerticalIMTabs"); mOtherChatsTornOff = gSavedSettings.getBOOL("OtherChatsTornOff"); @@ -383,6 +334,30 @@ void LLPrefsAscentChat::refreshValues() mOneLineGroupButt = gSavedSettings.getBOOL("UseConciseGroupChatButtons"); mOneLineConfButt = gSavedSettings.getBOOL("UseConciseConferenceButtons"); mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut"); + mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); + + //Autoresponse ------------------------------------------------------------------------ + mIMResponseAnyoneItemID = gSavedPerAccountSettings.getString("AutoresponseAnyoneItemID"); + mIMResponseNonFriendsItemID = gSavedPerAccountSettings.getString("AutoresponseNonFriendsItemID"); + mIMResponseMutedItemID = gSavedPerAccountSettings.getString("AutoresponseMutedItemID"); + mIMResponseBusyItemID = gSavedPerAccountSettings.getString("BusyModeResponseItemID"); + + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", childGetValue("AscentInstantMessageResponseRepeat")); + gSavedPerAccountSettings.setBOOL("AutoresponseAnyone", childGetValue("AutoresponseAnyone")); + gSavedPerAccountSettings.setBOOL("AutoresponseAnyoneFriendsOnly", childGetValue("AutoresponseAnyoneFriendsOnly")); + gSavedPerAccountSettings.setBOOL("AutoresponseAnyoneItem", childGetValue("AutoresponseAnyoneItem")); + gSavedPerAccountSettings.setString("AutoresponseAnyoneMessage", childGetValue("AutoresponseAnyoneMessage")); + gSavedPerAccountSettings.setBOOL("AutoresponseAnyoneShow", childGetValue("AutoresponseAnyoneShow")); + gSavedPerAccountSettings.setBOOL("AutoresponseNonFriends", childGetValue("AutoresponseNonFriends")); + gSavedPerAccountSettings.setBOOL("AutoresponseNonFriendsItem", childGetValue("AutoresponseNonFriendsItem")); + gSavedPerAccountSettings.setString("AutoresponseNonFriendsMessage", childGetValue("AutoresponseNonFriendsMessage")); + gSavedPerAccountSettings.setBOOL("AutoresponseNonFriendsShow", childGetValue("AutoresponseNonFriendsShow")); + gSavedPerAccountSettings.setBOOL("AutoresponseMuted", childGetValue("AutoresponseMuted")); + gSavedPerAccountSettings.setBOOL("AutoresponseMutedItem", childGetValue("AutoresponseMutedItem")); + gSavedPerAccountSettings.setString("AutoresponseMutedMessage", childGetValue("AutoresponseMutedMessage")); + gSavedPerAccountSettings.setString("BusyModeResponse", childGetValue("BusyModeResponse")); + gSavedPerAccountSettings.setBOOL("BusyModeResponseItem", childGetValue("BusyModeResponseItem")); + gSavedPerAccountSettings.setBOOL("BusyModeResponseShow", childGetValue("BusyModeResponseShow")); //Spam -------------------------------------------------------------------------------- mEnableAS = gSavedSettings.getBOOL("AntiSpamEnabled"); @@ -434,19 +409,6 @@ void LLPrefsAscentChat::refresh() 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 ------------------------------------------------------------------------ // sensitivity tuners childSetEnabled("spammsg_checkbox", mEnableAS); @@ -544,6 +506,7 @@ void LLPrefsAscentChat::cancel() //Chat/IM ----------------------------------------------------------------------------- gSavedSettings.setBOOL("AscentInstantMessageAnnounceIncoming", mIMAnnounceIncoming); gSavedSettings.setBOOL("AscentHideTypingNotification", mHideTypingNotification); + gSavedSettings.setBOOL("InstantMessagesFriendsOnly", mInstantMessagesFriendsOnly); gSavedSettings.setBOOL("OptionShowGroupNameInChatIM", mShowGroupNameInChatIM); gSavedSettings.setBOOL("ShowDisplayNameChanges", mShowDisplayNameChanges); gSavedSettings.setBOOL("UseTypingBubbles", mUseTypingBubbles); @@ -595,15 +558,6 @@ void LLPrefsAscentChat::cancel() 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); - //Chat UI ----------------------------------------------------------------------------- gSavedSettings.setBOOL("WoLfVerticalIMTabs", mWoLfVerticalIMTabs); gSavedSettings.setBOOL("OtherChatsTornOff", mOtherChatsTornOff); @@ -613,6 +567,13 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("UseConciseGroupChatButtons", mOneLineGroupButt); gSavedSettings.setBOOL("UseConciseConferenceButtons", mOneLineConfButt); gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm); + gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); + + //Autoresponse ------------------------------------------------------------------------ + gSavedPerAccountSettings.setString("AutoresponseAnyoneItemID", mIMResponseAnyoneItemID); + gSavedPerAccountSettings.setString("AutoresponseNonFriendsItemID", mIMResponseNonFriendsItemID); + gSavedPerAccountSettings.setString("AutoresponseMutedItemID", mIMResponseMutedItemID); + gSavedPerAccountSettings.setString("BusyModeResponseItemID", mIMResponseBusyItemID); //Spam -------------------------------------------------------------------------------- gSavedSettings.setBOOL("AntiSpamEnabled", mEnableAS); @@ -632,7 +593,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setU32("_NACL_AntiSpamSoundMulti", mSoundMulti); gSavedSettings.setU32("_NACL_AntiSpamNewlines", mNewLines); gSavedSettings.setU32("_NACL_AntiSpamSoundPreloadMulti", mPreloadMulti); - gSavedSettings.setBOOL("EnableGestureSounds", mEnableGestureSounds); + gSavedSettings.setBOOL("EnableGestureSounds", mEnableGestureSounds); //Text Options ------------------------------------------------------------------------ gSavedSettings.setBOOL("SpellDisplay", mSpellDisplay); @@ -649,8 +610,6 @@ void LLPrefsAscentChat::cancel() // Update local copy so cancel has no effect void LLPrefsAscentChat::apply() { - gSavedPerAccountSettings.setString("AscentInstantMessageResponse", childGetValue("im_response")); - refreshValues(); refresh(); } diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index 04fa1a69c..700800941 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -34,8 +34,6 @@ #include "llpanel.h" -#include "lldroptarget.h" - class LLPrefsAscentChat : public LLPanel { @@ -55,7 +53,6 @@ protected: static void onSpellEditCustom(void* data); static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); static void onCommitTimeDate(LLUICtrl* ctrl, void *userdata); - static void onCommitAutoResponse(LLUICtrl* ctrl, void* user_data); static void onCommitResetAS(LLUICtrl*,void*); static void onCommitEnableAS(LLUICtrl*, void*); static void onCommitDialogBlock(LLUICtrl*, void*); @@ -64,6 +61,7 @@ protected: //Chat/IM ----------------------------------------------------------------------------- BOOL mIMAnnounceIncoming; BOOL mHideTypingNotification; + bool mInstantMessagesFriendsOnly; BOOL mShowGroupNameInChatIM; bool mShowDisplayNameChanges; bool mUseTypingBubbles; @@ -79,15 +77,6 @@ protected: BOOL mSecondsInChatAndIMs; BOOL mSecondsInLog; - BOOL mIMResponseAnyone; - BOOL mIMResponseFriends; - BOOL mIMResponseMuted; - BOOL mIMShowOnTyping; - BOOL mIMShowResponded; - BOOL mIMResponseRepeat; - BOOL mIMResponseItem; - std::string mIMResponseText; - //Chat UI ----------------------------------------------------------------------------- bool mWoLfVerticalIMTabs; bool mOtherChatsTornOff; @@ -97,6 +86,13 @@ protected: bool mOneLineGroupButt; bool mOneLineConfButt; bool mOnlyComm; + bool mItalicizeActions; + + //Autoresponse ------------------------------------------------------------------------ + std::string mIMResponseAnyoneItemID; + std::string mIMResponseNonFriendsItemID; + std::string mIMResponseMutedItemID; + std::string mIMResponseBusyItemID; //Spam -------------------------------------------------------------------------------- BOOL mEnableAS; @@ -128,9 +124,6 @@ protected: LLColor4 mKeywordsColor; BOOL mKeywordsPlaySound; LLUUID mKeywordsSound; -private: - static LLPrefsAscentChat* sInst; - static void SinguIMResponseItemDrop(LLViewerInventoryItem* item); }; #endif diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index a0477fdda..fc2bc1a62 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -44,12 +44,8 @@ #include "lltexturectrl.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" -#include "llstartup.h" #include "lltrans.h" -LLDropTarget* mBuildDropTarget; -LLPrefsAscentSys* LLPrefsAscentSys::sInst; - LLPrefsAscentSys::LLPrefsAscentSys() { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml"); @@ -91,42 +87,12 @@ LLPrefsAscentSys::LLPrefsAscentSys() getChild("texture control")->setDefaultImageAssetID(LLUUID(gSavedSettings.getString("EmeraldBuildPrefs_Texture"))); childSetCommitCallback("texture control", onCommitTexturePicker, this); - if(sInst)delete sInst; sInst = this; - LLView* target_view = getChild("build_item_drop_target_rect"); - if (target_view) - { - const std::string drop="drop target"; - if (mBuildDropTarget) delete mBuildDropTarget; - mBuildDropTarget = new LLDropTarget(drop, target_view->getRect(), SinguBuildItemDrop);//, mAvatarID); - addChild(mBuildDropTarget); - } - - if (LLStartUp::getStartupState() == STATE_STARTED) - { - LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("EmeraldBuildPrefs_Item"); - LLViewerInventoryItem* item = gInventory.getItem(itemid); - - if (item) - { - LLStringUtil::format_map_t args; - args["[ITEM]"] = item->getName(); - childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args)); - } - else if (itemid.isNull()) - childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlyNotSet")); - else - childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount")); - } - else childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("NotLoggedIn")); - refreshValues(); refresh(); } LLPrefsAscentSys::~LLPrefsAscentSys() { - sInst=NULL; - delete mBuildDropTarget; mBuildDropTarget=NULL; } //static @@ -253,21 +219,13 @@ void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl, void* userdata) if(image_ctrl) gSavedSettings.setString("EmeraldBuildPrefs_Texture", image_ctrl->getImageAssetID().asString()); } -//static -void LLPrefsAscentSys::SinguBuildItemDrop(LLViewerInventoryItem* item) -{ - gSavedPerAccountSettings.setString("EmeraldBuildPrefs_Item", item->getUUID().asString()); - LLStringUtil::format_map_t args; - args["[ITEM]"] = item->getName(); - sInst->childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args)); -} - void LLPrefsAscentSys::refreshValues() { //General ----------------------------------------------------------------------------- mDoubleClickTeleport = gSavedSettings.getBOOL("DoubleClickTeleport"); mResetCameraAfterTP = gSavedSettings.getBOOL("OptionRotateCamAfterLocalTP"); mOffsetTPByUserHeight = gSavedSettings.getBOOL("OptionOffsetTPByAgentHeight"); + mClearBeaconAfterTeleport = gSavedSettings.getBOOL("ClearBeaconAfterTeleport"); mLiruFlyAfterTeleport = gSavedSettings.getBOOL("LiruFlyAfterTeleport"); mLiruContinueFlying = gSavedSettings.getBOOL("LiruContinueFlyingOnUnsit"); mPreviewAnimInWorld = gSavedSettings.getBOOL("PreviewAnimInWorld"); @@ -323,6 +281,7 @@ void LLPrefsAscentSys::refreshValues() mColor = gSavedSettings.getColor4("EmeraldBuildPrefs_Color"); mFullBright = gSavedSettings.getBOOL("EmeraldBuildPrefs_FullBright"); mGlow = gSavedSettings.getF32("EmeraldBuildPrefs_Glow"); + mItem = gSavedPerAccountSettings.getString("EmeraldBuildPrefs_Item"); mMaterial = gSavedSettings.getString("BuildPrefs_Material"); mNextCopy = gSavedSettings.getBOOL("NextOwnerCopy"); mNextMod = gSavedSettings.getBOOL("NextOwnerModify"); @@ -420,6 +379,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("DoubleClickTeleport", mDoubleClickTeleport); gSavedSettings.setBOOL("OptionRotateCamAfterLocalTP", mResetCameraAfterTP); gSavedSettings.setBOOL("OptionOffsetTPByAgentHeight", mOffsetTPByUserHeight); + gSavedSettings.setBOOL("ClearBeaconAfterTeleport", mClearBeaconAfterTeleport); gSavedSettings.setBOOL("LiruFlyAfterTeleport", mLiruFlyAfterTeleport); gSavedSettings.setBOOL("LiruContinueFlyingOnUnsit", mLiruContinueFlying); gSavedSettings.setBOOL("PreviewAnimInWorld", mPreviewAnimInWorld); @@ -474,6 +434,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setColor4("EmeraldBuildPrefs_Color", mColor); gSavedSettings.setBOOL("EmeraldBuildPrefs_FullBright", mFullBright); gSavedSettings.setF32("EmeraldBuildPrefs_Glow", mGlow); + gSavedPerAccountSettings.setString("EmeraldBuildPrefs_Item", mItem); gSavedSettings.setString("BuildPrefs_Material", mMaterial); gSavedSettings.setBOOL("NextOwnerCopy", mNextCopy); gSavedSettings.setBOOL("NextOwnerModify", mNextMod); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 60cf4f4de..2ecacb43e 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -34,8 +34,6 @@ #include "llpanel.h" -#include "lldroptarget.h" - class LLPrefsAscentSys : public LLPanel { @@ -58,6 +56,7 @@ protected: BOOL mDoubleClickTeleport; BOOL mResetCameraAfterTP; BOOL mOffsetTPByUserHeight; + bool mClearBeaconAfterTeleport; bool mLiruFlyAfterTeleport; bool mLiruContinueFlying; BOOL mPreviewAnimInWorld; @@ -107,11 +106,13 @@ protected: bool mDisableClickSitOtherOwner; BOOL mDisplayScriptJumps; F32 mNumScriptDiff; + //Build ------------------------------------------------------------------------------- F32 mAlpha; LLColor4 mColor; BOOL mFullBright; F32 mGlow; + std::string mItem; std::string mMaterial; BOOL mNextCopy; BOOL mNextMod; @@ -124,9 +125,6 @@ protected: F32 mXsize; F32 mYsize; F32 mZsize; -private: - static LLPrefsAscentSys* sInst; - static void SinguBuildItemDrop(LLViewerInventoryItem* item); }; #endif diff --git a/indra/newview/floaterao.cpp b/indra/newview/floaterao.cpp index b7ab4994e..c9386d95a 100644 --- a/indra/newview/floaterao.cpp +++ b/indra/newview/floaterao.cpp @@ -136,73 +136,6 @@ BOOL AOInvTimer::tick() } return FALSE; } -// NC DROP ------------------------------------------------------- - -class AONoteCardDropTarget : public LLView -{ -public: - AONoteCardDropTarget(const std::string& name, const LLRect& rect, void (*callback)(LLViewerInventoryItem*)); - ~AONoteCardDropTarget(); - - void doDrop(EDragAndDropType cargo_type, void* cargo_data); - - // - // LLView functionality - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); -protected: - void (*mDownCallback)(LLViewerInventoryItem*); -}; - - -AONoteCardDropTarget::AONoteCardDropTarget(const std::string& name, const LLRect& rect, - void (*callback)(LLViewerInventoryItem*)) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mDownCallback(callback) -{ -} - -AONoteCardDropTarget::~AONoteCardDropTarget() -{ -} - -void AONoteCardDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) -{ -// llinfos << "AONoteCardDropTarget::doDrop()" << llendl; -} - -BOOL AONoteCardDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) -{ - BOOL handled = FALSE; - if(getParent()) - { - handled = TRUE; - LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; - if(gInventory.getItem(inv_item->getUUID())) - { - *accept = ACCEPT_YES_COPY_SINGLE; - if(drop) - { - mDownCallback(inv_item); - } - } - else - { - *accept = ACCEPT_NO; - } - } - return handled; -} - -AONoteCardDropTarget * LLFloaterAO::mAOItemDropTarget; - // STUFF ------------------------------------------------------- @@ -283,8 +216,6 @@ LLFloaterAO::~LLFloaterAO() mcomboBox_lands = 0; mcomboBox_standups = 0; mcomboBox_prejumps = 0; - delete mAOItemDropTarget; - mAOItemDropTarget = NULL; // llinfos << "floater destroyed" << llendl; } @@ -315,39 +246,6 @@ bool LLFloaterAO::getInstance() BOOL LLFloaterAO::postBuild() { - LLView *target_view = getChild("ao_notecard"); - if(target_view) - { - if (mAOItemDropTarget) - { - delete mAOItemDropTarget; - } - mAOItemDropTarget = new AONoteCardDropTarget("drop target", target_view->getRect(), AOItemDrop);//, mAvatarID); - addChild(mAOItemDropTarget); - } - if(LLStartUp::getStartupState() == STATE_STARTED) - { - LLUUID itemidimport = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); - LLViewerInventoryItem* itemimport = gInventory.getItem(itemidimport); - if(itemimport) - { - LLStringUtil::format_map_t args; - args["[ITEM]"] = itemimport->getName(); - childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo", args)); - } - else if(itemidimport.isNull()) - { - childSetValue("ao_nc_text", LLTrans::getString("CurrentlyNotSet")); - } - else - { - childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount")); - } - } - else - { - childSetValue("ao_nc_text", LLTrans::getString("NotLoggedIn")); - } childSetAction("more_btn", onClickMore, this); childSetAction("less_btn", onClickLess, this); @@ -793,14 +691,6 @@ void LLFloaterAO::setCurrentStandId(const LLUUID& id) mCurrentStandId = id; } -void LLFloaterAO::AOItemDrop(LLViewerInventoryItem* item) -{ - gSavedPerAccountSettings.setString("AOConfigNotecardID", item->getUUID().asString()); - LLStringUtil::format_map_t args; - args["[ITEM]"] = item->getName(); - sInstance->childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo", args)); -} - LLUUID LLFloaterAO::GetAnimID(const LLUUID& id) { for (std::vector::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) @@ -1383,7 +1273,7 @@ BOOL LLFloaterAO::SetDefault(void* userdata, LLUUID ao_id, std::string defaultan if (sInstance && (userdata)) { LLComboBox *box = (LLComboBox *) userdata; - if (LLUUID::null == ao_id) + if (ao_id.isNull()) { box->clear(); box->removeall(); diff --git a/indra/newview/floaterao.h b/indra/newview/floaterao.h index 72bdf2903..b8a63f0da 100644 --- a/indra/newview/floaterao.h +++ b/indra/newview/floaterao.h @@ -8,8 +8,6 @@ #include "lleventtimer.h" -class AONoteCardDropTarget; - const int STATE_AGENT_IDLE = 0; const int STATE_AGENT_WALK = 1; const int STATE_AGENT_RUN = 2; @@ -113,8 +111,6 @@ private: static int mAnimationState; static LLUUID mCurrentStandId; - static AONoteCardDropTarget* mAOItemDropTarget; - static void AOItemDrop(LLViewerInventoryItem* item); static void onSpinnerCommit(LLUICtrl* ctrl); static void onComboBoxCommit(LLUICtrl* ctrl); static BOOL SetDefault(void *userdata, LLUUID ao_id, std::string defaultanim); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1f46baa7e..88cbb340a 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3862,7 +3862,7 @@ bool LLAgent::teleportCore(bool is_local) // close the map panel so we can see our destination. // we don't close search floater, see EXT-5840. - LLFloaterWorldMap::hide(NULL); + LLFloaterWorldMap::hide(); // hide land floater too - it'll be out of date LLFloaterLand::hideInstance(); diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 2dd2ad5a4..610ce2068 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -40,24 +40,127 @@ #include "llviewerprecompiledheaders.h" #include "lldroptarget.h" -#include "lltooldraganddrop.h" -#include "llinventorymodel.h" -LLDropTarget::LLDropTarget(const std::string& name, const LLRect& rect, const LLUUID& agent_id) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mAgentID(agent_id), - mDownCallback(NULL) +#include "llinventorymodel.h" +#include "llstartup.h" +#include "lltextbox.h" +#include "lltooldraganddrop.h" +#include "lltrans.h" + +static LLRegisterWidget r("drop_target"); + +static std::string currently_set_to(const LLViewerInventoryItem* item) { + LLStringUtil::format_map_t args; + args["[ITEM]"] = item->getName(); + return LLTrans::getString("CurrentlySetTo", args); } -LLDropTarget::LLDropTarget(const std::string& name, const LLRect& rect, void (*callback)(LLViewerInventoryItem*)) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mDownCallback(callback) +LLDropTarget::LLDropTarget(const LLDropTarget::Params& p) +: LLView(p) { + setToolTip(std::string(p.tool_tip)); + + mText = new LLTextBox("drop_text", p.rect, p.label); + addChild(mText); + + setControlName(p.control_name, NULL); + mText->setOrigin(0, 0); + mText->setFollows(FOLLOWS_NONE); + mText->setHAlign(LLFontGL::HCENTER); + mText->setBorderVisible(true); + mText->setBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight")); + + if (p.fill_parent) fillParent(getParent()); } LLDropTarget::~LLDropTarget() { + delete mText; +} + +// static +LLView* LLDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory) +{ + LLDropTarget* target = new LLDropTarget(); + target->initFromXML(node, parent); + return target; +} + +// virtual +void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent) +{ + LLView::initFromXML(node, parent); + + const LLRect& rect = getRect(); + mText->setRect(LLRect(0, rect.getHeight(), rect.getWidth(), 0)); + + if (node->hasAttribute("name")) // Views can't have names, but drop targets can + { + std::string name; + node->getAttributeString("name", name); + setName(name); + } + + if (node->hasAttribute("label")) + { + std::string label; + node->getAttributeString("label", label); + mText->setText(label); + } + + if (node->hasAttribute("fill_parent")) + { + bool fill; + node->getAttribute_bool("fill_parent", fill); + if (fill) fillParent(parent); + } +} + +// virtual +void LLDropTarget::setControlName(const std::string& control_name, LLView* context) +{ + if (control_name.empty()) // The "empty set" + { + mControl = NULL; + return; // This DropTarget never changes text, it isn't tied to a control + } + + std::string text; + if (LLStartUp::getStartupState() != STATE_STARTED) // Too early for PerAccount + { + text = LLTrans::getString("NotLoggedIn"); + } + else + { + mControl = gSavedPerAccountSettings.getControl(control_name); + const LLUUID id(mControl->getValue().asString()); + if (id.isNull()) + text = LLTrans::getString("CurrentlyNotSet"); + else if (LLViewerInventoryItem* item = gInventory.getItem(id)) + text = currently_set_to(item); + else + text = LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount"); + } + + mText->setText(text); +} + +void LLDropTarget::fillParent(const LLView* parent) +{ + if (!parent) return; // No parent to fill + + const std::string& tool_tip = getToolTip(); + if (!tool_tip.empty()) // Don't tool_tip the entire parent + { + mText->setToolTip(tool_tip); + setToolTip(LLStringExplicit("")); + } + + // The following block enlarges the target, but maintains the desired size for the text and border + mText->setRect(getRect()); // mText takes over the old rectangle, since the position will now be relative to the parent's rectangle for the text. + const LLRect& parent_rect = parent->getRect(); + setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0)); } void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) @@ -67,17 +170,23 @@ void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { - if(!getParent()) return false; - if(!mDownCallback) LLToolDragAndDrop::handleGiveDragAndDrop(mAgentID, LLUUID::null, drop, cargo_type, cargo_data, accept); - else + if (mEntityID.isNull()) { - LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; - if (gInventory.getItem(inv_item->getUUID())) + if (LLViewerInventoryItem* inv_item = static_cast(cargo_data)) { *accept = ACCEPT_YES_COPY_SINGLE; - if (drop) mDownCallback(inv_item); + if (drop) + { + mText->setText(currently_set_to(inv_item)); + if (mControl) mControl->setValue(inv_item->getUUID().asString()); + } } - else *accept = ACCEPT_NO; + else + { + *accept = ACCEPT_NO; + } + return true; } - return true; + return getParent() ? LLToolDragAndDrop::handleGiveDragAndDrop(mEntityID, LLUUID::null, drop, cargo_type, cargo_data, accept) : false; } + diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 2dd421239..1a08484ce 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -42,23 +42,44 @@ #include "stdtypes.h" #include "llview.h" -class LLViewerInventoryItem; + class LLDropTarget : public LLView { public: - LLDropTarget(const std::string& name, const LLRect& rect, void (*callback)(LLViewerInventoryItem*)); - LLDropTarget(const std::string& name, const LLRect& rect, const LLUUID& agent_id); + struct Params : public LLInitParam::Block + { + Optional control_name; // Control to change on item drop (Per Account only) + Optional label; // Label for the LLTextBox, used when label doesn't dynamically change on drop + Optional fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas. + Params() + : control_name("control_name", "") + , label("label", "") + , fill_parent("fill_parent", false) + { + changeDefault(mouse_opaque, false); + changeDefault(follows.flags, FOLLOWS_ALL); + } + }; + + LLDropTarget(const Params& p = Params()); ~LLDropTarget(); - void doDrop(EDragAndDropType cargo_type, void* cargo_data); + virtual void doDrop(EDragAndDropType cargo_type, void* cargo_data); // // LLView functionality virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); - void setAgentID(const LLUUID &agent_id){ mAgentID = agent_id;} + static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory); + virtual void initFromXML(LLXMLNodePtr node, LLView* parent); + virtual void setControlName(const std::string& control, LLView* context); + + void fillParent(const LLView* parent); + void setEntityID(const LLUUID& id) { mEntityID = id;} protected: - LLUUID mAgentID; - void (*mDownCallback)(LLViewerInventoryItem*); + LLUUID mEntityID; +private: + LLControlVariable* mControl; + class LLTextBox* mText; }; #endif // LLDROPTARGET_H diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 39c82ab77..388948ad0 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -1186,7 +1186,7 @@ void LLFloaterAvatarList::onClickTrack() if (mTracking && mTrackedAvatar == agent_id) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); mTracking = FALSE; } else @@ -1203,7 +1203,7 @@ void LLFloaterAvatarList::refreshTracker() { if (!mTracking) return; - if (LLTracker::isTracking(NULL)) + if (LLTracker::isTracking()) { if(LLAvatarListEntry* entry = getAvatarEntry(mTrackedAvatar)) { @@ -1215,7 +1215,7 @@ void LLFloaterAvatarList::refreshTracker() } else { // Tracker stopped. - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); mTracking = FALSE; // llinfos << "Tracking stopped." << llendl; } diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 01ed3f0c1..a96dfdffa 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -38,54 +38,32 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterchat.h" -#include "llfloateractivespeakers.h" -#include "llfloaterscriptdebug.h" - -#include "llchat.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" -#include "message.h" - -// project include -#include "llagent.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" -#include "llconsole.h" -#include "llfloaterchatterbox.h" -#include "llfloatermute.h" -#include "llkeyboard.h" -//#include "lllineeditor.h" -#include "llmutelist.h" -//#include "llresizehandle.h" -#include "llchatbar.h" -#include "llstatusbar.h" -#include "llviewertexteditor.h" -#include "llviewergesture.h" // for triggering gestures -#include "llviewermessage.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "lluictrlfactory.h" -#include "llchatbar.h" -#include "lllogchat.h" -#include "lltexteditor.h" -#include "lltextparser.h" -#include "llfloaterhtml.h" -#include "llweb.h" -#include "llstylemap.h" -#include "ascentkeyword.h" // linden library includes #include "llaudioengine.h" -#include "llchat.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "lltextparser.h" +#include "lltrans.h" #include "llwindow.h" -#include "message.h" + +// project include +#include "ascentkeyword.h" +#include "llagent.h" +#include "llchatbar.h" +#include "llconsole.h" +#include "llfloateractivespeakers.h" +#include "llfloaterchatterbox.h" +#include "llfloatermute.h" +#include "llfloaterscriptdebug.h" +#include "lllogchat.h" +#include "llmutelist.h" +#include "llstylemap.h" +#include "lluictrlfactory.h" +#include "llviewermessage.h" +#include "llviewertexteditor.h" +#include "llviewerwindow.h" +#include "llweb.h" // [RLVa:KB] #include "rlvhandler.h" @@ -227,9 +205,9 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& // If the msg is from an agent (not yourself though), // extract out the sender name and replace it with the hotlinked name. if (chat.mSourceType == CHAT_SOURCE_AGENT && -// chat.mFromID != LLUUID::null) +// chat.mFromID.notNull()) // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) - chat.mFromID != LLUUID::null && + chat.mFromID.notNull() && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) // [/RLVa:KB] { @@ -238,20 +216,27 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& if(chat.mSourceType == CHAT_SOURCE_OBJECT && !chat.mFromName.length()) { - chat.mFromName = "(no name)"; + chat.mFromName = LLTrans::getString("Unnamed"); line = chat.mFromName + line; } + + static const LLCachedControl italicize("LiruItalicizeActions"); + bool is_irc = italicize && chat.mChatStyle == CHAT_STYLE_IRC; // If the chat line has an associated url, link it up to the name. if (!chat.mURL.empty() && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) { std::string start_line = line.substr(0, chat.mFromName.length() + 1); line = line.substr(chat.mFromName.length() + 1); - const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); + LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); + sourceStyle->mItalic = is_irc; edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); prepend_newline = false; } - edit->appendColoredText(line, false, prepend_newline, color); + LLStyleSP style(new LLStyle); + style->setColor(color); + style->mItalic = is_irc; + edit->appendStyledText(line, false, prepend_newline, style); } void log_chat_text(const LLChat& chat) diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 832bf6b86..b60aab459 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -300,7 +300,7 @@ void LLFloaterLandHoldings::buttonCore(S32 which) break; case 1: gFloaterWorldMap->trackLocation(pos_global); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); break; default: break; diff --git a/indra/newview/llfloaterteleporthistory.cpp b/indra/newview/llfloaterteleporthistory.cpp index 6f3d06407..bdb089e3c 100644 --- a/indra/newview/llfloaterteleporthistory.cpp +++ b/indra/newview/llfloaterteleporthistory.cpp @@ -353,7 +353,7 @@ void LLFloaterTeleportHistory::onShowOnMap(void* data) // point world map at position gFloaterWorldMap->trackURL(region, x, y, z); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } // static diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index c164d6cf9..fb84ee0c1 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -42,8 +42,6 @@ #include "llagent.h" #include "llagentcamera.h" -#include "llviewerwindow.h" -#include "llwindow.h" #include "llbutton.h" #include "llcallingcard.h" #include "llcolorscheme.h" @@ -57,9 +55,8 @@ #include "llinventorymodelbackgroundfetch.h" #include "llinventoryobserver.h" #include "lllandmarklist.h" -#include "llnotificationsutil.h" #include "lllineeditor.h" -#include "llpreviewlandmark.h" +#include "llnotificationsutil.h" #include "llregionhandle.h" #include "llscrolllistctrl.h" #include "lltextbox.h" @@ -76,10 +73,9 @@ #include "llappviewer.h" #include "llmapimagetype.h" #include "llweb.h" +#include "llwindow.h" // copyTextToClipboard() -#include "llglheaders.h" - // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -104,6 +100,7 @@ struct SortRegionNames return(LLStringUtil::compareInsensitive(_left.second->getName(), _right.second->getName()) < 0); } }; + enum EPanDirection { PAN_UP, @@ -284,7 +281,7 @@ void LLFloaterWorldMap::onClose(bool app_quitting) } // static -void LLFloaterWorldMap::show(void*, BOOL center_on_target) +void LLFloaterWorldMap::show(bool center_on_target) { // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP)) @@ -351,13 +348,13 @@ void LLFloaterWorldMap::reloadIcons(void*) // static -void LLFloaterWorldMap::toggle(void*) +void LLFloaterWorldMap::toggle() { BOOL visible = gFloaterWorldMap->getVisible(); if (!visible) { - show(NULL, FALSE); + show(false); } else { @@ -368,7 +365,7 @@ void LLFloaterWorldMap::toggle(void*) // static -void LLFloaterWorldMap::hide(void*) +void LLFloaterWorldMap::hide() { gFloaterWorldMap->mIsClosing = TRUE; gFloaterWorldMap->close(); @@ -547,7 +544,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& } else { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } setDefaultBtn("Teleport"); } @@ -591,7 +588,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) } else { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } setDefaultBtn("Teleport"); } @@ -618,7 +615,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) { // We haven't found a region for that point yet, leave the tracking to the world map LLWorldMap::getInstance()->setTracking(pos_global); - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); S32 world_x = S32(pos_global.mdV[0] / 256); S32 world_y = S32(pos_global.mdV[1] / 256); LLWorldMapMessage::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true); @@ -635,7 +632,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) // i.e. let the world map that this and tell it it's invalid LLWorldMap::getInstance()->setTracking(pos_global); LLWorldMap::getInstance()->setTrackingInvalid(); - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); setDefaultBtn(""); // clicked on a down region - turn off coord display @@ -774,10 +771,9 @@ void LLFloaterWorldMap::updateLocation() // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) { - LLVector3d agentPos = gAgent.getPositionGlobal(); - S32 x = llround( (F32)fmod( (F32)agentPos[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( (F32)agentPos[VY], (F32)REGION_WIDTH_METERS ) ); - S32 z = llround( (F32)agentPos[VZ] ); + S32 x = llround( (F32)fmod( (F32)coord_pos[VX], (F32)REGION_WIDTH_METERS ) ); + S32 y = llround( (F32)fmod( (F32)coord_pos[VY], (F32)REGION_WIDTH_METERS ) ); + S32 z = llround( (F32)coord_pos[VZ] ); mSLURL = LLURLDispatcher::buildSLURL(sim_name, x, y, z); } else @@ -880,7 +876,7 @@ void LLFloaterWorldMap::friendsChanged() (buddy_info && !buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) || gAgent.isGodlike()) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } } @@ -1100,7 +1096,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdat if( current_choice.isNull() || !list->setCurrentByID( current_choice ) ) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } @@ -1110,7 +1106,7 @@ void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata ) // Reset the tracking whenever we start typing into any of the search fields, // so that hitting does an auto-complete versus teleporting us to the // previously selected landmark/friend. - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } // static @@ -1134,7 +1130,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit() LLUUID asset_id; LLUUID item_id = list->getCurrentID(); - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); //RN: stopTracking() clears current combobox selection, need to reassert it here list->setCurrentByID(item_id); @@ -1190,7 +1186,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata if( !list->setCurrentByID( current_choice ) || current_choice.isNull() ) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } } @@ -1297,7 +1293,7 @@ void LLFloaterWorldMap::onCoordinatesCommit() void LLFloaterWorldMap::onClearBtn() { mTrackedStatus = LLTracker::TRACKING_NOTHING; - LLTracker::stopTracking((void *)(intptr_t)TRUE); + LLTracker::stopTracking(true); LLWorldMap::getInstance()->cancelTracking(); mSLURL = ""; // Clear the SLURL since it's invalid mSetToUserPosition = TRUE; // Revert back to the current user position diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 53cd425b7..47cbb025f 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -63,10 +63,10 @@ public: /*virtual*/ void onClose(bool app_quitting); - static void show(void*, BOOL center_on_target ); + static void show(bool center_on_target); static void reloadIcons(void*); - static void toggle(void*); - static void hide(void*); + static void toggle(); + static void hide(); /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 7c9cd398a..7f6bf3a62 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1123,7 +1123,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( { llwarns << "Other participant is NULL" << llendl; } - + init(session_label); } @@ -1160,7 +1160,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( { llwarns << "Other participant is NULL" << llendl; } - + mSessionInitialTargetIDs = ids; init(session_label); } @@ -1173,9 +1173,9 @@ void LLFloaterIMPanel::init(const std::string& session_label) mSessionLabel = session_label; - // [Ansariel: Display name support] - mProfileButtonEnabled = FALSE; - // [/Ansariel: Display name support] + // [Ansariel: Display name support] + mProfileButtonEnabled = FALSE; + // [/Ansariel: Display name support] static LLCachedControl concise_im("UseConciseIMButtons"); static LLCachedControl concise_group("UseConciseGroupChatButtons"); @@ -1610,25 +1610,25 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol static const LLCachedControl mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false); static const LLCachedControl mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f)); - if (gAgent.getID() != source) + if (gAgentID != source) { if (mKeywordsChangeColor) { - if (AscentKeyword::hasKeyword(utf8msg, 2)) - { + if (AscentKeyword::hasKeyword(utf8msg, 2)) + { incolor = mKeywordsColor; - } + } } } const LLColor4& color = incolor; // start tab flashing when receiving im for background session from user - if (source != LLUUID::null) + if (source.notNull()) { LLMultiFloater* hostp = getHost(); if( !isInVisibleChain() && hostp - && source != gAgent.getID()) + && source != gAgentID) { hostp->setFloaterFlashing(this, TRUE); } @@ -1640,14 +1640,15 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol removeTypingIndicator(NULL); // Actually add the line - std::string timestring; bool prepend_newline = true; if (gSavedSettings.getBOOL("IMShowTimestamps")) { - timestring = mHistoryEditor->appendTime(prepend_newline); + mHistoryEditor->appendTime(prepend_newline); prepend_newline = false; } + std::string show_name = name; + bool is_irc = false; // 'name' is a sender name that we want to hotlink so that clicking on it opens a profile. if (!name.empty()) // If name exists, then add it to the front of the message. { @@ -1658,40 +1659,36 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol } else { - std::string show_name = name; + // IRC style text starts with a colon here; empty names and system messages aren't irc style. + static const LLCachedControl italicize("LiruItalicizeActions"); + is_irc = italicize && utf8msg[0] != ':'; if (source.notNull()) LLAvatarNameCache::getPNSName(source, show_name); // Convert the name to a hotlink and add to message. - const LLStyleSP &source_style = LLStyleMap::instance().lookupAgent(source); + LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source); + source_style->mItalic = is_irc; mHistoryEditor->appendStyledText(show_name,false,prepend_newline,source_style); } prepend_newline = false; } - //Kadah - Bold group mods chat. Doesnt work on the first msg of the session, dont have speakers list yet? - if (gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source)) + // Append the chat message in style { - mHistoryEditor->appendColoredText(utf8msg.substr(0,1), false, prepend_newline, color); LLStyleSP style(new LLStyle); - style->setVisible(true); style->setColor(color); - style->setFontName(LLStringUtil::null); - style->mBold = TRUE; - mHistoryEditor->appendStyledText(utf8msg.substr(1), false, prepend_newline, style); + style->mItalic = is_irc; + style->mBold = gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source); + mHistoryEditor->appendStyledText(utf8msg, false, prepend_newline, style); } - else - { - mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); - } - + if (log_to_file && gSavedPerAccountSettings.getBOOL("LogInstantMessages") ) { std::string histstr; if (gSavedPerAccountSettings.getBOOL("IMLogTimestamp")) - histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + name + utf8msg; + histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + show_name + utf8msg; else - histstr = name + utf8msg; + histstr = show_name + utf8msg; // [Ansariel: Display name support] // Floater title contains display name -> bad idea to use that as filename @@ -1706,7 +1703,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol mNumUnreadMessages++; } - if (source != LLUUID::null) + if (source.notNull()) { mSpeakers->speakerChatted(source); mSpeakers->setSpeakerTyping(source, FALSE); @@ -1722,12 +1719,6 @@ void LLFloaterIMPanel::setVisible(BOOL b) if( b && hostp ) { hostp->setFloaterFlashing(this, FALSE); - - /* Don't change containing floater title - leave it "Instant Message" JC - LLUIString title = sTitleString; - title.setArg("[NAME]", mSessionLabel); - hostp->setTitle( title ); - */ } } @@ -2048,17 +2039,16 @@ void deliver_message(const std::string& utf8_text, bool sent = false; gAgent.buildFullname(name); - const LLRelationship* info = NULL; - info = LLAvatarTracker::instance().getBuddyInfo(other_participant_id); - + const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(other_participant_id); + U8 offline = (!info || info->isOnline()) ? IM_ONLINE : IM_OFFLINE; - + if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id))) { // User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice. sent = gVoiceClient->sendTextMessage(other_participant_id, utf8_text); } - + if(!sent) { // Send message normally. @@ -2127,56 +2117,56 @@ void LLFloaterIMPanel::sendMsg() // store sent line in history, duplicates will get filtered if (mInputEditor) mInputEditor->updateHistory(); // Truncate and convert to UTF8 for transport - std::string utf8text = wstring_to_utf8str(text); + std::string utf8_text = wstring_to_utf8str(text); // Convert MU*s style poses into IRC emotes here. - if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8text.length() > 3 && utf8text[0] == ':') + if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8_text.length() > 3 && utf8_text[0] == ':') { - if (utf8text[1] == '\'') + if (utf8_text[1] == '\'') { - utf8text.replace(0, 1, "/me"); + utf8_text.replace(0, 1, "/me"); } - else if (isalpha(utf8text[1])) // Do not prevent smileys and such. + else if (isalpha(utf8_text[1])) // Do not prevent smileys and such. { - utf8text.replace(0, 1, "/me "); + utf8_text.replace(0, 1, "/me "); } } - if (utf8text.find("/ME'") == 0 || utf8text.find("/ME ") == 0) //Allow CAPSlock /me - utf8text.replace(1, 2, "me"); - std::string prefix = utf8text.substr(0, 4); - if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8text.length() > 1) && !mRPMode) + if (utf8_text.find("/ME'") == 0 || utf8_text.find("/ME ") == 0) //Allow CAPSlock /me + utf8_text.replace(1, 2, "me"); + std::string prefix = utf8_text.substr(0, 4); + if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8_text.length() > 1) && !mRPMode) { //Check if it needs the end-of-chat brackets -HgB - if (utf8text.find("((") == 0 && utf8text.find("))") == std::string::npos) + if (utf8_text.find("((") == 0 && utf8_text.find("))") == std::string::npos) { - if(*utf8text.rbegin() == ')') - utf8text+=" "; - utf8text+="))"; + if(*utf8_text.rbegin() == ')') + utf8_text+=" "; + utf8_text+="))"; } - else if(utf8text.find("[[") == 0 && utf8text.find("]]") == std::string::npos) + else if(utf8_text.find("[[") == 0 && utf8_text.find("]]") == std::string::npos) { - if(*utf8text.rbegin() == ']') - utf8text+=" "; - utf8text+="]]"; + if(*utf8_text.rbegin() == ']') + utf8_text+=" "; + utf8_text+="]]"; } if (prefix != "/me " && prefix != "/me'") //Allow /me to end with )) or ]] { - if (utf8text.find("((") == std::string::npos && utf8text.find("))") == (utf8text.length() - 2)) + if (utf8_text.find("((") == std::string::npos && utf8_text.find("))") == (utf8_text.length() - 2)) { - if(utf8text[0] == '(') - utf8text.insert(0," "); - utf8text.insert(0,"(("); + if(utf8_text[0] == '(') + utf8_text.insert(0," "); + utf8_text.insert(0,"(("); } - else if (utf8text.find("[[") == std::string::npos && utf8text.find("]]") == (utf8text.length() - 2)) + else if (utf8_text.find("[[") == std::string::npos && utf8_text.find("]]") == (utf8_text.length() - 2)) { - if(utf8text[0] == '[') - utf8text.insert(0," "); - utf8text.insert(0,"[["); + if(utf8_text[0] == '[') + utf8_text.insert(0," "); + utf8_text.insert(0,"[["); } } } if (mRPMode && prefix != "/me " && prefix != "/me'") - utf8text = "[[" + utf8text + "]]"; + utf8_text = "[[" + utf8_text + "]]"; // [RLVa:KB] - Checked: 2011-09-17 (RLVa-1.1.4b) | Modified: RLVa-1.1.4b if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) ) { @@ -2203,7 +2193,7 @@ void LLFloaterIMPanel::sendMsg() itSpeaker != speakers.end(); ++itSpeaker) { const LLSpeaker* pSpeaker = *itSpeaker; - if ( (gAgent.getID() != pSpeaker->mID) && (!gRlvHandler.canSendIM(pSpeaker->mID)) ) + if ( (gAgentID != pSpeaker->mID) && (!gRlvHandler.canSendIM(pSpeaker->mID)) ) { fRlvFilter = true; break; @@ -2217,7 +2207,7 @@ void LLFloaterIMPanel::sendMsg() } if (fRlvFilter) - utf8text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); } // [/RLVa:KB] @@ -2226,7 +2216,7 @@ void LLFloaterIMPanel::sendMsg() // Split messages that are too long, same code like in llimpanel.cpp U32 split = MAX_MSG_BUF_SIZE - 1; U32 pos = 0; - U32 total = utf8text.length(); + U32 total = utf8_text.length(); while (pos < total) { @@ -2239,11 +2229,11 @@ void LLFloaterIMPanel::sendMsg() else { // don't split utf-8 bytes - while (U8(utf8text[pos + next_split]) != 0x20 // space - && U8(utf8text[pos + next_split]) != 0x21 // ! - && U8(utf8text[pos + next_split]) != 0x2C // , - && U8(utf8text[pos + next_split]) != 0x2E // . - && U8(utf8text[pos + next_split]) != 0x3F // ? + while (U8(utf8_text[pos + next_split]) != 0x20 // space + && U8(utf8_text[pos + next_split]) != 0x21 // ! + && U8(utf8_text[pos + next_split]) != 0x2C // , + && U8(utf8_text[pos + next_split]) != 0x2E // . + && U8(utf8_text[pos + next_split]) != 0x3F // ? && next_split > 0) { --next_split; @@ -2260,7 +2250,7 @@ void LLFloaterIMPanel::sendMsg() } } - std::string send = utf8text.substr(pos, next_split); + std::string send = utf8_text.substr(pos, next_split); pos += next_split; LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_ENDL; @@ -2274,37 +2264,30 @@ LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_E if((mDialog == IM_NOTHING_SPECIAL) && (mOtherParticipantUUID.notNull())) { - std::string history_echo; - gAgent.buildFullname(history_echo); + std::string name; + gAgent.buildFullname(name); // Look for IRC-style emotes here. - std::string prefix = utf8text.substr(0, 4); + std::string prefix = utf8_text.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { - utf8text.replace(0,3,""); + utf8_text.replace(0,3,""); } else { - history_echo += ": "; - } - history_echo += utf8text; - - BOOL other_was_typing = mOtherTyping; - - addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID()); - - if (other_was_typing) - { - addTypingIndicator(mOtherTypingName); + utf8_text.insert(0, ": "); } + bool other_was_typing = mOtherTyping; + addHistoryLine(utf8_text, gSavedSettings.getColor("UserChatColor"), true, gAgentID, name); + if (other_was_typing) addTypingIndicator(mOtherTypingName); } } else { //queue up the message to send once the session is //initialized - mQueuedMsgsForInit.append(utf8text); + mQueuedMsgsForInit.append(utf8_text); } } @@ -2441,6 +2424,7 @@ void LLFloaterIMPanel::sendTypingState(BOOL typing) gAgent.sendReliableMessage(); } + void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, BOOL typing) { if (typing) @@ -2584,12 +2568,11 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const //only 1 option really LLUUID session_id = notification["payload"]["session_id"]; - if ( gIMMgr ) + if (gIMMgr) { - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession( - session_id); + LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id); - if ( floaterp ) floaterp->close(FALSE); + if (floaterp) floaterp->close(FALSE); } return false; } @@ -2608,29 +2591,20 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id) BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) { - LLView* chat_editor = getChildView("chat_editor"); - if (getVisible() && childIsVisible("chat_editor")) - { - gFocusMgr.setKeyboardFocus(chat_editor); + if (getVisible() && mInputEditor->getVisible()) + { + setInputFocus(true); + return TRUE; + } - LLUICtrl * ctrl = static_cast(chat_editor); - ctrl->setFocus(TRUE); - - return TRUE; - } - - return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash); + return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash); } void LLFloaterIMPanel::onFocusReceived() { - LLView* chat_editor = getChildView("chat_editor"); - if (getVisible() && childIsVisible("chat_editor")) + if (getVisible() && mInputEditor->getVisible()) { - gFocusMgr.setKeyboardFocus(chat_editor); - - LLUICtrl * ctrl = static_cast(chat_editor); - ctrl->setFocus(TRUE); + setInputFocus(true); } LLFloater::onFocusReceived(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 73d45caf2..07ed26011 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1436,7 +1436,7 @@ public: floaterp->processSessionUpdate(body["session_info"]); } - //aply updates we've possibly received previously + //apply updates we've possibly received previously floaterp->updateSpeakersList( gIMMgr->getPendingAgentListUpdates(session_id)); } @@ -1614,8 +1614,9 @@ public: { separator_string = ""; message_offset = 3; + chat.mChatStyle = CHAT_STYLE_IRC; } - + chat.mMuted = is_muted && !is_linden; chat.mFromID = from_id; chat.mFromName = name; @@ -1719,7 +1720,7 @@ public: { return; } - + if(!LLVoiceClient::voiceEnabled()) { // Don't display voice invites unless the user has voice enabled. diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index acc23f599..988496eeb 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -75,7 +75,7 @@ void handle_track_avatar(const LLUUID& agent_id, const std::string& name) LLAvatarTracker::instance().track(agent_id, name); LLFloaterDirectory::hide(NULL); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } void handle_pay_by_id(const LLUUID& agent_id) @@ -92,7 +92,7 @@ void handle_mouselook(void*) void handle_map(void*) { - LLFloaterWorldMap::toggle(NULL); + LLFloaterWorldMap::toggle(); } void handle_mini_map(void*) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 044f5b77e..2d206ee17 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -955,7 +955,7 @@ BOOL LLNetMap::handleDoubleClick( S32 x, S32 y, MASK mask ) { LLVector3d pos_global = viewPosToGlobal(x, y, gSavedSettings.getBOOL( "MiniMapRotate" )); BOOL new_target = FALSE; - if (!LLTracker::isTracking(NULL)) + if (!LLTracker::isTracking()) { gFloaterWorldMap->trackLocation(pos_global); new_target = TRUE; @@ -967,7 +967,7 @@ BOOL LLNetMap::handleDoubleClick( S32 x, S32 y, MASK mask ) } else { - LLFloaterWorldMap::show(NULL, new_target); + LLFloaterWorldMap::show(new_target); } return TRUE; } @@ -1108,14 +1108,14 @@ bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer event, const LLS bool LLNetMap::LLStopTracking::handleEvent(LLPointer event, const LLSD& userdata) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); return true; } bool LLNetMap::LLEnableTracking::handleEvent(LLPointer event, const LLSD& userdata) { LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking(NULL)); + self->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking()); return true; } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 9842691da..4e33aba83 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -70,11 +70,8 @@ #include "llstatusbar.h" #include "lltabcontainer.h" #include "llimview.h" -#include "lltooldraganddrop.h" -#include "lluiconstants.h" #include "llvoavatar.h" #include "llviewercontrol.h" -#include "llviewermenu.h" // *FIX: for is_agent_friend() #include "llviewergenericmessage.h" // send_generic_message #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -82,7 +79,6 @@ #include "llinventorymodel.h" #include "roles_constants.h" #include "lluictrlfactory.h" -#include "llviewermenu.h" #include "llavatarnamecache.h" #include "lldroptarget.h" @@ -105,6 +101,8 @@ BOOL LLPanelAvatar::sAllowFirstLife = FALSE; extern void callback_invite_to_group(LLUUID group_id, void *user_data); extern void handle_lure(const LLUUID& invitee); extern void handle_pay_by_id(const LLUUID& payee); +BOOL is_agent_friend(const LLUUID& agent_id); +BOOL is_agent_mappable(const LLUUID& agent_id); //----------------------------------------------------------------------------- @@ -1434,7 +1432,6 @@ LLPanelAvatar::LLPanelAvatar( mPanelNotes(NULL), mPanelFirstLife(NULL), mPanelWeb(NULL), - mDropTarget(NULL), mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID' mHaveProperties(FALSE), mHaveStatistics(FALSE), @@ -1595,16 +1592,16 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name { if (avatar_id.isNull()) return; - BOOL avatar_changed = FALSE; + //BOOL avatar_changed = FALSE; if (avatar_id != mAvatarID) { - avatar_changed = TRUE; + //avatar_changed = TRUE; if(mAvatarID.notNull()) { LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarID, this); } + mAvatarID = avatar_id; } - mAvatarID = avatar_id; LLAvatarPropertiesProcessor::getInstance()->addObserver(mAvatarID, this); @@ -1628,18 +1625,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name // Teens don't have this. if (mPanelFirstLife) mPanelFirstLife->enableControls(own_avatar && mAllowEdit); - LLView *target_view = getChild("drop_target_rect"); - if(target_view) - { - if (mDropTarget) - { - delete mDropTarget; - } - mDropTarget = new LLDropTarget("drop target", target_view->getRect(), mAvatarID); - addChild(mDropTarget); - mDropTarget->setAgentID(mAvatarID); - } - + getChild("drop_target_rect")->setEntityID(mAvatarID); + LLNameEditor* name_edit = getChild("name"); if(name_edit) { @@ -1726,8 +1713,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name childSetEnabled("Mute",FALSE); childSetVisible("Offer Teleport...",FALSE); childSetEnabled("Offer Teleport...",FALSE); - childSetVisible("drop target",FALSE); - childSetEnabled("drop target",FALSE); childSetVisible("Find on Map",FALSE); childSetEnabled("Find on Map",FALSE); childSetVisible("Add Friend...",FALSE); @@ -1750,8 +1735,6 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name childSetVisible("Mute",TRUE); childSetEnabled("Mute",FALSE); - childSetVisible("drop target",TRUE); - childSetEnabled("drop target",FALSE); childSetVisible("Find on Map",TRUE); // Note: we don't always know online status, so always allow gods to try to track @@ -1914,7 +1897,7 @@ void LLPanelAvatar::onClickTrack(void* userdata) LLNameEditor* nameedit = self->mPanelSecondLife->getChild("name"); if (nameedit) name = nameedit->getText(); gFloaterWorldMap->trackAvatar(self->mAvatarID, name); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } } @@ -2077,8 +2060,6 @@ void LLPanelAvatar::processProperties(void* data, EAvatarProcessorType type) childSetEnabled("Pay...",TRUE); childSetEnabled("Mute",TRUE); - childSetEnabled("drop target",TRUE); - mHaveProperties = TRUE; enableOKIfReady(); diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index f564fe168..805826656 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -373,8 +373,6 @@ public: std::list mAvatarPanelList; - LLDropTarget* mDropTarget; - // Teen users are not allowed to see or enter data into the first life page, // or their own about/interests text entry fields. static BOOL sAllowFirstLife; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 2ec1ac0eb..1ab3933e1 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -886,7 +886,7 @@ void LLPanelClassified::onClickMap(void* data) { LLPanelClassified* self = (LLPanelClassified*)data; gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); self->sendClassifiedClickMessage("map"); } diff --git a/indra/newview/llpanelevent.cpp b/indra/newview/llpanelevent.cpp index 9b453fbeb..ef25b25e9 100644 --- a/indra/newview/llpanelevent.cpp +++ b/indra/newview/llpanelevent.cpp @@ -229,7 +229,7 @@ void LLPanelEvent::onClickMap(void* data) if (!self->mEventInfo.mPosGlobal.isExactlyZero()) { gFloaterWorldMap->trackLocation(self->mEventInfo.mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } } diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 64f48e0c5..2f53e830c 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -248,7 +248,7 @@ void LLPanelGroupLandMoney::impl::onMapButton() LLVector3d pos_global(global_x, global_y, global_z); gFloaterWorldMap->trackLocation(pos_global); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } bool LLPanelGroupLandMoney::impl::applyContribution() diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index ffec84e7d..a69b4c76a 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -66,20 +66,17 @@ const S32 NOTICE_DATE_STRING_SIZE = 30; ///////////////////////// // LLPanelGroupNotices // ///////////////////////// -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLDropTarget -// -// This handy class is a simple way to drop something on another -// view. It handles drop events, always setting itself to the size of -// its parent. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLGroupDropTarget : public LLView + +#include "lldroptarget.h" +class LLGroupDropTarget : public LLDropTarget { public: - LLGroupDropTarget(const std::string& name, const LLRect& rect, LLPanelGroupNotices* panel, const LLUUID& group_id); + LLGroupDropTarget(const LLDropTarget::Params& p = LLDropTarget::Params()); ~LLGroupDropTarget() {}; - void doDrop(EDragAndDropType cargo_type, void* cargo_data); + // + // LLDropTarget functionality + virtual void doDrop(EDragAndDropType cargo_type, void* cargo_data); // // LLView functionality @@ -88,19 +85,26 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); + static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory); + + void setGroupNoticesPanel(LLPanelGroupNotices* panel) { mGroupNoticesPanel = panel; } protected: LLPanelGroupNotices* mGroupNoticesPanel; - LLUUID mGroupID; }; -LLGroupDropTarget::LLGroupDropTarget(const std::string& name, const LLRect& rect, - LLPanelGroupNotices* panel, const LLUUID& group_id) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mGroupNoticesPanel(panel), - mGroupID(group_id) +LLGroupDropTarget::LLGroupDropTarget(const LLDropTarget::Params& p) +: LLDropTarget(p) { } +// static +LLView* LLGroupDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory) +{ + LLGroupDropTarget* target = new LLGroupDropTarget(); + target->initFromXML(node, parent); + return target; +} + void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { llinfos << "LLGroupDropTarget::doDrop()" << llendl; @@ -114,7 +118,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { BOOL handled = FALSE; - if (!gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND)) + if (!gAgent.hasPowerInGroup(mEntityID,GP_NOTICES_SEND)) { *accept = ACCEPT_NO; return TRUE; @@ -172,6 +176,8 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } +static LLRegisterWidget r("group_drop_target"); + //----------------------------------------------------------------------------- // LLPanelGroupNotices //----------------------------------------------------------------------------- @@ -264,17 +270,9 @@ BOOL LLPanelGroupNotices::postBuild() mPanelCreateNotice = getChild("panel_create_new_notice",recurse); mPanelViewNotice = getChild("panel_view_past_notice",recurse); - // Must be in front of all other UI elements. - LLPanel* dtv = getChild("drop_target",recurse); - LLGroupDropTarget* target = new LLGroupDropTarget("drop_target", - dtv->getRect(), - this, mGroupID); - target->setEnabled(TRUE); - target->setToolTip(dtv->getToolTip()); - - mPanelCreateNotice->addChild(target); - mPanelCreateNotice->removeChild(dtv); - delete dtv; + LLGroupDropTarget* group_drop_target = getChild("drop_target",recurse); + group_drop_target->setEntityID(mGroupID); + group_drop_target->setGroupNoticesPanel(this); arrangeNoticeView(VIEW_PAST_NOTICE); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index da0b9a546..f599fc915 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -507,7 +507,7 @@ void LLPanelPick::onClickMap(void* data) { LLPanelPick* self = (LLPanelPick*)data; gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } // static diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index ba12d60a0..80af2ac56 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -384,7 +384,7 @@ void LLPanelPlace::onClickMap(void* data) if (!self->mPosGlobal.isExactlyZero()) { gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); } } diff --git a/indra/newview/llprefsim.cpp b/indra/newview/llprefsim.cpp index 8aed046ca..2f7faca75 100644 --- a/indra/newview/llprefsim.cpp +++ b/indra/newview/llprefsim.cpp @@ -114,15 +114,12 @@ BOOL LLPrefsIMImpl::postBuild() childDisable("log_chat"); childDisable("log_show_history"); //childDisable("log_path_button"); - childDisable("busy_response"); childDisable("log_instant_messages_timestamp"); childDisable("log_chat_timestamp"); childDisable("log_chat_IM"); childDisable("log_date_timestamp"); childDisable("logfile_name_datestamp"); - childSetText("busy_response", getString("log_in_to_change")); - childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole")); childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); @@ -147,7 +144,6 @@ BOOL LLPrefsIMImpl::postBuild() void LLPrefsIMImpl::enableHistory() { - if (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean()) { childEnable("log_show_history"); @@ -162,18 +158,8 @@ void LLPrefsIMImpl::enableHistory() void LLPrefsIMImpl::apply() { - LLTextEditor* busy = getChild("busy_response"); - LLWString busy_response; - if (busy) busy_response = busy->getWText(); - LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); - LLWStringUtil::replaceChar(busy_response, '\n', '^'); - LLWStringUtil::replaceChar(busy_response, ' ', '%'); - if(mGotPersonalInfo) { - - gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response))); - gSavedSettings.setBOOL("IMInChatConsole", childGetValue("include_im_in_chat_console").asBoolean()); gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean()); gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean()); @@ -272,24 +258,11 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e childSetValue("send_im_to_email", im_via_email); childEnable("log_instant_messages"); childEnable("log_chat"); - childEnable("busy_response"); childEnable("log_instant_messages_timestamp"); childEnable("log_chat_timestamp"); childEnable("log_chat_IM"); childEnable("log_date_timestamp"); childEnable("logfile_name_datestamp"); - - //RN: get wide string so replace char can work (requires fixed-width encoding) - LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") ); - LLWStringUtil::replaceChar(busy_response, '^', '\n'); - LLWStringUtil::replaceChar(busy_response, '%', ' '); - childSetText("busy_response", wstring_to_utf8str(busy_response)); -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) - if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) - { - childDisable("busy_response"); - } -// [/RLVa:KB] enableHistory(); diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index a34b4b83f..a0c64505e 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -33,10 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llstylemap.h" -#include "llstring.h" -#include "llui.h" -#include "llviewercontrol.h" -#include "llagent.h" LLStyleMap::LLStyleMap() { @@ -60,19 +56,12 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) if (find(source) == end()) { LLStyleSP style(new LLStyle); - style->setVisible(true); - style->setFontName(LLStringUtil::null); - if (source != LLUUID::null && source != gAgent.getID() ) + if (source.notNull()) { style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); style->setLinkHREF(link); } - else - { - // Make the resident's own name white and don't make the name clickable. - style->setColor(LLColor4::white); - } (*this)[source] = style; } return (*this)[source]; @@ -86,9 +75,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link) if (iter == end()) { LLStyleSP style(new LLStyle); - style->setVisible(true); - style->setFontName(LLStringUtil::null); - if (id != LLUUID::null && !link.empty()) + if (id.notNull() && !link.empty()) { style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); style->setLinkHREF(link); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 326232fb7..24dc16383 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -111,9 +111,8 @@ LLTracker::~LLTracker() // static -void LLTracker::stopTracking(void* userdata) +void LLTracker::stopTracking(bool clear_ui) { - BOOL clear_ui = ((BOOL)(intptr_t)userdata); instance()->stopTrackingAll(clear_ui); } diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h index c727c29d5..f7009ae20 100644 --- a/indra/newview/lltracker.h +++ b/indra/newview/lltracker.h @@ -81,8 +81,8 @@ public: // these are static so that they can be used a callbacks static ETrackingStatus getTrackingStatus() { return instance()->mTrackingStatus; } static ETrackingLocationType getTrackedLocationType() { return instance()->mTrackingLocationType; } - static BOOL isTracking(void*) { return instance()->mTrackingStatus != TRACKING_NOTHING; } - static void stopTracking(void*); + static BOOL isTracking() { return instance()->mTrackingStatus != TRACKING_NOTHING; } + static void stopTracking(bool); static void clearFocus(); static const LLUUID& getTrackedLandmarkAssetID() { return instance()->mTrackedLandmarkAssetID; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3c2d15ad1..d84e373f8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6478,7 +6478,7 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "world map") { - LLFloaterWorldMap::toggle(NULL); + LLFloaterWorldMap::toggle(); } else if (floater_name == "mini map") { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 8e879452e..7d3167fb3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -31,6 +31,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewermessage.h" +#include #include #include "llanimationstates.h" @@ -1949,6 +1950,28 @@ void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string m } +// Replace wild cards in autoresponse messages +std::string replace_wildcards(std::string autoresponse, const LLUUID& id, const std::string& name) +{ + // Add in their legacy name + boost::algorithm::replace_all(autoresponse, "#n", name); + + // Add in our location's slurl + boost::algorithm::replace_all(autoresponse, "#r", gAgent.getSLURL()); + + // Add in their display name + LLAvatarName av_name; + boost::algorithm::replace_all(autoresponse, "#d", LLAvatarNameCache::get(id, &av_name) ? av_name.mDisplayName : name); + + if (!isAgentAvatarValid()) return autoresponse; + // Add in idle time + LLStringUtil::format_map_t args; + args["[MINS]"] = boost::lexical_cast(gAgentAvatarp->mIdleTimer.getElapsedTimeF32()/60); + boost::algorithm::replace_all(autoresponse, "#i", LLTrans::getString("IM_autoresponse_minutes", args)); + + return autoresponse; +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2018,11 +2041,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; // NaCl End - // make sure that we don't have an empty or all-whitespace name + // make sure that we don't have an empty or all-whitespace name LLStringUtil::trim(name); if (name.empty()) { - name = LLTrans::getString("Unnamed"); + name = LLTrans::getString("Unnamed"); } // Preserve the unaltered name for use in group notice mute checking. @@ -2032,7 +2055,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) name = clean_name_from_im(name, dialog); // - llinfos << "RegionID: " << region_id.asString() << llendl; + if (region_id.notNull()) + llinfos << "RegionID: " << region_id.asString() << llendl; // BOOL is_busy = gAgent.getBusy(); @@ -2042,7 +2066,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; - BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); + BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("InstantMessagesFriendsOnly"); LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id); @@ -2066,238 +2090,24 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) std::string separator_string(": "); int message_offset = 0; - //Handle IRC styled /me messages. + //Handle IRC styled /me messages. std::string prefix = message.substr(0, 4); if (prefix == "/me " || prefix == "/me'") { + chat.mChatStyle = CHAT_STYLE_IRC; separator_string = ""; message_offset = 3; } - if( dialog == IM_TYPING_START - || dialog == IM_NOTHING_SPECIAL - || dialog == IM_TYPING_STOP - || dialog == IM_BUSY_AUTO_RESPONSE) - { - if(session_id != computed_session_id) - { - session_id = computed_session_id; - } - } - bool typing_init = false; - if( dialog == IM_TYPING_START && !is_muted ) - { - if(!gIMMgr->hasSession(computed_session_id) && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) - { - typing_init = true; - gIMMgr->addMessage( - computed_session_id, - from_id, - name, - llformat("%s ",name.c_str()) + LLTrans::getString("IM_announce_incoming"), - name, - IM_NOTHING_SPECIAL, - parent_estate_id, - region_id, - position, - false); - } - } - - bool is_auto_response = false; - if(dialog == IM_NOTHING_SPECIAL) { - // detect auto responses from GreenLife and compatible viewers - is_auto_response = ( message.substr(0, 21) == "/me (auto-response): " ); - } - - bool do_auto_response = false; - if( gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseAnyone" ) ) - do_auto_response = true; - - // odd name for auto respond to non-friends - if( gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseFriends") && - LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL ) - do_auto_response = true; - - if( is_muted ) - do_auto_response = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseMuted"); - - if( offline != IM_ONLINE ) - do_auto_response = false; - - if( is_auto_response ) - do_auto_response = false; - - // handle cases where IM_NOTHING_SPECIAL is not an IM - if( name == SYSTEM_FROM || - from_id.isNull() || - to_id.isNull() ) - do_auto_response = false; - -// if( do_auto_response ) -// [RLVa:KB] - Alternate: Phoenix-370 - // Phoenix specific: auto-response should be blocked if the avie is RLV @sendim=n restricted and the recipient is not an exception - if ( (do_auto_response) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, from_id)) ) ) -// [/RLVa:KB] - { - if((dialog == IM_NOTHING_SPECIAL && !is_auto_response) || - (dialog == IM_TYPING_START && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) - ) - { - BOOL has = gIMMgr->hasSession(computed_session_id); - if(!has || gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat") || typing_init) - { - BOOL show = !gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowResponded"); - if(!has && show) - { - gIMMgr->addSession(name, IM_NOTHING_SPECIAL, from_id); - } - if(show) - { - gIMMgr->addMessage( - computed_session_id, - from_id, - SYSTEM_FROM, - LLTrans::getString("IM_autoresponded_to") + llformat(" %s.",name.c_str()), - LLStringUtil::null, - IM_NOTHING_SPECIAL, - parent_estate_id, - region_id, - position, - false); - } - std::string my_name; - gAgent.buildFullname(my_name); - - //<-- Personalized Autoresponse by Madgeek - std::string autoresponse = gSavedPerAccountSettings.getText("AscentInstantMessageResponse"); - //Define Wildcards - std::string fname_wildcard = "#f"; - std::string lname_wildcard = "#l"; - std::string time_wildcard = "#t"; - std::string region_wildcard = "#r"; - std::string idle_wildcard = "#i"; - //Extract Name - std::string f_name, l_name; - std::istringstream inname(name); - inname >> f_name >> l_name; - //Generate a Timestamp - time_t rawtime; - time(&rawtime); - char * timestamp_chars; - timestamp_chars = asctime(localtime(&rawtime)); - std::string timestamp; - timestamp.assign(timestamp_chars); - timestamp = timestamp.substr(0, timestamp.find('\n')); - //Generate slurl - std::string slrul = gAgent.getSLURL(); - //Generate idle time - LLVOAvatar* myavatar = gAgentAvatarp; - std::string idle_time = ""; - if(myavatar)idle_time = llformat("%d mins", (U8)(myavatar->mIdleTimer.getElapsedTimeF32()/60.)); - - //Handle Replacements - size_t found = autoresponse.find(fname_wildcard); - while(found != std::string::npos) - { - autoresponse.replace(found, 2, f_name); - found = autoresponse.find(fname_wildcard); - } - found = autoresponse.find(lname_wildcard); - while(found != std::string::npos) - { - autoresponse.replace(found, 2, l_name); - found = autoresponse.find(lname_wildcard); - } - found = autoresponse.find(time_wildcard); - while(found != std::string::npos) - { - autoresponse.replace(found, 2, timestamp); - found = autoresponse.find(time_wildcard); - } - found = autoresponse.find(region_wildcard); - while(found != std::string::npos) - { - autoresponse.replace(found, 2, slrul); - found = autoresponse.find(region_wildcard); - } - found = autoresponse.find(idle_wildcard); - while(found != std::string::npos) - { - autoresponse.replace(found, 2, idle_time); - found = autoresponse.find(idle_wildcard); - } - //--> Personalized Autoresponse - - if(gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat") && has && !typing_init) { - // send as busy auto response instead to prevent endless repeating replies - // when other end is a bot or broken client that answers to every usual IM - // reasoning for this decision can be found in RFC2812 3.3.2 Notices - // where PRIVMSG can be seen as IM_NOTHING_SPECIAL and NOTICE can be seen as - // IM_BUSY_AUTO_RESPONSE. The assumption here is that no existing client - // responds to IM_BUSY_AUTO_RESPONSE. --TS - std::string response = autoresponse; - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - from_id, - my_name, - response, - IM_OFFLINE, - IM_BUSY_AUTO_RESPONSE, - session_id); - } else { - std::string response = "/me (auto-response): "+autoresponse; - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - from_id, - my_name, - response, - IM_OFFLINE, - IM_NOTHING_SPECIAL, - session_id); - } - gAgent.sendReliableMessage(); - if(gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseItem") && (!has || typing_init)) - { - LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("AscentInstantMessageResponseItemData"); - LLViewerInventoryItem* item = gInventory.getItem(itemid); - if(item) - { - //childSetValue("im_give_disp_rect_txt","Currently set to: "+item->getName()); - if(show) - { - gIMMgr->addMessage( - computed_session_id, - from_id, - SYSTEM_FROM, - llformat("%s %s \"%s\"",name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str()), - LLStringUtil::null, - IM_NOTHING_SPECIAL, - parent_estate_id, - region_id, - position, - false); - } - LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); - } - } - } - } - } + // These bools are here because they would make mess of logic down below in IM_NOTHING_SPECIAL. + bool is_autorespond = !is_muted && (is_friend || !gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneFriendsOnly")) && gSavedPerAccountSettings.getBOOL("AutoresponseAnyone"); + bool is_autorespond_muted = is_muted && gSavedPerAccountSettings.getBOOL("AutoresponseMuted"); + bool is_autorespond_nonfriends = !is_friend && !is_muted && gSavedPerAccountSettings.getBOOL("AutoresponseNonFriends"); LLSD args; switch(dialog) { case IM_CONSOLE_AND_CHAT_HISTORY: - // These are used for system messages, hence don't need the name, - // as it is always "Second Life". - // *TODO:translate args["MESSAGE"] = message; // Note: don't put the message in the IM history, even though was sent @@ -2305,7 +2115,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLNotificationsUtil::add("SystemMessageTip",args); break; - case IM_NOTHING_SPECIAL: + case IM_NOTHING_SPECIAL: // Don't show dialog, just do IM if (!gAgent.isGodlike() && gAgent.getRegion()->isPrelude() @@ -2326,37 +2136,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [/RLVa:KB] // else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) // [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && (gRlvHandler.canReceiveIM(from_id)) ) + else if (offline == IM_ONLINE && !is_linden && (is_busy || is_autorespond || is_autorespond_nonfriends || is_autorespond_muted) && name != SYSTEM_FROM && gRlvHandler.canReceiveIM(from_id)) // [/RLVa:KB] { - // return a standard "busy" message, but only do it to online IM - // (i.e. not other auto responses and not store-and-forward IM) - if (!gIMMgr->hasSession(session_id)) - { - // if there is not a panel for this conversation (i.e. it is a new IM conversation - // initiated by the other party) then... - std::string my_name; - LLAgentUI::buildFullname(my_name); - std::string response = gSavedPerAccountSettings.getText("BusyModeResponse"); - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - from_id, - my_name, - response, - IM_ONLINE, - IM_BUSY_AUTO_RESPONSE, - session_id); - gAgent.sendReliableMessage(); - } - // now store incoming IM in chat history buffer = separator_string + message.substr(message_offset); LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + bool send_autoresponse = !gIMMgr->hasSession(session_id) || gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat"); // add to IM panel, but do not bother the user gIMMgr->addMessage( @@ -2374,6 +2162,76 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // pretend this is chat generated by self, so it does not show up on screen chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset); LLFloaterChat::addChat( chat, TRUE, TRUE ); + + // return a standard "busy" message, but only do it to online IM + // (i.e. not other auto responses and not store-and-forward IM) + if (send_autoresponse) + { + // if there is not a panel for this conversation (i.e. it is a new IM conversation + // initiated by the other party) then... + std::string my_name; + LLAgentUI::buildFullname(my_name); + std::string response; + bool show_autoresponded = false; + LLUUID itemid; + if (is_muted) + { + response = gSavedPerAccountSettings.getString("AutoresponseMutedMessage"); + if (gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")); + // We don't show that we've responded to mutes + } + else if (is_busy) + { + response = gSavedPerAccountSettings.getString("BusyModeResponse"); + if (gSavedPerAccountSettings.getBOOL("BusyModeResponseItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("BusyModeResponseItemID")); + show_autoresponded = gSavedPerAccountSettings.getBOOL("BusyModeResponseShow"); + } + else if (is_autorespond_nonfriends) + { + response = gSavedPerAccountSettings.getString("AutoresponseNonFriendsMessage"); + if (gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseNonFriendsItemID")); + show_autoresponded = gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsShow"); + } + else if (is_autorespond) + { + response = gSavedPerAccountSettings.getString("AutoresponseAnyoneMessage"); + if (gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseAnyoneItemID")); + show_autoresponded = gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneShow"); + } + pack_instant_message( + gMessageSystem, + gAgentID, + FALSE, + gAgent.getSessionID(), + from_id, + my_name, + replace_wildcards(response, from_id, name), + IM_ONLINE, + IM_BUSY_AUTO_RESPONSE, + session_id); + gAgent.sendReliableMessage(); + + std::string pns_name; + if (!LLAvatarNameCache::getPNSName(from_id, pns_name)) pns_name = name; + if (show_autoresponded) + { + gIMMgr->addMessage(session_id, from_id, LLStringUtil::null, LLTrans::getString("IM_autoresponded_to") + " " + pns_name); + } + if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) + { + LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); + if (show_autoresponded) + { + gIMMgr->addMessage(computed_session_id, from_id, LLStringUtil::null, + llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + } + } + } + // We stored the incoming IM in history before autoresponding, logically. } else if (from_id.isNull()) { @@ -2446,9 +2304,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) position, true); chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset); - - BOOL local_agent = FALSE; - LLFloaterChat::addChat( chat, TRUE, local_agent ); + LLFloaterChat::addChat(chat, true, false); } else { @@ -2456,14 +2312,94 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // history. Pretend the chat is from a local agent, // so it will go into the history but not be shown on screen. chat.mText = buffer; - BOOL local_agent = TRUE; - LLFloaterChat::addChat( chat, TRUE, local_agent ); + LLFloaterChat::addChat(chat, true, true); + + // Autoresponse to muted avatars + if (gSavedPerAccountSettings.getBOOL("AutoresponseMuted")) + { + std::string my_name; + LLAgentUI::buildFullname(my_name); + pack_instant_message( + gMessageSystem, + gAgentID, + FALSE, + gAgent.getSessionID(), + from_id, + my_name, + replace_wildcards(gSavedPerAccountSettings.getString("AutoresponseMutedMessage"), from_id, name), + IM_ONLINE, + IM_BUSY_AUTO_RESPONSE, + session_id); + gAgent.sendReliableMessage(); + if (gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem")) + if (LLViewerInventoryItem* item = gInventory.getItem(static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")))) + LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); + } } } break; case IM_TYPING_START: { + // Don't announce that someone has started messaging, if they're muted or when in busy mode + if (!is_muted && (!accept_im_from_only_friend || is_friend) && !is_busy && !gIMMgr->hasSession(computed_session_id) && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) + { + std::string pns_name; + if (!LLAvatarNameCache::getPNSName(from_id, pns_name)) pns_name = name; + + gIMMgr->addMessage( + computed_session_id, + from_id, + name, + llformat("%s ", pns_name.c_str()) + LLTrans::getString("IM_announce_incoming"), + name, + IM_NOTHING_SPECIAL, + parent_estate_id, + region_id, + position, + false); + + // This block is very similar to the one above, but is necessary, since a session is opened to announce incoming message.. + // In order to prevent doubling up on the first response, We neglect to send this if Repeat for each message is on. + if ((is_autorespond_nonfriends || is_autorespond) && !gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat")) + { + std::string my_name; + LLAgentUI::buildFullname(my_name); + std::string response; + bool show_autoresponded = false; + LLUUID itemid; + if (is_autorespond_nonfriends) + { + response = gSavedPerAccountSettings.getString("AutoresponseNonFriendsMessage"); + if (gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseNonFriendsItemID")); + show_autoresponded = gSavedPerAccountSettings.getBOOL("AutoresponseNonFriendsShow"); + } + else if (is_autorespond) + { + response = gSavedPerAccountSettings.getString("AutoresponseAnyoneMessage"); + if (gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneItem")) + itemid = static_cast(gSavedPerAccountSettings.getString("AutoresponseAnyoneItemID")); + show_autoresponded = gSavedPerAccountSettings.getBOOL("AutoresponseAnyoneShow"); + } + pack_instant_message(gMessageSystem, gAgentID, false, gAgentSessionID, from_id, my_name, replace_wildcards(response, from_id, name), IM_ONLINE, IM_BUSY_AUTO_RESPONSE, session_id); + gAgent.sendReliableMessage(); + + if (show_autoresponded) + { + gIMMgr->addMessage(session_id, from_id, LLStringUtil::null, LLTrans::getString("IM_autoresponded_to") + " " + pns_name); + } + if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) + { + LLGiveInventory::doGiveInventoryItem(from_id, item, computed_session_id); + if (show_autoresponded) + { + gIMMgr->addMessage(computed_session_id, from_id, LLStringUtil::null, + llformat("%s %s \"%s\"", pns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + } + } + } + } LLPointer im_info = new LLIMInfo(gMessageSystem); gIMMgr->processIMTypingStart(im_info); } @@ -2681,6 +2617,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; + info->mFromObject = FALSE; // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) ) @@ -2689,7 +2626,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } // [/RLVa:KB] } - else + else // IM_TASK_INVENTORY_OFFERED { if (sizeof(S8) != binary_bucket_size) { @@ -2699,6 +2636,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } info->mType = (LLAssetType::EType) binary_bucket[0]; info->mObjectID = LLUUID::null; + info->mFromObject = TRUE; } info->mIM = dialog; @@ -2707,7 +2645,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mTransactionID = session_id; info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType)); - info->mFromObject = (dialog == IM_TASK_INVENTORY_OFFERED); info->mFromName = name; info->mDesc = message; info->mHost = msg->getSender(); @@ -2912,7 +2849,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mText = name + separator_string + message.substr(message_offset); // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because - // IMs from objcts don't open IM sessions. + // IMs from objects don't open IM sessions. LLFloaterChat::addChat(chat, FALSE, FALSE); } break; @@ -2980,7 +2917,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { -// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c if (rlv_handler_t::isEnabled()) { if (!gRlvHandler.canTeleportViaLure(from_id)) @@ -3451,10 +3388,10 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLViewerObject* chatter; msg->getString("ChatData", "FromName", from_name); - if (from_name.empty()) - { - from_name = "(no name)"; - } + if (from_name.empty()) + { + from_name = LLTrans::getString("Unnamed"); + } msg->getUUID("ChatData", "SourceID", from_id); chat.mFromID = from_id; @@ -3526,8 +3463,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // if (chatter) { - LLSD args; - args["NAME"] = from_name; chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) @@ -3617,7 +3552,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } } // NaCl End - + static std::map sChatObjectAuth; if ((source_temp == CHAT_SOURCE_OBJECT) && (type_temp == CHAT_TYPE_OWNER) && @@ -3784,23 +3719,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) return; } - // We have a real utterance now, so can stop showing "..." and proceed. - if (chatter && chatter->isAvatar()) - { - LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); - ((LLVOAvatar*)chatter)->stopTyping(); - - if (!is_muted && !is_busy) - { - static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); - visible_in_chat_bubble = use_chat_bubbles; - ((LLVOAvatar*)chatter)->addChat(chat); - } - } - // Look for IRC-style emotes if (ircstyle) { + // set CHAT_STYLE_IRC to avoid adding Avatar Name as author of message. See EXT-656 + chat.mChatStyle = CHAT_STYLE_IRC; + // Do nothing, ircstyle is fixed above for chat bubbles } else @@ -3852,7 +3776,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } } - RlvForceWear::instance().done(); + if (RlvForceWear::instanceExists()) + RlvForceWear::instance().done(); if ( (!RlvSettings::getDebug()) || ((strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty())) ) return; @@ -3925,7 +3850,21 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mText = from_name + verb + mesg; } - + + // We have a real utterance now, so can stop showing "..." and proceed. + if (chatter && chatter->isAvatar()) + { + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); + ((LLVOAvatar*)chatter)->stopTyping(); + + if (!is_muted && !is_busy) + { + static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); + visible_in_chat_bubble = use_chat_bubbles; + ((LLVOAvatar*)chatter)->addChat(chat); + } + } + if (chatter) { chat.mPosAgent = chatter->getPositionAgent(); @@ -4385,24 +4324,31 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } } - if ( LLTracker::isTracking(NULL) ) + if (LLTracker::isTracking()) { // Check distance to beacon, if < 5m, remove beacon LLVector3d beacon_pos = LLTracker::getTrackedPositionGlobal(); LLVector3 beacon_dir(agent_pos.mV[VX] - (F32)fmod(beacon_pos.mdV[VX], 256.0), agent_pos.mV[VY] - (F32)fmod(beacon_pos.mdV[VY], 256.0), 0); if (beacon_dir.magVecSquared() < 25.f) { - LLTracker::stopTracking(NULL); + LLTracker::stopTracking(false); } - else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() ) + else if (is_teleport) { - //look at the beacon - LLVector3 global_agent_pos = agent_pos; - global_agent_pos[0] += x; - global_agent_pos[1] += y; - look_at = (LLVector3)beacon_pos - global_agent_pos; - look_at.normVec(); - gAgentCamera.slamLookAt(look_at); + if (!gAgent.getTeleportKeepsLookAt()) + { + //look at the beacon + LLVector3 global_agent_pos = agent_pos; + global_agent_pos[0] += x; + global_agent_pos[1] += y; + look_at = (LLVector3)beacon_pos - global_agent_pos; + look_at.normVec(); + gAgentCamera.slamLookAt(look_at); + } + if (gSavedSettings.getBOOL("ClearBeaconAfterTeleport")) + { + LLTracker::stopTracking(false); + } } } @@ -7716,7 +7662,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) msg->getVector3("Data", "LookAt", look_at); gFloaterWorldMap->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::show(true); // remove above two lines and replace with below line // to re-enable parcel browser for llMapDestination() diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 9f06fbbcc..1bfb9f360 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -2072,7 +2072,7 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) { // While we're waiting for data from the tracker, we're busy. JC LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); - if (LLTracker::isTracking(NULL) + if (LLTracker::isTracking() && pos_global.isExactlyZero()) { gViewerWindow->setCursor( UI_CURSOR_WAIT ); diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index e50c0c054..8ade9762c 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -277,7 +277,7 @@ void RlvUIEnabler::onToggleShowWorldMap() // Simulate clicking the Map button [see LLToolBar::onClickMap()] if ((!fEnable) && gFloaterWorldMap->getVisible()) - LLFloaterWorldMap::toggle(NULL); + LLFloaterWorldMap::toggle(); } // Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a diff --git a/indra/newview/skins/default/xui/en-us/floater_ao.xml b/indra/newview/skins/default/xui/en-us/floater_ao.xml index 28d6d9178..f07a992a1 100644 --- a/indra/newview/skins/default/xui/en-us/floater_ao.xml +++ b/indra/newview/skins/default/xui/en-us/floater_ao.xml @@ -10,35 +10,14 @@ width="610" height="380"> - - - - Drop a ZHAO II notecard here - - - - Currently set to: ITEM - +