diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llavataractions.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 15 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 4 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 133 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_incoming_call.xml | 58 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_participant_view.xml | 5 |
8 files changed, 154 insertions, 117 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 4f57498506..f5d8998ce5 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -180,7 +180,7 @@ void LLAvatarActions::offerTeleport(const uuid_vec_t& ids) static void on_avatar_name_cache_start_im(const LLUUID& agent_id, const LLAvatarName& av_name) { - std::string name = av_name.getCompleteName(); + std::string name = av_name.mDisplayName; LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id); if (session_id != LLUUID::null) { diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f93f741b3f..bcc7e77116 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1022,16 +1022,21 @@ void LLFloaterIMContainer::doToSelectedGroup(const LLSD& userdata) bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) { - std::string item = userdata.asString(); + const std::string& item = userdata.asString(); uuid_vec_t uuids; getParticipantUUIDs(uuids); - if(item == std::string("can_activate_group")) + if("can_activate_group" == item) { LLUUID selected_group_id = getCurSelectedViewModelItem()->getUUID(); return gAgent.getGroupID() != selected_group_id; } + if("conversation_log" == item) + { + return gSavedSettings.getBOOL("KeepConversationLogTranscripts"); + } + if(uuids.size() <= 0) { return false; @@ -1040,12 +1045,12 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) // Note: can_block and can_delete is used only for one person selected menu // so we don't need to go over all uuids. - if (item == std::string("can_block")) + if ("can_block" == item) { const LLUUID& id = uuids.front(); return LLAvatarActions::canBlock(id); } - else if (item == std::string("can_add")) + else if ("can_add" == item) { // We can add friends if: // - there are selected people @@ -1074,7 +1079,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) return result; } - else if (item == std::string("can_delete")) + else if ("can_delete" == item) { // We can remove friends if: // - there are selected people @@ -1097,18 +1102,18 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) return result; } - else if (item == std::string("can_call")) + else if ("can_call" == item) { return LLAvatarActions::canCall(); } - else if (item == std::string("can_show_on_map")) + else if ("can_show_on_map" == item) { const LLUUID& id = uuids.front(); return (LLAvatarTracker::instance().isBuddyOnline(id) && is_agent_mappable(id)) || gAgent.isGodlike(); } - else if(item == std::string("can_offer_teleport")) + else if("can_offer_teleport" == item) { return LLAvatarActions::canOfferTeleport(uuids); } @@ -1117,7 +1122,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) return enableModerateContextMenuItem(item); } - return false; + return false; } bool LLFloaterIMContainer::checkContextMenuItem(const LLSD& userdata) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 9795df78ae..0057ed3231 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -335,14 +335,6 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD &args) if (im_box) { im_box->setTimeNow(mSessionID,chat.mFromID); - - // TODO: Warning! The next two lines of code are included below only temporarily - // to demonstrate the correct format call the appropriate functions. - // They should be moved to the right places when working on CHUI-486. ~Alex ProductEngine. - // ---- start demo ---- - // im_box->flashConversationItemWidget(mSessionID, true); // flashing of the conversation's item - // gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat" - // ---- end demo ----- } @@ -504,8 +496,11 @@ void LLFloaterIMSessionTab::refreshConversation() } mConversationViewModel.requestSortAll(); - mConversationsRoot->arrangeAll(); - mConversationsRoot->update(); + if(mConversationsRoot != NULL) + { + mConversationsRoot->arrangeAll(); + mConversationsRoot->update(); + } updateHeaderAndToolbar(); refresh(); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ffd59ba8b6..2c3f460701 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -443,6 +443,12 @@ BOOL LLFloaterPreference::postBuild() getChild<LLComboBox>("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); + getChild<LLComboBox>("FriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"FriendIMOptions")); + getChild<LLComboBox>("NonFriendIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NonFriendIMOptions")); + getChild<LLComboBox>("ConferenceIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ConferenceIMOptions")); + getChild<LLComboBox>("GroupChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"GroupChatOptions")); + getChild<LLComboBox>("NearbyChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NearbyChatOptions")); + // if floater is opened before login set default localized do not disturb message if (LLStartUp::getStartupState() < STATE_STARTED) { @@ -690,6 +696,14 @@ void LLFloaterPreference::onOpen(const LLSD& key) // while preferences floater was closed. buildPopupLists(); + + //get the options that were checked + onNotificationsChange("FriendIMOptions"); + onNotificationsChange("NonFriendIMOptions"); + onNotificationsChange("ConferenceIMOptions"); + onNotificationsChange("GroupChatOptions"); + onNotificationsChange("NearbyChatOptions"); + LLPanelLogin::setAlwaysRefresh(true); refresh(); @@ -863,6 +877,23 @@ void LLFloaterPreference::onLanguageChange() } } +void LLFloaterPreference::onNotificationsChange(const std::string& OptionName) +{ + mNotificationOptions[OptionName] = getChild<LLComboBox>(OptionName)->getSelectedItemLabel(); + + bool show_notifications_alert = true; + for (notifications_map::iterator it_notification = mNotificationOptions.begin(); it_notification != mNotificationOptions.end(); it_notification++) + { + if(it_notification->second != "None") + { + show_notifications_alert = false; + break; + } + } + + getChild<LLTextBox>("notifications_alert")->setVisible(show_notifications_alert); +} + void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue) { LLColorSwatchCtrl* color_swatch = findChild<LLColorSwatchCtrl>("background"); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 4c1c122fb1..37a531e99e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -45,6 +45,8 @@ class LLSliderCtrl; class LLSD; class LLTextBox; +typedef std::map<std::string, std::string> notifications_map; + typedef enum { GS_LOW_GRAPHICS, @@ -93,6 +95,7 @@ protected: void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above void onLanguageChange(); + void onNotificationsChange(const std::string& OptionName); void onNameTagOpacityChange(const LLSD& newvalue); // set value of "DoNotDisturbResponseChanged" in account settings depending on whether do not disturb response @@ -170,6 +173,7 @@ public: private: static std::string sSkin; + notifications_map mNotificationOptions; bool mClickActionDirty; ///< Set to true when the click/double-click options get changed by user. bool mGotPersonalInfo; bool mOriginalIMViaEmail; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b5dc4a7967..f0e2f45db3 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -29,6 +29,7 @@ #include "llimview.h" #include "llavatarnamecache.h" // IDEVO +#include "llavataractions.h" #include "llfloaterreg.h" #include "llfontgl.h" #include "llgl.h" @@ -113,76 +114,84 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID())); } -void toast_callback(const LLSD& msg){ - // do not show toast in do not disturb mode or it goes from agent - if (gAgent.isDoNotDisturb() || gAgent.getID() == msg["from_id"]) - { - return; - } +void on_new_message(const LLSD& msg) +{ + std::string action; + LLUUID participant_id = msg["from_id"].asUUID(); + LLUUID session_id = msg["session_id"]; + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); - // Skip toasting if we have open window of IM with this session id - LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(msg["session_id"]); - if ( - open_im_floater - && open_im_floater->isInVisibleChain() - && open_im_floater->hasFocus() - && !open_im_floater->isMinimized() - && !(open_im_floater->getHost() - && open_im_floater->getHost()->isMinimized()) - ) + // determine action for this session + if (session_id.isNull()) { - return; + action = gSavedSettings.getString("NotificationNearbyChatOptions"); } - - // Skip toasting for system messages - if (msg["from_id"].asUUID() == LLUUID::null) - { - return; - } - - // *NOTE Skip toasting if the user disable it in preferences/debug settings ~Alexandrea - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( - msg["session_id"]); - - - //Ignore P2P Friend/Non-Friend toasts - if(session->isP2PSessionType()) + else if(session->isP2PSessionType()) { - //Ignores non-friends - if((LLAvatarTracker::instance().getBuddyInfo(msg["from_id"]) == NULL) - && (gSavedSettings.getString("NotificationNonFriendIMOptions") != "toast")) + if (LLAvatarTracker::instance().isBuddy(msg["from_id"].asUUID())) { - return; + action = gSavedSettings.getString("NotificationFriendIMOptions"); } - //Ignores friends - else if(gSavedSettings.getString("NotificationFriendIMOptions") != "toast") + else { - return; + action = gSavedSettings.getString("NotificationNonFriendIMOptions"); } } - //Ignore Ad Hoc Toasts - else if(session->isAdHocSessionType() - && (gSavedSettings.getString("NotificationConferenceIMOptions") != "toast")) + else if(session->isAdHocSessionType()) { - return; + action = gSavedSettings.getString("NotificationConferenceIMOptions"); } - //Ignore Group Toasts - else if(session->isGroupSessionType() - && (gSavedSettings.getString("NotificationGroupChatOptions") != "toast")) + else if(session->isGroupSessionType()) { - return; + action = gSavedSettings.getString("NotificationGroupChatOptions"); } - //Show toast - LLAvatarNameCache::get(msg["from_id"].asUUID(), - boost::bind(&on_avatar_name_cache_toast, - _1, _2, msg)); + // do not show notification in "do not disturb" mode or it goes from agent + if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id) + { + return; + } + + if ("toast" == action) + { + // Skip toasting if we have open window of IM with this session id + LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(msg["session_id"]); + if ( + open_im_floater + && open_im_floater->isInVisibleChain() + && open_im_floater->hasFocus() + && !open_im_floater->isMinimized() + && !(open_im_floater->getHost() + && open_im_floater->getHost()->isMinimized()) + ) + { + return; + } + + // Skip toasting for system messages + if (participant_id.isNull()) + { + return; + } + + //Show toast + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } + else if ("flash" == action) + { + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + if (im_box) + { + im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item + } + gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat" + } } LLIMModel::LLIMModel() { addNewMsgCallback(boost::bind(&LLFloaterIMSession::newIMCallback, _1)); - addNewMsgCallback(boost::bind(&toast_callback, _1)); + addNewMsgCallback(boost::bind(&on_new_message, _1)); } LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice, bool has_offline_msg) @@ -1713,7 +1722,7 @@ BOOL LLCallDialog::postBuild() return FALSE; dockToToolbarButton("speak"); - + return TRUE; } @@ -2110,7 +2119,6 @@ BOOL LLIncomingCallDialog::postBuild() getChildView("Start IM")->setVisible( is_avatar && notify_box_type != "VoiceInviteAdHoc" && notify_box_type != "VoiceInviteGroup"); setCanDrag(FALSE); - return TRUE; } @@ -2118,7 +2126,6 @@ void LLIncomingCallDialog::setCallerName(const std::string& ui_title, const std::string& ui_label, const std::string& call_type) { - setTitle(ui_title); // call_type may be a string like " is calling." LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name"); @@ -2136,7 +2143,7 @@ void LLIncomingCallDialog::onAvatarNameCache(const LLUUID& agent_id, void LLIncomingCallDialog::onOpen(const LLSD& key) { LLCallDialog::onOpen(key); - + make_ui_sound("UISndStartIM"); LLStringUtil::format_map_t args; LLGroupData data; // if it's a group call, retrieve group name to use it in question @@ -2144,18 +2151,6 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) { args["[GROUP]"] = data.mName; } - // tell the user which voice channel they would be leaving - LLVoiceChannel *voice = LLVoiceChannel::getCurrentVoiceChannel(); - if (voice && !voice->getSessionName().empty()) - { - args["[CURRENT_CHAT]"] = voice->getSessionName(); - getChild<LLUICtrl>("question")->setValue(getString(key["question_type"].asString(), args)); - } - else - { - args["[CURRENT_CHAT]"] = getString("localchat"); - getChild<LLUICtrl>("question")->setValue(getString(key["question_type"].asString(), args)); - } } //static @@ -2216,6 +2211,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload { gIMMgr->startCall(session_id, LLVoiceChannel::INCOMING_CALL); } + else + { + LLAvatarActions::startIM(caller_id); + } gIMMgr->clearPendingAgentListUpdates(session_id); gIMMgr->clearPendingInvitation(session_id); diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 81194f61cf..a7864381a9 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -8,8 +8,8 @@ layout="topleft" name="incoming call" help_topic="incoming_call" - title="Incoming call" - width="410"> + sound_flags="0" + width="550"> <floater.string name="lifetime"> 5 @@ -24,7 +24,7 @@ </floater.string> <floater.string name="VoiceInviteP2P"> - is calling. + is calling you. </floater.string> <floater.string name="VoiceInviteAdHoc"> @@ -49,14 +49,14 @@ image_name="icon_avatar_online.tga" layout="topleft" left_delta="19" - top="35" + top="20" width="36" /> <group_icon enabled="false" follows="left|top" height="36" layout="topleft" - top="35" + top="20" width="36" /> <text clip_partial="true" @@ -67,43 +67,43 @@ name="caller name" top="20" use_ellipses="true" - width="315" + width="475" word_wrap="true" /> - <text - clip_partial="true" - font="SansSerif" - height="30" - layout="topleft" - left="77" - name="question" - top_pad="5" - use_ellipses="true" - width="315" - word_wrap="true"> - Do you want to leave [CURRENT_CHAT] and join this voice chat? - </text> - <button + <button height="24" - label="Accept" - label_selected="Accept" + label="Answer" + label_selected="Answer" layout="topleft" left="70" name="Accept" - top="92" - width="100" /> + top_pad="5" + width="120" /> <button height="24" - label="Reject" - label_selected="Reject" + label="Ignore" + label_selected="Ignore" layout="topleft" name="Reject" left_pad="10" - width="100" /> + width="120" /> <button height="24" - label="Start IM" + label="Open IM instead" layout="topleft" name="Start IM" left_pad="10" - width="100" /> + width="120" /> + <text + clip_partial="true" + font="SansSerif" + height="30" + layout="topleft" + left="77" + name="question" + top_pad="5" + use_ellipses="true" + width="475" + word_wrap="true"> + If you answer, you will be disconnected from your current voice conversation. + </text> </floater> diff --git a/indra/newview/skins/default/xui/en/menu_participant_view.xml b/indra/newview/skins/default/xui/en/menu_participant_view.xml index 523ce7b35b..33d7bd7c01 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_view.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_view.xml @@ -85,5 +85,8 @@ <menu_item_check.on_click function="Floater.Toggle" parameter="conversation" /> - </menu_item_check> + <menu_item_check.on_enable + function="Avatar.EnableItem" + parameter="conversation_log" /> + </menu_item_check> </toggleable_menu> |