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