From ec726c3a3ecbefd34008cd735f455c7947b67246 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 11 Jun 2012 17:04:58 +0300 Subject: CHUI-119 WIP Fixed some bugs --- indra/newview/llstartup.cpp | 6 +++++- indra/newview/skins/default/xui/en/floater_im_session.xml | 7 +++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 320a602916..65fd6d7019 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -63,7 +63,7 @@ #include "llmemorystream.h" #include "llmessageconfig.h" #include "llmoveview.h" -#include "llnearbychat.h" +#include "llimfloatercontainer.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llteleporthistory.h" @@ -1376,6 +1376,10 @@ bool idle_startup() LLVoiceClient::getInstance()->updateSettings(); display_startup(); + // create a container's instance for start a controlling conversation windows + // by the voice's events + LLIMFloaterContainer::getInstance(); + // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 21fc2d25d4..e5e005e36f 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -236,10 +236,9 @@ - + width="220"> -- cgit v1.2.3 From 9993fa550ab3716e583a6d5699f27974c3a95eb9 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 12 Jun 2012 21:56:00 +0300 Subject: CHUI-119 WIP Suppressed of the warnings (XML corrected); fixed the torn-off button's states --- indra/newview/llimconversation.cpp | 40 +++++++++------------- indra/newview/llnearbychat.cpp | 14 ++++---- .../skins/default/xui/en/floater_im_session.xml | 9 +++-- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index c2621938e1..99b28255cd 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -85,11 +85,11 @@ BOOL LLIMConversation::postBuild() mParticipantListPanel = getChild("speakers_list_panel"); // Show the participants list in torn off floaters only. - mParticipantListPanel->setVisible(gSavedSettings.getBOOL("IMShowControlPanel") - && !mIsNearbyChat); // *TODO: temporarily disabled for Nearby chat - mExpandCollapseBtn->setImageOverlay( - getString(mParticipantListPanel->getVisible() ? "collapse_icon" : "expand_icon")); - mExpandCollapseBtn->setEnabled(!mIsP2PChat); +// mParticipantListPanel->setVisible(gSavedSettings.getBOOL("IMShowControlPanel") +// && !mIsNearbyChat); // *TODO: temporarily disabled for Nearby chat +// mExpandCollapseBtn->setImageOverlay( +// getString(mParticipantListPanel->getVisible() ? "collapse_icon" : "expand_icon")); +// mExpandCollapseBtn->setEnabled(!mIsP2PChat); mTearOffBtn = getChild("tear_off_btn"); mTearOffBtn->setCommitCallback(boost::bind(&LLIMConversation::onTearOffClicked, this)); @@ -210,30 +210,22 @@ void LLIMConversation::updateHeaderAndToolbar() } } - bool is_control_panel_visible = false; - // Control panel should be visible only in torn off floaters. - is_control_panel_visible = !is_hosted && gSavedSettings.getBOOL("IMShowControlPanel"); - mParticipantListPanel->setVisible(!mIsP2PChat && is_control_panel_visible - && !mIsNearbyChat); // *TODO: temporarily disabled for Nearby chat + // Participant list should be visible only in torn off floaters. + bool is_participant_list_visible = + !is_hosted + && gSavedSettings.getBOOL("IMShowControlPanel") + && !mIsP2PChat + && !mIsNearbyChat; // *TODO: temporarily disabled for Nearby chat + + mParticipantListPanel->setVisible(is_participant_list_visible); // Display collapse image (<<) if the floater is hosted // or if it is torn off but has an open control panel. - bool is_expanded = is_hosted || is_control_panel_visible; + bool is_expanded = is_hosted || is_participant_list_visible; mExpandCollapseBtn->setImageOverlay(getString(is_expanded ? "collapse_icon" : "expand_icon")); - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); - if (session) - { - // The button (>>) should be disabled for torn off P2P conversations. - mExpandCollapseBtn->setEnabled(is_hosted || !session->isP2PSessionType()); - } - else - { - if (!mIsNearbyChat) - { - llwarns << "IM session not found." << llendl; - } - } + // The button (>>) should be disabled for torn off P2P conversations. + mExpandCollapseBtn->setEnabled(is_hosted || !mIsP2PChat && !mIsNearbyChat); if (mDragHandle) { diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index e35dbf21d4..2f5a3a8767 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -126,7 +126,7 @@ LLNearbyChat::LLNearbyChat(const LLSD& key) : LLIMConversation(key), mChatBox(NULL), mChatHistory(NULL), - mOutputMonitor(NULL), + //mOutputMonitor(NULL), mSpeakerMgr(NULL), mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) { @@ -152,8 +152,8 @@ BOOL LLNearbyChat::postBuild() mChatBox->setEnableLineHistory(TRUE); mChatBox->setFont(LLViewerChat::getChatFont()); - mOutputMonitor = getChild("chat_zone_indicator"); - mOutputMonitor->setVisible(FALSE); +// mOutputMonitor = getChild("chat_zone_indicator"); +// mOutputMonitor->setVisible(FALSE); // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChat::onChatFontChange, this, _1)); @@ -184,6 +184,8 @@ BOOL LLNearbyChat::postBuild() loadHistory(); } + setTitle(getString("NearbyChatTitle")); + return LLIMConversation::postBuild(); } @@ -718,12 +720,12 @@ void LLNearbyChat::displaySpeakingIndicator() if (!id.isNull()) { - mOutputMonitor->setVisible(TRUE); - mOutputMonitor->setSpeakerId(id); + //mOutputMonitor->setVisible(TRUE); + //mOutputMonitor->setSpeakerId(id); } else { - mOutputMonitor->setVisible(FALSE); + //mOutputMonitor->setVisible(FALSE); } } diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index e5e005e36f..a4695b8c09 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -15,6 +15,9 @@ can_tear_off="false" min_width="250" min_height="190"> + VoicePTT_Off VoicePTT_On + left="0"> -- cgit v1.2.3 From b50349ab8490c9b48e9cf89b8de186b528d90e60 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 13 Jun 2012 19:26:17 +0300 Subject: CHUI-120 WIP Fix for crash after closing the chat floater. --- indra/newview/llimconversation.cpp | 4 ++++ indra/newview/llimfloater.cpp | 4 ++++ indra/newview/llnearbychat.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 99b28255cd..b45fc63825 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -114,6 +114,10 @@ BOOL LLIMConversation::postBuild() BOOL LLIMConversation::tick() { + // This check is needed until LLFloaterReg::removeInstance() is synchronized with deleting the floater + // via LLMortician::updateClass(), to avoid calling dead instances. See LLFloater::destroy(). + if (isDead()) return false; + // Need to resort the participant list if it's in sort by recent speaker order. if (mParticipantList) { diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index dcd19b5856..3458e740e7 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -487,6 +487,10 @@ void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, // virtual BOOL LLIMFloater::tick() { + // This check is needed until LLFloaterReg::removeInstance() is synchronized with deleting the floater + // via LLMortician::updateClass(), to avoid calling dead instances. See LLFloater::destroy(). + if (isDead()) return false; + BOOL parents_retcode = LLIMConversation::tick(); if ( mMeTyping ) diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 2f5a3a8767..cd181ce865 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -404,6 +404,10 @@ void LLNearbyChat::showTranslationCheckbox(BOOL show) BOOL LLNearbyChat::tick() { + // This check is needed until LLFloaterReg::removeInstance() is synchronized with deleting the floater + // via LLMortician::updateClass(), to avoid calling dead instances. See LLFloater::destroy(). + if (isDead()) return false; + BOOL parents_retcode = LLIMConversation::tick(); displaySpeakingIndicator(); -- cgit v1.2.3 From 569146f27c7350ca2245f1fa7bc4cb9c16a428ea Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 13 Jun 2012 21:21:19 +0300 Subject: CHUI-120 WIP Modified chat participants drag and drop not to use LLClipboard. --- indra/newview/llavatarlistitem.cpp | 1 - indra/newview/llimfloater.cpp | 8 +-- indra/newview/llimfloater.h | 2 +- indra/newview/lltooldraganddrop.cpp | 97 ++++++++++++++++++++++++++----------- 4 files changed, 73 insertions(+), 35 deletions(-) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 7ba63bc4a2..7b5229b5e6 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -31,7 +31,6 @@ #include "llavatarlistitem.h" #include "llbutton.h" -#include "llclipboard.h" #include "llfloaterreg.h" #include "lltextutil.h" diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 3458e740e7..7c6de01c96 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -1004,7 +1004,7 @@ BOOL LLIMFloater::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { if (cargo_type == DAD_PERSON) { - if (dropPerson(static_cast(cargo_data), drop)) + if (dropPerson(static_cast(cargo_data), drop)) { *accept = ACCEPT_YES_MULTI; } @@ -1016,13 +1016,13 @@ BOOL LLIMFloater::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return TRUE; } -bool LLIMFloater::dropPerson(LLInventoryObject* item, bool drop) +bool LLIMFloater::dropPerson(LLUUID* person_id, bool drop) { - bool res = item && item->getUUID().notNull(); + bool res = person_id && person_id->notNull(); if(res) { uuid_vec_t ids; - ids.push_back(item->getUUID()); + ids.push_back(*person_id); res = canAddSelectedToChat(ids); if(res && drop) diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index b02f779637..d74b13b88d 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -138,7 +138,7 @@ private: // For display name lookups for IM window titles void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - bool dropPerson(LLInventoryObject* item, bool drop); + bool dropPerson(LLUUID* person_id, bool drop); BOOL isInviteAllowed() const; BOOL inviteToSession(const uuid_vec_t& agent_ids); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 296ded6831..86708b46d5 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -58,7 +58,6 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" -#include "llclipboard.h" // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) @@ -654,33 +653,41 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, sOperationId++; } + // For people drag and drop we don't need an actual inventory object, + // instead we need the current cargo id, which should be a person id. + bool is_uuid_dragged = (mSource == SOURCE_PEOPLE); + if (top_view) { handled = TRUE; for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { - LLInventoryObject* cargo = locateInventory(item, cat); + S32 local_x, local_y; + top_view->screenPointToLocal( x, y, &local_x, &local_y ); + EAcceptance item_acceptance = ACCEPT_NO; + LLInventoryObject* cargo = locateInventory(item, cat); if (cargo) { - S32 local_x, local_y; - top_view->screenPointToLocal( x, y, &local_x, &local_y ); - EAcceptance item_acceptance = ACCEPT_NO; handled = handled && top_view->handleDragAndDrop(local_x, local_y, mask, FALSE, mCargoTypes[mCurItemIndex], (void*)cargo, &item_acceptance, mToolTipMsg); - if (handled) - { - // use sort order to determine priority of acceptance - *acceptance = (EAcceptance)llmin((U32)item_acceptance, (U32)*acceptance); - } } - else + else if (is_uuid_dragged) { - return; + handled = handled && top_view->handleDragAndDrop(local_x, local_y, mask, FALSE, + mCargoTypes[mCurItemIndex], + (void*)&mCargoIDs[mCurItemIndex], + &item_acceptance, + mToolTipMsg); + } + if (handled) + { + // use sort order to determine priority of acceptance + *acceptance = (EAcceptance)llmin((U32)item_acceptance, (U32)*acceptance); } } @@ -697,20 +704,27 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { - LLInventoryObject* cargo = locateInventory(item, cat); + S32 local_x, local_y; + EAcceptance item_acceptance; + top_view->screenPointToLocal( x, y, &local_x, &local_y ); + LLInventoryObject* cargo = locateInventory(item, cat); if (cargo) { - S32 local_x, local_y; - - EAcceptance item_acceptance; - top_view->screenPointToLocal( x, y, &local_x, &local_y ); handled = handled && top_view->handleDragAndDrop(local_x, local_y, mask, TRUE, mCargoTypes[mCurItemIndex], (void*)cargo, &item_acceptance, mToolTipMsg); } + else if (is_uuid_dragged) + { + handled = handled && top_view->handleDragAndDrop(local_x, local_y, mask, FALSE, + mCargoTypes[mCurItemIndex], + (void*)&mCargoIDs[mCurItemIndex], + &item_acceptance, + mToolTipMsg); + } } } if (handled) @@ -727,17 +741,27 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { + EAcceptance item_acceptance = ACCEPT_NO; + LLInventoryObject* cargo = locateInventory(item, cat); // fix for EXT-3191 - if (NULL == cargo) return; - - EAcceptance item_acceptance = ACCEPT_NO; - handled = handled && root_view->handleDragAndDrop(x, y, mask, FALSE, - mCargoTypes[mCurItemIndex], - (void*)cargo, - &item_acceptance, - mToolTipMsg); + if (cargo) + { + handled = handled && root_view->handleDragAndDrop(x, y, mask, FALSE, + mCargoTypes[mCurItemIndex], + (void*)cargo, + &item_acceptance, + mToolTipMsg); + } + else if (is_uuid_dragged) + { + handled = handled && root_view->handleDragAndDrop(x, y, mask, FALSE, + mCargoTypes[mCurItemIndex], + (void*)&mCargoIDs[mCurItemIndex], + &item_acceptance, + mToolTipMsg); + } if (handled) { // use sort order to determine priority of acceptance @@ -757,17 +781,25 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { - LLInventoryObject* cargo = locateInventory(item, cat); + EAcceptance item_acceptance; + LLInventoryObject* cargo = locateInventory(item, cat); if (cargo) { - EAcceptance item_acceptance; handled = handled && root_view->handleDragAndDrop(x, y, mask, TRUE, mCargoTypes[mCurItemIndex], (void*)cargo, &item_acceptance, mToolTipMsg); } + else if (is_uuid_dragged) + { + handled = handled && root_view->handleDragAndDrop(x, y, mask, TRUE, + mCargoTypes[mCurItemIndex], + (void*)&mCargoIDs[mCurItemIndex], + &item_acceptance, + mToolTipMsg); + } } } @@ -2495,7 +2527,13 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( { item = NULL; cat = NULL; - if(mCargoIDs.empty()) return NULL; + + if (mCargoIDs.empty() + || (mSource == SOURCE_PEOPLE)) ///< There is no inventory item for people drag and drop. + { + return NULL; + } + if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) { // The object should be in user inventory. @@ -2527,10 +2565,11 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( item = (LLViewerInventoryItem*)preview->getDragItem(); } } - else if(mSource == SOURCE_VIEWER || mSource == SOURCE_PEOPLE) + else if(mSource == SOURCE_VIEWER) { item = (LLViewerInventoryItem*)gToolBarView->getDragItem(); } + if(item) return item; if(cat) return cat; return NULL; -- cgit v1.2.3 From d34746b596bad717f7d0c10e263700738a06aa43 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Thu, 14 Jun 2012 17:37:16 +0300 Subject: CHUI-144 FIXED Residents picker added to Conversations panel + button. --- indra/newview/llimfloatercontainer.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llimfloatercontainer.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 3b6240de44..71b69dfbc8 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -34,8 +34,10 @@ #include "llnearbychat.h" #include "llagent.h" +#include "llavataractions.h" #include "llavatariconctrl.h" #include "llgroupiconctrl.h" +#include "llfloateravatarpicker.h" #include "llimview.h" #include "lltransientfloatermgr.h" #include "llviewercontrol.h" @@ -75,6 +77,8 @@ BOOL LLIMFloaterContainer::postBuild() mExpandCollapseBtn = getChild("expand_collapse_btn"); mExpandCollapseBtn->setClickedCallback(boost::bind(&LLIMFloaterContainer::onExpandCollapseButtonClicked, this)); + childSetAction("add_btn", boost::bind(&LLIMFloaterContainer::onAddButtonClicked, this)); + collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed")); collapseConversationsPane(gSavedPerAccountSettings.getBOOL("ConversationsListPaneCollapsed")); @@ -313,4 +317,26 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width) setCanMinimize(is_left_pane_expanded || is_right_pane_expanded); } +void LLIMFloaterContainer::onAddButtonClicked() +{ + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE); + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (picker && root_floater) + { + root_floater->addDependentFloater(picker); + } +} + +void LLIMFloaterContainer::onAvatarPicked(const uuid_vec_t& ids) +{ + if (ids.size() == 1) + { + LLAvatarActions::startIM(ids.back()); + } + else + { + LLAvatarActions::startConference(ids); + } +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 92938ff405..7b395fb18f 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -80,6 +80,9 @@ private: void updateState(bool collapse, S32 delta_width); + void onAddButtonClicked(); + void onAvatarPicked(const uuid_vec_t& ids); + LLButton* mExpandCollapseBtn; LLLayoutPanel* mMessagesPane; LLLayoutPanel* mConversationsPane; -- cgit v1.2.3