Pull merge from richard/viewer-chui

meow-7.2.2
Merov Linden 2012-06-14 16:59:05 -07:00
commit 22133d281d
10 changed files with 150 additions and 75 deletions

View File

@ -31,7 +31,6 @@
#include "llavatarlistitem.h"
#include "llbutton.h"
#include "llclipboard.h"
#include "llfloaterreg.h"
#include "lltextutil.h"

View File

@ -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)
{

View File

@ -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)

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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

View File

@ -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;

View File

@ -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>