summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-06-14 16:59:05 -0700
committerMerov Linden <merov@lindenlab.com>2012-06-14 16:59:05 -0700
commit22133d281d0c70f13f63d0db2083d6d3cbf002da (patch)
tree7f964f3817091833ca337c5b40a5526e0fb883dd /indra
parentc238027dd9917b1633ff5f16911fbdbe437f9a55 (diff)
parentd34746b596bad717f7d0c10e263700738a06aa43 (diff)
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llavatarlistitem.cpp1
-rw-r--r--indra/newview/llimconversation.cpp44
-rw-r--r--indra/newview/llimfloater.cpp12
-rw-r--r--indra/newview/llimfloater.h2
-rw-r--r--indra/newview/llimfloatercontainer.cpp26
-rw-r--r--indra/newview/llimfloatercontainer.h3
-rw-r--r--indra/newview/llnearbychat.cpp18
-rw-r--r--indra/newview/llstartup.cpp6
-rw-r--r--indra/newview/lltooldraganddrop.cpp97
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml16
10 files changed, 150 insertions, 75 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/llimconversation.cpp b/indra/newview/llimconversation.cpp
index c2621938e1..b45fc63825 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -85,11 +85,11 @@ BOOL LLIMConversation::postBuild()
mParticipantListPanel = getChild<LLLayoutPanel>("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<LLButton>("tear_off_btn");
mTearOffBtn->setCommitCallback(boost::bind(&LLIMConversation::onTearOffClicked, this));
@@ -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)
{
@@ -210,30 +214,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/llimfloater.cpp b/indra/newview/llimfloater.cpp
index dcd19b5856..7c6de01c96 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 )
@@ -1000,7 +1004,7 @@ BOOL LLIMFloater::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
if (cargo_type == DAD_PERSON)
{
- if (dropPerson(static_cast<LLInventoryObject*>(cargo_data), drop))
+ if (dropPerson(static_cast<LLUUID*>(cargo_data), drop))
{
*accept = ACCEPT_YES_MULTI;
}
@@ -1012,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/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index c01a167169..af5d587f20 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -35,8 +35,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"
@@ -78,6 +80,8 @@ BOOL LLIMFloaterContainer::postBuild()
mExpandCollapseBtn = getChild<LLButton>("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"));
@@ -372,6 +376,28 @@ 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);
+ }
+}
+
// CHUI-137 : Temporary implementation of conversations list
LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item)
{
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 23927239a5..b5b60615b3 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -159,6 +159,9 @@ private:
void updateState(bool collapse, S32 delta_width);
+ void onAddButtonClicked();
+ void onAvatarPicked(const uuid_vec_t& ids);
+
LLButton* mExpandCollapseBtn;
LLLayoutPanel* mMessagesPane;
LLLayoutPanel* mConversationsPane;
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index e35dbf21d4..cd181ce865 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<LLOutputMonitorCtrl>("chat_zone_indicator");
- mOutputMonitor->setVisible(FALSE);
+// mOutputMonitor = getChild<LLOutputMonitorCtrl>("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();
}
@@ -402,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();
@@ -718,12 +724,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/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/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;
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..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">
+ <floater.string
+ name="NearbyChatTitle"
+ value="Nearby Chat"/>
<floater.string name="call_btn_start">VoicePTT_Off</floater.string>
<floater.string name="call_btn_stop">VoicePTT_On</floater.string>
<floater.string
@@ -131,9 +134,7 @@
name="im_panels"
tab_group="1"
top_pad="0"
- left="0"
- auto_resize="true"
- user_resize="true">
+ left="0">
<layout_panel
name="speakers_list_panel"
follows="all"
@@ -185,8 +186,6 @@
orientation="vertical"
name="translate_and_chat_stack"
tab_group="1"
- auto_resize="true"
- user_resize="true"
left_pad="0"
top="0"
left="0">
@@ -236,10 +235,9 @@
</layout_panel>
</layout_stack>
</panel>
- <panel width="228"
+ <panel width="225"
height="31"
- left="4"
- right="4"
+ left="4"
name="bottom_panel"
bottom="-1"
follows="left|right|bottom"
@@ -254,7 +252,7 @@
layout="bottomleft"
name="chat_editor"
tab_group="3"
- width="240">
+ width="220">
</line_editor>
</panel>
</layout_panel>