From 86150b4019d1a84b4af73f0ea18c47baff955562 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 21 Feb 2013 19:15:48 -0800 Subject: CHUI-568 : WIP : Introduced Ctrl-T and Ctrl-H for conversations and nearby chat --- indra/newview/llfloaterimnearbychat.cpp | 21 +++++++++++++++++++++ indra/newview/llfloaterimnearbychat.h | 2 ++ indra/newview/skins/default/xui/en/menu_viewer.xml | 8 ++++---- 3 files changed, 27 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 430326203f..80051eb7f1 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -135,6 +135,27 @@ BOOL LLFloaterIMNearbyChat::postBuild() return result; } +// virtual +void LLFloaterIMNearbyChat::closeFloater(bool app_quitting) +{ + llinfos << "Merov debug : LLFloaterIMNearbyChat::closeFloater! " << llendl; + LLFloater::closeFloater(app_quitting); +} + +// virtual +void LLFloaterIMNearbyChat::closeHostedFloater() +{ + if (getHost()) + { + llinfos << "Merov debug : LLFloaterIMNearbyChat::closeHostedFloater : hosted -> do nothing" << llendl; + } + else + { + llinfos << "Merov debug : LLFloaterIMNearbyChat::closeHostedFloater : close floater " << llendl; + LLFloater::closeFloater(); + } +} + // virtual void LLFloaterIMNearbyChat::refresh() { diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index 14c7d01ecd..2d32bb3fc9 100644 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -54,6 +54,8 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ void closeFloater(bool app_quitting = false); + /*virtual*/ void closeHostedFloater(); void loadHistory(); void reloadMessages(bool clean_messages = false); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b50deb7d7a..544f06ac0c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -183,8 +183,7 @@ + name="Toolbars"> @@ -223,7 +222,8 @@ tear_off="true"> + name="Conversations" + shortcut="control|T"> @@ -240,7 +240,7 @@ function="Floater.Visible" parameter="nearby_chat" /> Date: Sat, 23 Feb 2013 11:22:09 -0800 Subject: CHUI-568 : Fixed! Implemented Ctrl-H for Nearby Chat, taking into account the existence of other conversations and docked/torn off state --- indra/newview/llfloaterimcontainer.cpp | 24 ++++++++++++++++++++++++ indra/newview/llfloaterimcontainer.h | 2 ++ indra/newview/llfloaterimnearbychat.cpp | 20 +++++++++----------- indra/newview/llfloaterimnearbychat.h | 1 - 4 files changed, 35 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index c8088588da..73fcfa244e 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1337,6 +1337,30 @@ void LLFloaterIMContainer::selectConversation(const LLUUID& session_id) selectConversationPair(session_id, true); } +// Select the conversation *after* (or before if none after) the passed uuid conversation +// Used to change the selection on key hits +void LLFloaterIMContainer::selectNextConversation(const LLUUID& uuid) +{ + LLFolderViewItem* new_selection = NULL; + LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid); + if (widget) + { + new_selection = mConversationsRoot->getNextFromChild(widget, FALSE); + if (!new_selection) + { + new_selection = mConversationsRoot->getPreviousFromChild(widget, FALSE); + } + } + if (new_selection) + { + LLConversationItem* vmi = dynamic_cast(new_selection->getViewModelItem()); + if (vmi) + { + selectConversationPair(vmi->getUUID(), true); + } + } +} + // Synchronous select the conversation item and the conversation floater BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool select_widget) { diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 569fa9faab..33d63a391c 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -69,6 +69,7 @@ public: void returnFloaterToHost(); void showConversation(const LLUUID& session_id); void selectConversation(const LLUUID& session_id); + void selectNextConversation(const LLUUID& session_id); BOOL selectConversationPair(const LLUUID& session_id, bool select_widget); void clearAllFlashStates(); @@ -186,6 +187,7 @@ public: static bool isConversationLoggingAllowed(); void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes); boost::signals2::connection mMicroChangedSignal; + S32 getConversationListItemSize() { return mConversationsWidgets.size(); } private: LLConversationViewSession* createConversationItemWidget(LLConversationItem* item); diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 80051eb7f1..a3b81e037a 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -135,24 +135,22 @@ BOOL LLFloaterIMNearbyChat::postBuild() return result; } -// virtual -void LLFloaterIMNearbyChat::closeFloater(bool app_quitting) -{ - llinfos << "Merov debug : LLFloaterIMNearbyChat::closeFloater! " << llendl; - LLFloater::closeFloater(app_quitting); -} - // virtual void LLFloaterIMNearbyChat::closeHostedFloater() { - if (getHost()) + // Should check how many conversations are ongoing. Close all if 1 only (the Nearby Chat), select next one otherwise + LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance(); + if (floater_container->getConversationListItemSize() == 1) { - llinfos << "Merov debug : LLFloaterIMNearbyChat::closeHostedFloater : hosted -> do nothing" << llendl; + floater_container->closeFloater(); } else { - llinfos << "Merov debug : LLFloaterIMNearbyChat::closeHostedFloater : close floater " << llendl; - LLFloater::closeFloater(); + if (!getHost()) + { + setVisible(FALSE); + } + floater_container->selectNextConversation(LLUUID()); } } diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index 2d32bb3fc9..2992c12436 100644 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -54,7 +54,6 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ void closeFloater(bool app_quitting = false); /*virtual*/ void closeHostedFloater(); void loadHistory(); -- cgit v1.2.3 From fbf7217b49101faad3a4e910d8c88150c39e73d6 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 25 Feb 2013 15:00:48 +0200 Subject: CHUI-790 FIXED Just disable "+" if selected participant is your own avatar --- indra/newview/llpanelpeople.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6667706333..c5283404f1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -812,19 +812,20 @@ void LLPanelPeople::updateButtons() else { bool is_friend = true; - + bool is_self = false; // Check whether selected avatar is our friend. if (item_selected) { selected_id = selected_uuids.front(); is_friend = LLAvatarTracker::instance().getBuddyInfo(selected_id) != NULL; + is_self = gAgent.getID() == selected_id; } LLPanel* cur_panel = mTabContainer->getCurrentPanel(); if (cur_panel) { if (cur_panel->hasChild("add_friend_btn", TRUE)) - cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend); + cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self); if (friends_tab_active) { -- cgit v1.2.3 From 4b6e1c26f05d89aa130a899803553940069457c0 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 22 Feb 2013 17:08:33 +0200 Subject: CHUI-633 FIXED User is not able to open chat history by 'View chat history' menu item from pop-up menu of People floater --- indra/newview/llavataractions.cpp | 14 +++++++++++++- indra/newview/llfloaterconversationpreview.cpp | 17 ++++++++++++++--- indra/newview/llfloaterconversationpreview.h | 5 +++++ indra/newview/lllogchat.cpp | 26 ++++++++++++++++++++++++++ indra/newview/lllogchat.h | 1 + indra/newview/llpanelpeoplemenus.cpp | 7 ++++++- 6 files changed, 65 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index d6e457887b..ce063a9887 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -44,6 +44,7 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llconversationlog.h" #include "llfloateravatarpicker.h" // for LLFloaterAvatarPicker +#include "llfloaterconversationpreview.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" #include "llfloaterreg.h" @@ -926,9 +927,20 @@ void LLAvatarActions::viewChatHistory(const LLUUID& id) if (iter->getParticipantID() == id) { LLFloaterReg::showInstance("preview_conversation", iter->getSessionID(), true); - break; + return; } } + + if (LLLogChat::isTranscriptExist(id)) + { + LLAvatarName avatar_name; + LLSD extended_id(id); + + LLAvatarNameCache::get(id, &avatar_name); + extended_id[LL_FCP_COMPLETE_NAME] = avatar_name.getCompleteName(); + extended_id[LL_FCP_ACCOUNT_NAME] = avatar_name.getAccountName(); + LLFloaterReg::showInstance("preview_conversation", extended_id, true); + } } //== private methods ======================================================================================== diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 48e0caa0ce..a3d715530d 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -33,13 +33,19 @@ #include "llspinctrl.h" #include "lltrans.h" +const std::string LL_FCP_COMPLETE_NAME("complete_name"); +const std::string LL_FCP_ACCOUNT_NAME("user_name"); + LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_id) : LLFloater(session_id), mChatHistory(NULL), mSessionID(session_id.asUUID()), mCurrentPage(0), - mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")) -{} + mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), + mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), + mCompleteName(session_id[LL_FCP_COMPLETE_NAME]) +{ +} BOOL LLFloaterConversationPreview::postBuild() { @@ -49,7 +55,12 @@ BOOL LLFloaterConversationPreview::postBuild() std::string name; std::string file; - if (mSessionID != LLUUID::null && conv) + if (mAccountName != "") + { + name = mCompleteName; + file = mAccountName; + } + else if (mSessionID != LLUUID::null && conv) { name = conv->getConversationName(); file = conv->getHistoryFileName(); diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index 0341e5d2a0..b17ae84b63 100644 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -29,6 +29,9 @@ #include "llchathistory.h" #include "llfloater.h" +extern const std::string LL_FCP_COMPLETE_NAME; //"complete_name" +extern const std::string LL_FCP_ACCOUNT_NAME; //"user_name" + class LLSpinCtrl; class LLFloaterConversationPreview : public LLFloater @@ -54,6 +57,8 @@ private: int mPageSize; std::list mMessages; + std::string mAccountName; + std::string mCompleteName; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 17b72c5023..09f816a4e6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -28,6 +28,7 @@ #include "llagent.h" #include "llagentui.h" +#include "llavatarnamecache.h" #include "lllogchat.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -540,6 +541,31 @@ void LLLogChat::deleteTranscripts() LLFloaterIMSessionTab::processChatHistoryStyleUpdate(true); } +// static +bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id) +{ + std::vector list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); + + if (list_of_transcriptions.size() > 0) + { + LLAvatarName avatar_name; + LLAvatarNameCache::get(avatar_id, &avatar_name); + std::string avatar_user_name = avatar_name.getAccountName(); + std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (std::string::npos != transcript_file_name.find(avatar_user_name)) + { + return true; + } + } + } + + return false; +} + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name //which are more strict by its nature (only firstname and secondname) //Example, an object's name can be written like "Object " diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 5fbb4ade96..b981d9ce04 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -57,6 +57,7 @@ public: static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); static void deleteTranscripts(); + static bool isTranscriptExist(const LLUUID& avatar_id); private: static std::string cleanFileName(std::string filename); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 61e9468ce5..47d6b49a50 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -37,6 +37,7 @@ #include "llagentdata.h" // for gAgentID #include "llavataractions.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "lllogchat.h" #include "llviewermenu.h" // for gMenuHolder namespace LLPanelPeopleMenus @@ -180,7 +181,11 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata) { return LLAvatarActions::canOfferTeleport(mUUIDs); } - else if (item == std::string("can_im") || item == std::string("can_callog") || item == std::string("can_invite") || + else if (item == std::string("can_callog")) + { + return LLLogChat::isTranscriptExist(mUUIDs.front()); + } + else if (item == std::string("can_im") || item == std::string("can_invite") || item == std::string("can_share") || item == std::string("can_pay")) { return true; -- cgit v1.2.3